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 ?
ADAdministrator Syncfusion Team September 7, 2004 01:42 AM
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.
ADAdministrator Syncfusion Team September 7, 2004 03:48 AM
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.
STStefan TSeptember 7, 2004 05:04 AM
I will try it and I will send you feedback.
STStefan TSeptember 9, 2004 04:30 PM
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.
ADAdministrator Syncfusion Team September 9, 2004 05:09 PM
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?
STStefan TSeptember 9, 2004 05:32 PM
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
STStefan TSeptember 9, 2004 07:37 PM
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.
ADAdministrator Syncfusion Team September 10, 2004 01:08 AM
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.