I have started playing with this under eval and so far so good, I created three test tables TOP ( With TOPID ) ,middle ( with MIDDLEID and TOPID ) and finally Bottom ( With BottomID and MiddleID ) as Primary and Fireign Keys respectively.
I can see the data and expand collapse etc. I can add rows to the TOP OK ( All PK IDs are Identity Columns )
My issues is when I want to add a row the middle or bottom children, it does not autimatically add the parent PK into the FK column, so in order to create the row I have to do this manually by entering it in.
Im sure I have missed something basic, please could someone ellighten me on how to do this.
Many Thanks,
Tired of wating for a response, I found a solution myself.
protected void WebHierarchicalDataGrid1_RowAdding(object sender, Infragistics.Web.UI.GridControls.RowAddingEventArgs e)
{
var container = (Infragistics.Web.UI.GridControls.ContainerGrid)sender;
switch( container.Level )
case 1: e.Values["TopID"] = container.ParentRow.DataKey[0];
break;
case 2:
e.Values[
"MiddleID"] = container.ParentRow.DataKey[0];
}
This is a great example and it ALMOST works entirely for my needs. The problem I have is that i allow multiple new records to be added before the user clicks 'Save'. It seems like the RowAdding event only fires once. Consequently, only the first new row gets the foreign keys. Subsequent newly added rows do not.
Is there a way to access on the server side, a collection of newly added rows?