Master-Detail

Hi, I want to design a form with two tables. I already bond them as a master and a detail. But the data in master table will be displayed in several TextBox, and the details data shown in GridDataBoundGrid. My problem is when I move to next datarow of master by setting this.BindingContext[dsDataSet,"Table1"].Position add 1, how I let the grid follows the master change to show the new row''s children. thanks! sizhen

4 Replies

AD Administrator Syncfusion Team April 12, 2006 02:57 PM UTC

Hi Sizhen, Attached is a sample that displays the master table in text boxes and the detail table in a gridDataBoundGrid and as the data row is navigated the grid shows the respected child rows by handling the BindingManagerBase.CurrentChanged event. Let us know if this helps. Regards, Calvin.

43005.zip


SI sizhen April 17, 2006 07:30 AM UTC

Dear Sir, I couldn''t download it (''43005.zip''). It shows"invalid or corrupted. Would you please attach it again. Thanks! sizhen >Hi Sizhen, > >Attached is a sample that displays the master table in text boxes and the detail table in a gridDataBoundGrid and as the data row is navigated the grid shows the respected child rows by handling the BindingManagerBase.CurrentChanged event. Let us know if this helps. > >Regards, >Calvin.

43005.zip


SI sizhen April 17, 2006 09:31 AM UTC

Hi Calvin, I already got 43005.zip. Thanks! In my coding,I already designed a gridDataBoundGrid (gdbgMASTER) to bind master table. But it is not visible. When the textbox.text is changed (new position of BindingContext), I also move current cell of gdbgMASTER to the new position. But it is not a good method. I guess when gdbgMASTER''s currentCell is changed, some event is called to show current children data. Do you have any remmendation (to register some event or others) to replace gdbgMASTER? Thanks! sizhen >Dear Sir, >I couldn''t download it (''43005.zip''). It shows"invalid or corrupted. Would you please attach it again. Thanks! > >sizhen > >>Hi Sizhen, >> >>Attached is a sample that displays the master table in text boxes and the detail table in a gridDataBoundGrid and as the data row is navigated the grid shows the respected child rows by handling the BindingManagerBase.CurrentChanged event. Let us know if this helps. >> >>Regards, >>Calvin.

43005.zip


AD Administrator Syncfusion Team April 17, 2006 03:53 PM UTC

Hi Sizhen, In the posted sample the parent table fields were bound to the textbox directly without having any hidden Grid and the detail (child) table to the gridDataBoundGrid. And as you navigate in the master table using the BindingManagerBase (++manager.Position)the grid shows the respected child rows by handling the BindingManagerBase.CurrentChanged event. It does nott have any hidden grid. Let us know if you are looking for some thing different. Regards, Calvin.

Loader.
Up arrow icon