New Posts New Posts RSS Feed: [Resolved]Accessing current DetailGrid object???????
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

[Resolved]Accessing current DetailGrid object???????

 Post Reply Post Reply Page  123 4>
Author
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post Topic: [Resolved]Accessing current DetailGrid object???????
    Posted: 15-Jan-2008 at 10:07am
Originally posted by DeLight

thanks for explanation.
but could you please do textbox wider to (fnd maybe in quick reply form too). the main reason for this is posting sourcecodes.
 
Ok, wider is better !
 
Also, I am removing the posts regarding the forum format from this topic since it has nothing to do with Cabana.
 
Thank you for the feedback :)
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jan-2008 at 1:16pm
DeLight has made some good improvements. The only thing that needs to be done is add more events to the grid. Click, Drag and Drop and Context Menu's.
 
 
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jan-2008 at 1:05pm
Could you post it?
Back to Top
DeLight View Drop Down
Newbie
Newbie


Joined: 23-Aug-2007
Location: Belarus
Posts: 15
Post Options Post Options   Quote DeLight Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jan-2008 at 1:03pm
 
yes. you are right.


Edited by DeLight - 11-Jan-2008 at 1:05pm
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jan-2008 at 12:54pm
Looks as if you made changes to the GridViewAdapter as well.
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jan-2008 at 12:51pm
Not b a bother but I have one more issue. I get the following error  (Error 1 'IdeaBlade.Cab.DevEx.DevExGridViewAdapter.AllowOnlyOneMasterRowExpanded': no suitable method found to override C:\Development\CabanaDevExCS\LibSource\IdeaBlade\IdeaBlade.Cab.DevEx\Miscellaneous\DevExGridViewAdapter.cs 369 33 IdeaBlade.Cab.DevEx
)on:
 

AllowOnlyOneMasterRowExpanded

AutoExpandAllMasterRows

GridViewContextMenuVisible

 
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jan-2008 at 12:36pm
Missing that file in the rar. Tx
Back to Top
DeLight View Drop Down
Newbie
Newbie


Joined: 23-Aug-2007
Location: Belarus
Posts: 15
Post Options Post Options   Quote DeLight Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jan-2008 at 12:34pm
posting it again. but look at file named DevExGridViewMenuItem.cs in second rar i've posted. I think you just have the first one.

using IdeaBlade.Cab.Interface;
using IdeaBlade.Cab.Interface.Constants;
using IdeaBlade.Cab.UI.Services;
using Microsoft.Practices.CompositeUI;
using DevExpress.Utils.Menu;
using System;
using System.Drawing;
namespace IdeaBlade.Cab.DevEx
{
    public class DevExGridViewMenuItem : DXMenuItem
    {
        public DevExGridViewMenuItem(string pCaption, EventHandler pClick, Image pImage, bool pBeginGroup)
            : base(pCaption, pClick, pImage)
        {
            this.BeginGroup = pBeginGroup;
        }
        public ContextMenuItem SourceContextMenuItem
        {
            get
            {
                return mSourceContextMenuItem;
            }
            set
            {
                mSourceContextMenuItem = value;
            }
        }
        public object RowObject
        {
            get
            {
                return mRowObject;
            }
            set
            {
                mRowObject = value;
            }
        }
 
        private ContextMenuItem mSourceContextMenuItem;
        private object mRowObject;
    }
}
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jan-2008 at 12:15pm
It is actually not defined in any of those files. I have tried searching all the documents.
Back to Top
DeLight View Drop Down
Newbie
Newbie


Joined: 23-Aug-2007
Location: Belarus
Posts: 15
Post Options Post Options   Quote DeLight Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jan-2008 at 12:09pm
Originally posted by orcities

Where do you have DevExGridViewMenuItem ?
DevExGridViewMenuItem is DXMenuItem with some additional properties (current RowObject to refer to it in MenuItem click handler and SourceContextMenuItem to fire the handler in controller). It is used only in IdeaBlade.Cab.DevEx project. It is included in DetailGrid2.rar which I've uploaded recently.
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jan-2008 at 11:30am

Where do you have DevExGridViewMenuItem ?

Back to Top
DeLight View Drop Down
Newbie
Newbie


Joined: 23-Aug-2007
Location: Belarus
Posts: 15
Post Options Post Options   Quote DeLight Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jan-2008 at 11:08am

example of using context menus (almost the same way as using RowClick events):

context.GridViewContextMenuVisible = true;

context.AddContextMenuItem("Add item", MakeWorkItemSpecificId(CommandNames.AddNew));

context.AddContextMenuItem("Edit item", EditReservationHandler);

context.AddContextMenuItem("Delete parent item (no action)", true);

context.AddChildContextMenuItem("Delete option 1", DeleteReservationHandler);

context.AddChildContextMenuItem("Delete option 2", AnnulReservationHandler);

...
 

private void EditReservationHandler(GridRowEventArgs e)

{

EditorService.Edit(EditorNames.Reservation, (Reservation) e.RowObject);

}

...
 
CabFns.RegisterLocalCommandHandler(WorkItem, this.MakeWorkItemSpecificId(CommandNames.AddNew), AddReservation);
 

protected override void AddReservation(object sender, EventArgs e)

{

EditorService.AddNew(EditorNames.Reservation, null);

}

notice that menu items for adding objects are added via command names, so this menuitems are shown even when no data is present in grid.
 
ps. compiling all my changes to original Cabana in one solution (in one framework) is my big plan for nearest future after my main project big release (last days of January). and I wonder if IdeaBlade is going to release new version of Cabana - maybe we have to cooperate some way.
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jan-2008 at 8:03am

An example of the Context Menu use would be great to. I am tempted to ask for you whole cabana changes. I really like what you have done.

Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 11-Jan-2008 at 7:20am
I really like everything you have done. I will probably end up adding Drag-n-Drop to the features eventually.
 
Could I also get the code for the DevExGridViewMenuItem
Back to Top
DeLight View Drop Down
Newbie
Newbie


Joined: 23-Aug-2007
Location: Belarus
Posts: 15
Post Options Post Options   Quote DeLight Quote  Post ReplyReply Direct Link To This Post Posted: 10-Jan-2008 at 4:02pm
some other files you need:
 
Originally posted by orcities

Where are you tying the GRidView.RowClick to the Context.RowClick Event?
 
DeExGridViewAdapter:
public override void InitializeGridViewEvents()
{
...
GridView.MouseDown += MouseDownHandler;
...
}
 
void MouseDownHandler(object sender, MouseEventArgs e)
{
GridView gv = (GridView) sender;
GridHitInfo hitInfo = gv.CalcHitInfo(e.X, e.Y);
if (hitInfo.IsValid && hitInfo.InRow && gv.IsDataRow(hitInfo.RowHandle))
{
object rowObject = gv.GetRow(hitInfo.RowHandle);
if (rowObject == null)
    return;
 
GridRowEventArgs info = new GridRowEventArgs(rowObject);
ViewContext.OnRowClick(info);
}
 
mLastHitInfo = hitInfo;
}
 
 
 


Edited by DeLight - 10-Jan-2008 at 4:11pm
Back to Top
orcities View Drop Down
Senior Member
Senior Member
Avatar

Joined: 28-Aug-2007
Location: United States
Posts: 454
Post Options Post Options   Quote orcities Quote  Post ReplyReply Direct Link To This Post Posted: 10-Jan-2008 at 2:13pm
Where are you tying the GRidView.RowClick to the Context.RowClick Event?
Back to Top
 Post Reply Post Reply Page  123 4>

Forum Jump Forum Permissions View Drop Down