What is the best way to update the child row? I'm able to update the parent but I'm not sure the best way to update the child. I have the sqldatasources working but when a value in the child of the grid is updated it doesn't update the data.
There aren't any exposed events for the child band, nor is there anything in the csom that lets you rebind the grid and the commit() method (referenced on other posts) doesn't work.
So, I'm not sure. How am I supposed to actually update the data on the child band?
thanks for any help you can provide.
Hello,
There is no different action for row-adding on the child band level.
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
WebHierarchicalDataGrid1.Bands["SqlDataSource2_DefaultView"].RowUpdating += new RowUpdatingHandler(WHDGEdit_RowUpdating);
WebHierarchicalDataGrid1.Bands["SqlDataSource2_DefaultView"].RowAdding += new RowAddingHandler(WHDGEdit_RowAdding);
}
protected void WHDGEdit_RowAdding(object sender, RowAddingEventArgs e)
//TO DO
public void WHDGEdit_RowUpdating(object sender, RowUpdatingEventArgs e)
P.S: I appologize I have added the event to the GridView instead to the band in the previos post
Is there some different action required for row-adding on the child band level? The problem might be unique as my parent doesn't allow adding...but my child does. I have 'enable inheritence=false' on the parent and child, row adding is enabled, and the following is my code-behind.
-----------------------------------------
Private Sub WebForm1_Init(sender As Object, e As System.EventArgs) Handles Me.Init AddHandler gridlog.Bands(0).RowAdded, AddressOf gridlog_RowAdded End Sub
Private Sub gridlog_RowAdded(sender As Object, e As Infragistics.Web.UI.GridControls.RowAddedEventArgs) End Sub
-------------------------------------------------------------
AH. That was it. Thank you guys for your assistance. The child band is now updating as expected. Below is my code-behind for those who are struggling with this. 'Gridlog' is the name of my grid:
----------------------------- Private Sub WebForm1_Init(sender As Object, e As System.EventArgs) Handles Me.Init AddHandler gridlog.Bands(0).RowUpdated, AddressOf gridlog_RowUpdated End Sub
Private Sub gridlog_RowUpdated(sender As Object, e As Infragistics.Web.UI.GridControls.RowUpdatedEventArgs) Handles gridlog.RowUpdated End Sub
------------------------------Of course, the major complaint is that if I have autocrud on and turn on editing at the band level this should be an automatically added handler. The enabeling of the child editing should behave the same as the enabeling of the parent editing.
Thank you again for your time and assistance.
Matt
As I said originally, you need to add the event to the BAND, not the GridView. The Band will allow the event to be propogated to the row islands of that band. So for example.
WHDG1.Bands[0].RowUpdating would be the event.
-Dave
Just to be sure, I did add an updating server event on page_init for the grid. I added two to be sure:
AddHandler gridlog.GridView.RowUpdated, AddressOf gridlog_RowUpdated AddHandler gridlog.GridView.RowUpdating, AddressOf gridlog_RowUpdating
Parent updating and updated events fired fine. Child updating and updated events didn't fire at all.