We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridControlBaseImp - GridRecordNavigationControl

Hi I want to use the GridRecordNavigationControl as the control for location in Form''s Designer and then by code to connect it with a custom Grid derived from GridControlBaseImp. RecNav has parent the Form or Tab Grid has parent the RecNav. Is it posible without problems even with Designer licenses ? I have done with GridControl but I tried with GridControlBase ( not Imp) and I received strange errors from designer. Should I derive the RecNavigation to implement the IDisposable so to clean grid resources ? if I derived the custom grid from ControlBaseImp and using the RecNav, can I link to Syncfusion.Grid.Base assembly ? Thanks

8 Replies

AD Administrator Syncfusion Team September 7, 2004 06:42 AM UTC

GridRecordNavigationControl requires its child control to implement ICreateNewWindow. It is through this interface that the recnav control can create duplicate child controls as needed. GridControlBase implements ICreateNewWindow, but GridControlBaseImp does not. I suspect this is the basic problem here though there may be others. You could try having your GridControlBaseImp derived grid implement ICreateNewWindow to see if that would allow things to work.


AD Administrator Syncfusion Team September 7, 2004 08:48 AM UTC

I was wrong here. GridControlBaseImp derives from GridControlBase, so it does have an ICreateNewControl implementation. But to use a derived control as the child in a RecordNav control, I think you will have to override CreateNewControl (part of ICreateNewControl), and create an instance of your derived grid in order to get things to work. Here is a forum thread on using a derived grid in a Splitter which is similar to a recordnav control in how it dynamically creates the grids. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=10215


ST Stefan T September 7, 2004 10:04 AM UTC

Thanks Clay I will try it and I will send you feedback.


ST Stefan T September 9, 2004 09:30 PM UTC

Yes, It works. GridRecordNavigation + GridControlBaseImp derived class. Another one question. I want to hold in Style.Tag a custom object like DataColumn. So in Model.ColStyles[..].Tag= cust ; At QueryCellInfo I tried to get the the object but e.Style.Tag=null; I suppose it creates a new GridStyleInfo. Then I tried to read again the Model.ColStyles[..].Tag but this causes a recursive call through GetCellInfo. What can I do ? I can hold the objects in an ArrayList but if the columns move I should relocate the ArrayList also. In your DataBoundGrid there is not such problem as the GridBoundColumn holds the tag. Thanks Stefan


AD Administrator Syncfusion Team September 9, 2004 10:09 PM UTC

In your QueryCellInfo, are you making sure your code is not executed when e.RowIndex = -1? If not, this could cause recursive calls if you try to access the ColStyle. I do not see the problem with style.Tag being empty in QueryCellInfo if I set it in a ColStyle. Here is a modified copy of the VirtualGrid sample we ship that shows the e.Style.Tag object is not empty if I set it in the ColStyle. What are you doing differently? CS_8122.zip


ST Stefan T September 9, 2004 10:32 PM UTC

First I use a gridControlBaseImp not a GridControl which has a GridData . But I am not sure if it has relation. I will try your sample Regards


ST Stefan T September 10, 2004 12:37 AM UTC

I can''t solve the problem with the Tag. I isolated everything else and the only difference is that I use a class which implement the IGridModelDataProvider interface. I send your sample with the addition of this class. You can see the exception. Regards CS_4048.zip


AD Administrator Syncfusion Team September 10, 2004 06:08 AM UTC

When you use IGridModelDataProvider, this means you are going to provide the entire data dynamically though your IGridModelDataProvider object. Setting grid.Model.ColStyles will not have any effect as they are not used by IGridModelDataProvider as they are normally stored in the GridControl.Model.Data object which is bypassed when you add an IGridModelDataProvider. So, I think you will need to store these tags somewhere (Hasttaable, ArrayList, or ???), and then rearrange them if necessary when columns move. You can listen to grid.model.ColsMoving or COlsMoved to manage rearraging your tags in their datastore if needed.

Loader.
Live Chat Icon For mobile
Up arrow icon