Print Page | Close Window

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

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=614
Printed Date: 12-May-2025 at 1:54pm


Topic: [Resolved]Accessing current DetailGrid object???????
Posted By: orcities
Subject: [Resolved]Accessing current DetailGrid object???????
Date Posted: 14-Dec-2007 at 9:58am
If you have a grid and you want to add a nested grid in it (DetailGrid) you add the DetailGridViewContext to the current GridViewContext.
 
I am trying to figure out how to get the currently selected item from that DetailGrid. I can get the current parent Item using the BindingSource.Current. But I have been unsuccessful in getting the Child items current.
 
Anyone have a clue.
 
Bill????



Replies:
Posted By: orcities
Date Posted: 19-Dec-2007 at 9:13am
What I have found is that if I try and use the detailViewContext.BindingSource it reverts to the BindingSource of the Root grid.
 
Any help would be great.


Posted By: orcities
Date Posted: 19-Dec-2007 at 3:19pm
Bill please confirm something for me.
 
If I want to add drag and drop or any other functionality to the DataGridView I will need to do the following:
 
Create:
 I[x]GridViewPresenter
 [x]GridViewPresenter : I[x]GridViewPresenter
        in the AddDetailGrid callthe appropriate GridViewBuilder that implements my events
 [x]GridViewAdapter that calls the approprate [x]GridViewContextBase that sets the event handler
 
Then in the View call the appropriate [x]GridViewPresenter class.
 
I haven't been able to find where it builds the root Grid.
 
Is this close to correct.


Posted By: Bill Jensen
Date Posted: 21-Dec-2007 at 2:26pm
Two questions in this thread.
 
Regarding the first:
 
