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

GridRecordNavigation''s navigation buttons not working

I have GridDataBoundGrid that is bound to a typed-dataset. This GridDataBoundGrid is put inside GridRecordNavigation control. When the form is shown to the user with the grid and navigation, nothing happen when the user press any of the navigation buttons in the GridRecordNavigation control. Only after the user click on a row inside the grid, then these navigation buttons work as expected. We have tried all sorts of way to overcome this, but eventually find out that problem comes from the fact that the grid DataSource is set twice in the form. First, in the designer, so we can create the columns to the typed-dataset. Second, in the code after the dataset is populated. Unfortunately, this is how we have been designing our forms and grids and doing it any other way will be too much change. Is there any way to rebind the datasource of the grid and still keep the navigation buttons working? Thanks, Sam

4 Replies

AD Administrator Syncfusion Team August 2, 2004 02:47 PM UTC

After rebinding the datasource, try adding these lines to see if this will handle this problem. this.ActiveControl = this.gridDataBoundGrid1; //the this is the form... this.gridDataBoundGrid1.Focus();


SA Sam August 2, 2004 05:58 PM UTC

Clay, Thanks for the prompt reply, but we have tried that and it does not work. Basically, the problem started that in InitializeComponent() the designer generated code assigned the strongly-typed dataset as the grid datasource. And, somewhere along the constructor, we have code that load the data from database and set the datasource of the grid once more. If we took out that section of code in InitializeComponent(), everything works like a charm. Thanks, Suriyanto


SA Sam August 3, 2004 01:39 PM UTC

Clay, I am sorry, but probably my previous email looks like I found the solution. As the matter of fact, I have not. I found that if I took out the datasource assignment inside InitializeComponent, every works. The fact is we have so many forms and grids that if we take out the datasource from the designer, then we can''t see the gridcolumns anymore. Besides, whenever we need to modify the gridcolumn, we have re-assign the dataset and have to remember to take it off before saving the form. This is too error prone. Do you have a better approach to this problem? Thanks, Suriyanto


AD Administrator Syncfusion Team August 3, 2004 02:04 PM UTC

Here is something to try. Sometimes naviagtion does not work becuase the grid and an dteh gridrecordnavcontrol are not using teh same binding context. To see if this is the problem, try setting all the binidcontext to be the same as teh parent form with code like this at the bottom of your FormLoad. grid.BindingContext = this.BindingContext; gridrecnavctl.BindingContext = this.BindingContext; Can you reproduce the problem in our grid\samples\databound\recordnavigation sample so we can look at it here.

Loader.
Live Chat Icon For mobile
Up arrow icon