I have written a custom databound grid control that we've been using
successfully for months, but one of our developers has just run into a
problem that I can't figure out.
The code for setting it up is as follows:
DataSet dataSet = new DataSet( "TestSet" );
DataTable tableParent = dataSet.Tables. Add( "TableParen t" );
tableParent.Col umns.Add( "ID", typeof( Int32 ) );
tableParent.Col umns[ "ID" ].AutoIncrement = true;
tableParent.Col umns[ "ID" ].Unique = true;
tableParent.Col umns.Add( "Col1", typeof(Int32) );
tableParent.Col umns.Add( "Col2", typeof(Int32) );
DataTable tableChild = dataSet.Tables. Add( "TableChild " );
tableChild.Colu mns.Add( "ID", typeof( Int32 ) );
tableChild.Colu mns.Add( "Col1", typeof(Int32) );
tableChild.Colu mns.Add( "Col2", typeof(Int32) );
dataSet.Relatio ns.Add( "Child2Pare nt", tableParent.Col umns[ "ID" ],
tableChild.Colu mns[ "ID" ] ).Nested = true;
gridParent.Data Source = dataSet;
gridParent.Data Member = "TableParen t";
gridChild.DataS ource = dataSet;
gridChild.DataM ember = "TableParent.Ch ild2Parent";
The way it is supposed to work (and does work with the MS DataGrid) is that
when you select a row in the parent table, it should set the data in the
child table to all children of the selected parent.
In my grid, when the current cell changes, I set the position in the
CurrencyManager to the new position. My understanding (and apparently a
false one) was that the CurrencyManager would update the position in the
underlying dataset which in turn would then inform all CurrencyManager s
bound to it. Apparently that's not the case.
The parent grid receives the CurrencyManager .PositionChange d event but the
child grid receives no events from its CurrencyManager .
How am I supposed to propagate an update to the child grid?
Thanks.
Pete