As you can see in GridViewPresenter.cs (in IdeaBlade.Cab.UI), the detail grid(s) is (are) created by invoking the DevExDetailGridViewBuilder (set by the view at presenter injection time because it's dependent on the particular view technology--DevEx in this case).
 
The DevExDetailGridViewBuilder (in IdeaBlade.Cab.DevEx) actually creates the grid, creating a detail grid binding manager and binding it to a Relation property of the master object.
 
Unfortunately, getting at the detail grid binding manager and its data source is tough since they are not exposed to the presenter.  You can inherit from DevExDetailGridViewBuilder and override CreateDetailGrid().  Call the base method, then, before returning, set the detail binding manager into the DetailGridViewContext (you'll need your own derived detail context class to have a place to put it).
 
The next problem is that the type of the detail grid builder is hard-coded into the DevExGridView rather than being taken from the GridBuilderService.
 
You might be able to inherit from DevExBasicGridView and override the InjectPresenter() method.  Call SetPresenter(), then call
 
pPresenter.SetDetailGridViewBuilder(new MYDetailGridViewBuilder(GridBindingManager));
 
to substitute your detail grid view builder for the standard one.
 
I haven't tried this, so there might be some gotchas I've missed.  You'll have to make the call as to whether its worth it.
 
Regarding, the second question, yes you're on the right track.  By overriding DevExBasicGridView you can inject your custom presenter type.
 
The master grid is created by GridViewPresenter when the ViewContext has been set.
 
Bill J.


Posted By: orcities
Date Posted: 28-Dec-2007 at 10:09am
DataGridView does not implement InjectPresenter and the Presenter does not have the SetDetailGridViewBuilder Class


Posted By: Bill Jensen
Date Posted: 28-Dec-2007 at 5:06pm
Look at DevExBasicGridView (in IdeaBlade.Cab.DevEx).
 
You'll need to create your own MYDevExBasicGridView inheriting from DevExBasicGridView, define a public InjectPresenter() method [with the "new" modifier], and register it with the ViewFactoryService in place of the standard DevExBasicGridView.
 
Bill J.
 


Posted By: orcities
Date Posted: 02-Jan-2008 at 7:19am
So I also need to create my own presenter? And My own SetDetailGridViewBuilder method?


Posted By: orcities
Date Posted: 02-Jan-2008 at 9:28am
When I do that I get the following error. And I can't track where it is being thrown from.
 
 
"Could not find an appropriately matching constructor."
 
All i have done so far is Inherit from the DevExBasicGridView and add Register it.


Posted By: orcities
Date Posted: 02-Jan-2008 at 10:14am
I take that back I was doing it wrong. Now that I have corrected it I am getting the following error:
 
An item with the same key has already been added. (when inheriting DevExBasicGrid)
and
{"Cannot create an abstract class."} (When inheriting DevExGridView
 
Not sure why I have not changed anything other then Inheriting and the registering my version.
 
My GridView:

namespace LOC.CEMS.Foundation.Views

{

    /// <summary>View of a DevEx XtraGrid and DotNet BindingNavigator bound to a Type.</summary>

  [SmartPart]

  public partial class GreyGridView : DevExGridView, IBindingView{

 

    #region Ctor

    /// <summary>Injection Ctor.</summary>

    private GreyGridView() {

      InitializeComponent();

    }

 

    /// <summary>Ctor with BoundType.</summary>

    /// <remarks>Useful when setting the BoundType before ObjectBuilder builds out the view.</remarks>

      public GreyGridView(Type pBoundType)

      : this() {

      SetBoundType(pBoundType);

    }

 

    private void SetBoundType(Type pBoundType){

      BoundType = pBoundType;

    }

    #endregion

 

    /// <summary>

    /// Set the presenter by injection.

    /// </summary>

    [InjectionMethod]

    public void InjectPresenter([CreateNew]DevExGridViewPresenter<IBindingView> pPresenter) {

     SetPresenter(pPresenter);

    }

  }

}

My foundation:

viewFactory.UnregisterViewType(ViewNames.BasicGrid);        viewFactory.RegisterViewType<Views.GreyGridView>(ViewNames.BasicGrid);

 


Posted By: Bill Jensen
Date Posted: 02-Jan-2008 at 1:22pm

Hi Dan,

1.  You should be inheriting from DevExBasicGridView. 
 
2.  You should only need the public constructor.  In it, just call the base constructor accepting the bound type and let the base class manage the bound type.
 
3.  I notice you're injecting a presenter of type DevExGridViewPresenter.  Is this yours?  You should be able to get by with the standard "GridViewPresenter".
 
4.  You should get a warning that your InjectPresenter method hides the base class method.  Place the "new" keyword on your method.
 
5.  Then, after the SetPresenter() call, just call pPresenter.SetDetailGridViewBuilder(new MyDetailGridBuilder(GridBindingManager))
 
6.  Does the "An item with the same key has already been added" exception occur on the RegisterViewType() call in your foundation module?  Where in the foundation did you put these?  They should be in the ViewFactoryService override of RegisterInitialViewType().
 
Bill J.
 


Posted By: orcities
Date Posted: 02-Jan-2008 at 1:40pm
1. Shown below
2. Done
3. I am using the DevExGridViewPresenter just to make sure it works.
4. No warning. New keyword is in the Presenter [CreateNew]?
5. The error occurrs in the TypeOnlyMappingStratey.BuildUp
6. That is where it is.
 
[SmartPart]

  public partial class GreyGridView : DevExBasicGridView{

 

    #region Ctor

 

    /// <summary>Ctor with BoundType.</summary>

    /// <remarks>Useful when setting the BoundType before ObjectBuilder builds out the view.</remarks>

      public GreyGridView(Type pBoundType)

      : base(pBoundType) {

    }

    #endregion

 

    /// <summary>

    /// Set the presenter by injection.

    /// </summary>

    [InjectionMethod]

    public void InjectPresenter([CreateNew]DevExGridViewPresenter<IBindingView> pPresenter) {

     SetPresenter(pPresenter);

    }

  }



Posted By: orcities
Date Posted: 02-Jan-2008 at 2:04pm
5. pPresenter.SetDetailGridViewBuilder() doesn't exist.


Posted By: orcities
Date Posted: 02-Jan-2008 at 2:23pm
This is iritating the crap out of me. All I have basically done is rename the same file and unregister the basic grid and register my basic grid. Why in the world will it now work.


Posted By: Bill Jensen
Date Posted: 02-Jan-2008 at 2:26pm
Where is DevExGridViewPresenter defined?  (I see that it's defined because of its color in your code sample).  My version of DevExBasicGridView uses the common GridViewPresenter.  SetDetailGridViewBuilder() is defined in that class.
 
The "new" keyword should only be required if you're injecting the same presenter type as the base class.
 
Try changing the presenter type first.
 
If the error persists, try going back to a full copy of DevExBasicGridView that inherits from DevExGridView and we'll try to understand the "Cannot create and abstract  class" error.
 
 
Bill J.


Posted By: orcities
Date Posted: 02-Jan-2008 at 2:33pm
I see GridViewPresenterBase but not GridViewPresenter. Method is not defined in GridViewPresenterBase.
 
I did a search of the entire solution and could not find the method.
 
I am using Cabana 2.3.0.1
 

    [InjectionMethod]

    public void InjectPresenter([CreateNew]IdeaBlade.Cab.UI.Views.GridViewPresenterBase<IBindingView> pPresenter) {

     SetPresenter(pPresenter);

    }

 
I have also tried:

public void InjectPresenter([CreateNew]LOCGridViewPresenter<IBindingView> pPresenter)

 


Posted By: Bill Jensen
Date Posted: 02-Jan-2008 at 4:00pm
OK, you're right.  I'm working with a newer version in which Ward has done some major refactoring.  Please accept my apologies.
 
Looking back at 2.3.0.1 in our source code repository, DevExBasicGridView does indeed use DevExGridViewPresenter. 
 
So you're on exactly the right track.
 
1.  You'll need your own view (the more I think of it, it's probably best to copy DevExBasicGridView and inherit from DevExGridView) and register it instead of the standard DevExGridView.
 
2.  Make your LOCGridViewPresenter inherit from DevExGridViewPresenter.  Inject it into your grid view.
 
3.  Override AddDetailGrid() in LOCGridViewPresenter to create a LOCDetailGridViewBuilder that inherits from the standard DevExDetailGridViewBuilder.
 
4.  In your detail grid view builder, capture the detail binding manager in the detail view context.
 
Sorry for the version confusion.
 
Bill J.


Posted By: orcities
Date Posted: 03-Jan-2008 at 12:10pm
That makes more sense but I still get an error in the TypOnlyMappingStrategy.BuildUp:
 
Excpetion: Can not create an instance of type 'System.Type'.
Inner Exception: Cannot create an abstract class.
 
This comes at the point where I add the Grid using:
ViewFactory.AddNew(ViewNames.BasicGrid....) in the Page or Tab Controller.


Posted By: orcities
Date Posted: 03-Jan-2008 at 12:14pm
A little more indepth.
ViewFactory.AddNew calls SmartPart.AddNew going to the ObjectBuilder.TypeOnlyMappingStrategy.BuildUp which throws the error when calling base.BuildUp.
 
The parameter result.Type becomes System.Type for some reason.


Posted By: orcities
Date Posted: 03-Jan-2008 at 12:35pm
One more correction.
 
The first time to BuildUp it has type as GreyGridView then second time, after calling base.BuildUp it is System.Type.


Posted By: Bill Jensen
Date Posted: 03-Jan-2008 at 3:13pm
If it isn't already, make sure that your GregGridView is an exact copy (except for the name and namespace) of DevExBasicGridView (including injecting DevExGridViewPresenter).
 
I trust you've changed the namespace and class name in the .designer.cs file as well.
 
You could also try registering your view under a different name, then calling
 
ViewFactory.AddNew<GreyGridView>("newname", WorkItem, typeof(entity));
 
Bill J.


Posted By: orcities
Date Posted: 03-Jan-2008 at 3:33pm

I went through and double checked and even re-did all my references. I still get the same error. Even when I have it in conjuction to the BasicGrid.



Posted By: orcities
Date Posted: 03-Jan-2008 at 3:38pm
I have GreyGrid copied from DevExBasicGridView. I have it in the correct namespace.
 
Only change is the name of the class.
I have registered as follows:

RegisterViewType<Views.GreyGridView>(LOC.CEMS.Interface.Constants.ViewNames.GreyGridView)

Implemented as follows:

CreateGridViewContext();

pContext.GridViewId = GridViewId;

ViewFactory.AddNew(LOC.CEMS.Interface.Constants.ViewNames.GreyGridView, WorkItem, GridViewId, typeof(ContactAddress));


Posted By: orcities
Date Posted: 04-Jan-2008 at 8:25am
As an FYI I found this but can't not sure how to implement it.
This is suppose to get rid of hte problem.
 
public override object BuildUp(IBuilderContext context, Type t, object existing, string id)
        {
            DependencyResolutionLocatorKey result = new DependencyResolutionLocatorKey(t, id);

            ITypeMappingPolicy policy = null;
            if (t.IsGenericType)
            {
                Type genericType = t.GetGenericTypeDefinition();
                policy = context.Policies.Get<ITypeMappingPolicy>(genericType, id);
            }
            else
            {
                policy = context.Policies.Get<ITypeMappingPolicy>(t, id);
            }

            if (policy != null)
            {
                result = policy.Map(result);
                //TraceBuildUp(context, t, id, Properties.Resources.TypeMapped, result.Type, result.ID ?? "(null)");
                //Guard.TypeIsAssignableFromType(t, result.Type, t);
            }

            return base.BuildUp(context, result.Type, existing, result.ID);
        }
 

 


Posted By: orcities
Date Posted: 04-Jan-2008 at 8:41am
I take that back it doesn't work.
Source was inaccurate:
http://www.codeplex.com/ObjectBuilder/Thread/View.aspx?ThreadId=8694 - http://www.codeplex.com/ObjectBuilder/Thread/View.aspx?ThreadId=8694


Posted By: Bill Jensen
Date Posted: 04-Jan-2008 at 11:50am
Wow! 
 
It's only January 4th and we already have a nominee for the Most Obscure Cabana Code award of 2008!
 
I built a grid view similar to yours (using our newer Cabana version) and it fails in exactly the same way.  Here's how to fix it:
 
Make a generic version of GreyGridView (that merely passes the compile-time type parameter to the constructor at runtime) in GreyGridView.generic.cs:
 

namespace (yournamespace) {

// Can't put this inside GreyGridView.cs because VS Designer fails on a generic class.

[SmartPart]

public class GreyGridView<TBoundType> : GreyGridView {

/// <summary>Ctor.</summary>

public GreyGridView() : base(typeof(TBoundType)) { }

}

}

Then register THAT instead of the non-generic version using this overload:

viewFactory.RegisterViewTypeLOC.CEMS.Interface.Constants.ViewNames.GreyGridView, typeof(GreyGridView<>));

(Note the "<>" on the second parameter.)
 
That's exactly what Cabana does with the DevExBasicGridView and should get you past the abstract class problem.
 
I still don't fully understand why the non-generic version doesn't work right--it fails pretty deep in the object builder strategy chain, but there may be some assumption in the view factory that I don't know about.  I'll try to get Ward's attention and ask him about it.
 
Hope this gets you moving.  Sorry to take so long to figure it out.
 
Bill J. 


Posted By: orcities
Date Posted: 04-Jan-2008 at 11:55am
Thank you for your help. Just knowing your helping is nice. I will try that and see what happens.


Posted By: orcities
Date Posted: 04-Jan-2008 at 12:30pm
Error 43 The non-generic method 'IdeaBlade.Cab.UI.Services.ViewFactoryServiceBase.RegisterViewType(string, System.Type)' cannot be used with type arguments C:\Development\CEMS\Source\Foundation\Services\ViewFactoryService.cs 25 7 LOC.CEMS.Foundation


Posted By: orcities
Date Posted: 04-Jan-2008 at 12:32pm
Once again version differences cause a problem.


Posted By: orcities
Date Posted: 04-Jan-2008 at 12:41pm
It is strange I see it the correct RegisterViewType(string, type) but I it doesn't show in the compiled version.


Posted By: orcities
Date Posted: 04-Jan-2008 at 12:45pm
My fault again. I was still doing RegisterViewType<>(). Got it to work.
Tx


Posted By: orcities
Date Posted: 04-Jan-2008 at 2:05pm
Next problem. It is not using anything that I have set. Meaning it is not using the presenter. I have set a break point in the LOCGridViewPresenter.AddDetalGrid and is never hit.
 
Presenter:

public class LOCGridViewPresenter<TView> : DevExGridViewPresenter<TView> where TView : IBindingView

{

        protected override void AddDetailGrid(DetailGridViewContextBase DetailViewContext)

        {

            DetailGridViewBuilderBase detailGridBuilder = new LOCDetailGridViewBuilder(DetailViewContext, BindingManager);

            detailGridBuilder.Build();

        }

}

 
GreyGridView:

[InjectionMethod]

public void InjectPresenter([CreateNew]LOCGridViewPresenter<IBindingView> pPresenter) {

     SetPresenter(pPresenter);

}

 

PageController:

CreateChildGridContext();

pContext.ChildViewId = ChildViewId;
ViewFactory.AddNew(Constants.ViewNames.GreyGridView, WorkItem, ChildViewId, typeof(QuestionGroup));

 

private void CreateOrganizationGridContext()

{

            AssignmentBindingSource = new EntityBindingSource(typeof(Organization), EntityManager, mEmptyOrgList, String.Empty);

            GridViewContext context = GridViewContext.AddNew(WorkItem, Constants.WorkspaceNames.SearchResultsViewSmartPartPlaceholder, AssignmentBindingSource);

            IGridBuilderService gridBuilderService = this.WorkItem.Services.Get<IGridBuilderService>();

            context.GridBuilderPrototype = gridBuilderService.Get<Organization>();

 

            AddAssignmentDetailGrid(context);

}

 

private void AddAssignmentDetailGrid(GridViewContext pParentViewContext)

{

  // Create the view context for the detail view

  DetailGridViewContextBase mDetailViewContext = new LOCDetailGridViewContext(pParentViewContext, "Contact", typeof(OrganizationContact),

 EntityRelations.Organization_OrganizationContact.ChildRelationPropertyName);

}



Posted By: orcities
Date Posted: 04-Jan-2008 at 2:14pm
I had the Generic inheriting the wrong class. My bad.


Posted By: orcities
Date Posted: 04-Jan-2008 at 3:08pm
Ok, now that I have it running my grid builder and saving my detailgridviewcontext with the gridbindingmanager visible I need to figure out how to get to it and find the current item.
 
I am not sure how that would be done.  I can't do it in the PageController.Add...DetailGrid because it hasn't called CreateDetailGrid() to set the Context.DetailGridBindingManager.
 
Do you have a suggestion, theory, etc. on way to proceed?
 
 


Posted By: Bill Jensen
Date Posted: 04-Jan-2008 at 5:00pm
Actually, I've been waiting to see what you'd do with this once we got it working.
 
You must create the DetailGridViewContext and add it to the main GridViewContext in your PageController.  You'll need to keep a reference to it around in a member variable somewhere.
 
Then, whenever a detail grid view is open, its BindingManager will be available in the DetailGridViewContext.
 
I'm not sure how you plan to make use of this information.
 
Bill J.


Posted By: orcities
Date Posted: 07-Jan-2008 at 9:57am
This is proving to be very difficult. I can access the new DetailGridViewContext and the DetailGridBindingManager.
 
But, the problem is that the DetailGridBindingManager.CurrencyManager is alway empty.
 
I have set my DetailGridBindingManager in my DetailGridViewBuilder.CreateDetailGrid(). In the page controller I add the MyDetailGridViewContext to the GridViewContext. Then when the position for the GridViewContext.BindingSource.PositionChanged is fired I create an event that catches when the DetailGridViewContext position has changed.
 
This works but then the DetailGridBindingManager.CurrencyManager is empty.
 
Puzzling
 
 


Posted By: orcities
Date Posted: 08-Jan-2008 at 7:06am
I have made the DetailGridView visible from my Context. This allows me to create any event that I want. Using the grid events I can get the data row information.
 


Posted By: Bill Jensen
Date Posted: 08-Jan-2008 at 11:25am

Well, it pretty much blows view encapsulation and isolation out of the water, but I'm glad you're moving again.

I too am bewildered by the fact that your CurrencyManager was null, but I've gotten busy again and don't have time to look at it.  When things calm down, I'll try it on my test project.
 
Bill J.


Posted By: orcities
Date Posted: 08-Jan-2008 at 11:28am
I agree it is not the right way to do it. But, this problem put me almost a month behind. I will refactor later if I get more information.


Posted By: DeLight
Date Posted: 10-Jan-2008 at 1:53am
well.. sorry, have no time to write much. worked on detail grid problem long time ago. solved it with custom DevExGridViewAdapter and GridViewContext.
 
files:
http://www.ideablade.com/forum/uploads/20080110_050528_DetailGrid.rar - uploads/20080110_050528_DetailGrid.rar
 
hope you find the way to use the sources. any questions are welcome.
 
example:
private void AddBedGridView()
{
EntityBindingSource ebs = new EntityBindingSource(typeof(Room), EntityManager, ParentRootEntity, ClientGroup.Descriptors.RoomList.PropertyPath);

GridViewContext gvc = GridViewContext.AddNew(WorkItem, PlaceholderNames.SettleFreeBeds, ebs);

gvc.DefaultGridBuilderPrototypeName = GridBuilderNames.SettleRooms;

gvc.RowClickHandler = PlaceChosen;

gvc.AutoExpandAllMasterRows = true;

DetailGridViewContext dgvc = new DetailGridViewContext(gvc, "Beds", typeof(Bed), Room.Descriptors.FreeBeds);

dgvc.RowClickHandler = PlaceChosen;

dgvc.DefaultGridBuilderPrototypeName = GridBuilderNames.SmallSettleRoomsBedsDetail;

AddNewSubGridView<Room>(PlaceholderNames.SettleFreeBeds);

}

...

private void PlaceChosen(GridRowEventArgs e)

{

if (e.RowObject is Room)

{ ... }

else if (e.RowObject is Bed)

{ ... }

}

 


Posted By: orcities
Date Posted: 10-Jan-2008 at 1:17pm
Delight,
Great example.  It is going to take me some time to go through it but I will probably have questions.


Posted By: orcities
Date Posted: 10-Jan-2008 at 2:13pm
Where are you tying the GRidView.RowClick to the Context.RowClick Event?


Posted By: DeLight
Date Posted: 10-Jan-2008 at 4:02pm
some other files you need:
http://www.ideablade.com/forum/uploads/20080110_190444_DetailGrid2.rar - uploads/20080110_190444_DetailGrid2.rar
 
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;
}
 
 
 


Posted By: orcities
Date 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


Posted By: orcities
Date 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.



Posted By: DeLight
Date 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.


-------------


Posted By: orcities
Date Posted: 11-Jan-2008 at 11:30am

Where do you have DevExGridViewMenuItem ?



Posted By: DeLight
Date 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.

-------------


Posted By: orcities
Date Posted: 11-Jan-2008 at 12:15pm
It is actually not defined in any of those files. I have tried searching all the documents.


Posted By: DeLight
Date 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;
    }
}


-------------


Posted By: orcities
Date Posted: 11-Jan-2008 at 12:36pm
Missing that file in the rar. Tx


Posted By: orcities
Date 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

 


Posted By: orcities
Date Posted: 11-Jan-2008 at 12:54pm
Looks as if you made changes to the GridViewAdapter as well.


Posted By: DeLight
Date Posted: 11-Jan-2008 at 1:03pm
http://www.ideablade.com/forum/uploads/20080111_160433_GridViewAdapter.rar -
uploads/20080111_160433_GridViewAdapter.rar
 
yes. you are right.


-------------


Posted By: orcities
Date Posted: 11-Jan-2008 at 1:05pm
Could you post it?


Posted By: orcities
Date 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.
 
 


Posted By: IdeaBlade
Date 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 :)



Print Page | Close Window