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.
Unfortunately, activation email could not send to your email. Please try again.

GridRecordNavigation''s navigation buttons not working

Thread ID:

Created:

Updated:

Platform:

Replies:

17145 Aug 2,2004 10:33 AM Aug 3,2004 10:04 AM Windows Forms 4
loading
Tags: GridControl
Sam
Asked On August 2, 2004 10:33 AM

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

Administrator [Syncfusion]
Replied On August 2, 2004 10:47 AM

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();

Sam
Replied On August 2, 2004 01:58 PM

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

Sam
Replied On August 3, 2004 09:39 AM

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

Administrator [Syncfusion]
Replied On August 3, 2004 10:04 AM

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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;