Print Page | Close Window

Custom Control and Grid Binding Manager

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2009
Forum Discription: For .NET 3.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1783
Printed Date: 28-Mar-2024 at 5:10am


Topic: Custom Control and Grid Binding Manager
Posted By: swylie
Subject: Custom Control and Grid Binding Manager
Date Posted: 04-May-2010 at 5:29pm
I have a grid that is we have setup to use the XtraGridBindingManager.  One of the columns is to display dates.  We have created a custom DevExpress DateEdit control that we use throughout the rest of the application and I tried to use it with this grid.
 
Here is the code that I have changed for the setting the grids column binding descriptors. If you notice the control type it is our custom control.
 
this.historyGBM.Descriptors.Add(new IdeaBlade.UI.WinForms.DevExpressControls.XtraGridBindingDescriptor("Start Date", typeof(DomainModel.CheckPrintSource), "BeginDate", typeof(BPS.SC.Framework.Controls.DateEdit)));
 
When I run the application, this column always uses the base control type and not our custom control type.  I even have the particular column ColumnEdit property set to a instance of the custom control.  If I comment out the line above then I see it.
 
I then decided to change the column descriptor type to my custom repositoryitem that DevExpress uses internally for grid editors.  When I ran the code I got this error.
 
{"No suitable XtraGridColumnBinder could be found for a SCRepositoryItemDateEdit. Are you missing an assembly reference?"}
 
I looked at the code through Reflector to find this error and noticed that there is a UIMapper that seems to be what takes care how you decide what to bind to (well I think that is how it works) but I could not get it work or find any documentation on it.
 
So my question is how do I get the XtraGridBindingManager use my custom DateEdit control and not what it is internnally mapped to.



Replies:
Posted By: WardBell
Date Posted: 05-May-2010 at 2:02pm
Looking into it.


Posted By: ting
Date Posted: 05-May-2010 at 7:38pm

Hi Scott - I'll follow up with you in email.




Print Page | Close Window