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

how can I add a griddataboundgrid into gridrecordNavigationControl

how can I add a griddataboundgrid into gridrecordNavigationControl if I don''t addd it when designing

5 Replies

AD Administrator Syncfusion Team December 16, 2004 05:05 AM

You should be able ot do it in the designer. First drop the GridrecordNavigationControl onto your ofrm, and the drop the GridDataBoiundGrid onto teh GridrecordnavigationControl. I jsut tried this using 2.1.0.9. Created a new windows application. Dropped the recnav on the form and then the grid onto the recnav. Seemed to work for me. If it does not work for you, you might try resetting your toolbox and reloading the controls.


H h December 16, 2004 06:00 AM

Maybe you misunderstand my question. I''d like to make it clear. the first time, I added my GridDataBoundGrid into a GridRecordNavigationControl by design on userControl1, i can scroll the datagrid in this GridRecordNavigationControl. After that I used a reference of this grid by assigning myGrid = GridDataBoundGrid. I add myGrid to another one userControl2 , and change the model( width, hidecol, zoom the myGrid). When I return userControl1, I can''t scroll the grid in GridRecordNavigationControl . How can I scroll the griddataboundgrid in this GridRecordNavigationControl . Thank you


AD Administrator Syncfusion Team December 16, 2004 06:25 AM

The grid has to be parented to the recordnavcontrol. Here is the code that ties a grid to the recordnavcontrol. this.gridRecordNavigationControl1.Controls.Add(this.gridDataBoundGrid1); This means a grid can only be tied to one recnavcontrol as it can only be parented to a single control. So, when you added it same grid to the second recordnav control, it is no longer parented to teh first, and thus the first recnavcontrol will not be able to scroll it (unless you reparent it back to the first recnavcontrol).


H h December 16, 2004 09:42 AM

Thanks, but it still has problem. Please follow this step to get the error. 1. add Griddataboundgrid into Gridrecordnavigation. MessageBox.Show(grid.Parent); -->> result1 : ... 2. add this grid into another usercontrol2 and call MessageBox.Show(grid.Parent); -->>result 2:... 3. remove the grid out of the usercontrol and add it into Gridrecordnavigation again. -->>> result3 :.... the result3 is different from result 1 . It inform a message : " ............ vok:null" I think this is the main reason. But I don''t know how to resolve it. Thank you for you help.


AD Administrator Syncfusion Team December 16, 2004 06:10 PM

The recordnavcontrol has two public methods, WireGrid and UnwireGrid. The wire method is called to hook up the events that let the recnva control the grid. UnwireGrid unhooks these events. So, as you move the grid around between the two recnav controls, try unwiring the old recnavcontrol from teh grid before wiring the new one to th egrid to see if this will handle this problem. If not, if you send a sample project, we can try to get it working here.

Loader.
Live Chat Icon For mobile
Up arrow icon