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

Bind a windows textbox to gridDataBoundGrid

Thread ID:





10090 Jan 22,2004 07:23 AM UTC Jan 22,2004 09:29 AM UTC WinForms 1
Tags: GridControl
Oliver Moss
Asked On January 22, 2004 07:23 AM UTC

Hello, I have a simple problem, but no idea how I can solve it... I have a Form with a DataSet, some textfields and combo boxes and a GridDataBoundGrid placed in a GridRecordNavigationControl. All components are bound to the DataSet. My problem is, if I select a row in the grid, I expect that the data in the textboxes will change too. Or, if I type in new data into a textbox, the grid will updated automaticly. Any idea how I can get this behavior without programming to much (I have a lot of Form to design...)? You could see a picture of my form in the zip file. Thank you, Oliver Moss grid_5733.zip

Administrator [Syncfusion]
Replied On January 22, 2004 09:29 AM UTC

Here is a little sample. The only code written in the sample is: 1) Fill the DataSet. 2) Make sure the BindingContext property for each of the bound controls are the same. If you have a multiple panels and groupboxes, this might take a few lines unless you come up with a scheme to do this is some kind of loop. The problem is that the default behavior of most controls is to inherit the bindingcontext from its parent. This means the grid''s binding context will come from the gridrecordnavigationcontrol, and if your textboxes are in a particular groupbox or panel, they will have some other bindingcontext. If this is the case, you do not see the textboxes change as you move in the grid. In the sample, the textboxes are all on the form. So the sample just sets the grid''s bindingcontext to that of the form''s. This makes all the controls use the form''s bindingcontext, and things stay in sync as you move. 3) Handle ColumnChanged on the the DataTable to redraw the grid cell so it will show the new data when the user leaves a textbox. 4) Handle CurrentAcceptedChange on the grid to force the grid to save the change even if you do not move off the grid row. The default behavior is to cache all the changes on a row, and only save them when the user leaves the row.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon