Hi all,
I have this issue: I have a main hierarchical datagrid (WHDG) with one child band. In child band I want to be able to edit a few columns. On each cell change I want to call Save method from my ObjectDataSource.
If anybody knows how to do this, please let me know.
Here is a fragment from my code:
this is my child band and objectdatasource for it:
<Bands> <ig:Band Key="ChildBand1" DataMember="OrderDetailsView" ShowHeader="false"> <GroupingSettings EnableColumnGrouping="True"/> <Behaviors> <ig:EditingCore> <Behaviors> <ig:CellEditing Enabled="true" > <EditModeActions EnableF2="true" EnableOnActive="true" MouseClick="Single" /> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="Id" ReadOnly="true" /> <ig:EditingColumnSetting ColumnKey="System" ReadOnly="true" /> <ig:EditingColumnSetting ColumnKey="DataLoad" ReadOnly="true" /> <ig:EditingColumnSetting ColumnKey="AsOfDate" ReadOnly="true" /> <ig:EditingColumnSetting ColumnKey="AsOfDate2" ReadOnly="true" /> <ig:EditingColumnSetting ColumnKey="AvailableToBusiness" ReadOnly="true" /> <ig:EditingColumnSetting ColumnKey="AvailableToBusiness2" ReadOnly="true" /> <ig:EditingColumnSetting ColumnKey="Comments" ReadOnly="false" /> <ig:EditingColumnSetting ColumnKey="Comments2" ReadOnly="false"/> </ColumnSettings> </ig:CellEditing> </Behaviors> <EditingClientEvents CellValueChanged="WebHierarchicalDataGrid1_Editing_CellValueChanging" RowUpdating="WebHierarchicalDataGrid1_Editing_RowUpdating" /> </ig:EditingCore> </Behaviors> </ig:Band> </Bands>
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" TypeName="DashBoard.DashSummaryClient" SelectMethod="GetSummaryList" UpdateMethod="Save"> <SelectParameters> <asp:Parameter Name="DashID" Type="String" /> </SelectParameters> <UpdateParameters> <asp:Parameter Name="DashId" Type="Int32" /> <asp:Parameter Name="Comments" Type="String" /> </UpdateParameters></asp:ObjectDataSource>
Thanks.
Hi,
Just to add to David's answer, remember to handle the server side rowupdating event too. You don't need anything in there, but the commit won't work unless that event is being handled.
Ed
Thank you guys. It helped me.