I have created a WebHierarchicalDataGrid which has a parent band and a single child band, description of which is below. I'm unable to get my WebHierarchicalDataGrid to fire the RowUpdating event when a row is updated in the child band. Any help would be greatly appreciated! I am using version 2010.1
I've tried a couple of different methods that I have found from these forums, one being to add an event handler to the band during the form1_Init sub on the server-side (as shown below). Another method was to forward processing to a Javascript function by adding <CellEditingClientEvents ExitedEditMode="GridRowUpdate"/> -
function GridRowUpdate() { var grid = $find("WebHierarchicalDataGridTS"); grid.get_gridView().get_behaviors().get_editingCore().commit(); }
The method above returns a JS error on the commit() line (null) - I guess I need to fire a commit() from the child band instead, not sure how to do this?. The method below simply does not fire the events (at least they are not picked up by the server-side functions.
<ig:WebHierarchicalDataGrid ID="WebHierarchicalDataGrid1" runat="server" AutoGenerateColumns="False" DataKeyFields="ID" Height="400px" Key="MyFirstTable" Width="850px" AutoGenerateBands="False" EnableViewState="False" EnableDataViewState="True" > <GroupingSettings> <RemoveButton AltText="Ungroup Column" /> </GroupingSettings> <Columns> <ig:BoundDataField DataFieldName="ID" Key="ID" VisibleIndex="0" Hidden="True"> <Header Text="ID" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Name" DataType="System.String" Key="Name" VisibleIndex="1"> <Header Text="Name" /> </ig:BoundDataField> </Columns> <CollapseButton AltText="Collapse Row" /> <ExpandButton AltText="Expand Row" /> <Bands> <ig:Band AutoGenerateColumns="False" Key="Days" DataMember="MySecondTable"> <ExpandButton AltText="Expand Row" /> <CollapseButton AltText="Collapse Row" /> <GroupingSettings> <RemoveButton AltText="Ungroup Column" /> </GroupingSettings> <Columns> <ig:BoundDataField DataFieldName="Id" Key="Id" VisibleIndex="0" Hidden="True"> <Header Text="Id" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Day" Key="Day" Width="60px"> <Header Text="Day" /> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Worked" Key="Worked"> <Header Text="Worked" /> </ig:BoundDataField> </Columns> <Behaviors> <ig:EditingCore EnableInheritance="true" AutoCRUD="false"> <Behaviors> <ig:CellEditing> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="Id" ReadOnly="True" /> <ig:EditingColumnSetting ColumnKey="Day" ReadOnly="True" /> </ColumnSettings> <%--<CellEditingClientEvents ExitedEditMode="GridRowUpdate"/>--%> <EditModeActions MouseClick="Single" /> </ig:CellEditing> </Behaviors> </ig:EditingCore> </Behaviors> </ig:Band> </Bands></ig:WebHierarchicalDataGrid>
Server side:
Private Sub form1_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles form1.Init AddHandler WebHierarchicalDataGridTS.Bands(0).RowUpdating, AddressOf WebHierarchicalDataGridTS_RowUpdating AddHandler WebHierarchicalDataGridTS.Bands(0).RowUpdated, AddressOf WebHierarchicalDataGridTS_RowUpdated End Sub
Private Sub WebHierarchicalDataGridTS_RowUpdated(ByVal sender As Object, ByVal e As Infragistics.Web.UI.GridControls.RowUpdatedEventArgs) Handles WebHierarchicalDataGridTS.RowUpdated 'Do Stuff End Sub Protected Sub WebHierarchicalDataGridTS_RowUpdating(ByVal sender As Object, ByVal e As Infragistics.Web.UI.GridControls.RowUpdatingEventArgs) Handles WebHierarchicalDataGridTS.RowUpdating 'Do Stuff End Sub
Has anyone got an idea why my RowUpdating event is not firing? I'm happy to provide any more information if it is useful?
Hi
Just make rowupdating event on band as OnRowUpdating="grdFinancialImpactImport_RowUpdating"
protected void grdFinancialImpactImport_RowUpdating(object sender, Infragistics.Web.UI.GridControls.RowUpdatingEventArgs e)
{ContainerGrid containerGrid = (ContainerGrid)sender; if (containerGrid.Level == 0) { if((e.Values["JobCostCodeId"] != null)
{
} } if (containerGrid.Level == 1) {
}