Hi,
I have webdatatree that control selection on a webdatagrid. after implementing a new behavior i got error as below when webdatatree selection change.
I notive that the webdatagrid cell selection does not deselect even after I save the grid like it used to. how can I fix this behavior or force clear cell selection at client side.
Thanks
Zaid
<ig:WebDataTree ID="WebDataTree1" runat="server" DataSourceID="Hierarchy1" Height="602px" Width="247px" SelectionType="Single" InitialDataBindDepth="6" InitialExpandDepth="0" onselectionchanged="WebDataTree1_OnSelectionChanged" ClientEvents-SelectionChanging="active" style="margin-right: 0px"> <AutoPostBackFlags SelectionChanged="On" /> </ig:WebDataTree>
<asp:UpdatePanel ID="pnl_save" runat="server"> <ContentTemplate> <ig:WebDataGrid ID="WebDataGrid1" runat="server" DataSourceID="mainDS1" Height="600px" Width="1018px" AutoGenerateColumns="False" HeaderCaptionCssClass="style3" ClientEvents-KeyUp ="KeyUp" DataKeyFields="ARCHIVE_ID,RESERVOIR_ID,PRODUCT_ID" onrowupdated="WebDataGrid1_RowUpdated" onrowupdating="WebDataGrid1_RowUpdating " >
<Behaviors> <ig:Clipboard CopyColumnHeader="false" CopyFormatted="false" Enabled="true" IgnoreHidden="true" EnableCopy="true" ClipboardClientEvents-Copied="Copied" /> <ig:RowSelectors Enabled="false" /> <ig:Selection CellSelectType="Multiple" CellClickAction="Row" ColumnSelectType="Multiple" RowSelectType="Multiple" /> <ig:Activation Enabled="true" /> <ig:EditingCore AutoCRUD="true" > <Behaviors> <ig:CellEditing > <EditModeActions EnableOnActive="False" MouseClick="Double" /> <CellEditingClientEvents ExitedEditMode="WebDataGrid1_ExitingEditMode" /> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="reservoir_name" ReadOnly="true" /> <ig:EditingColumnSetting ColumnKey="RiskProLOW" ReadOnly="true" /> <ig:EditingColumnSetting ColumnKey="RiskProBEST" ReadOnly="true" /> <ig:EditingColumnSetting ColumnKey="RiskProHIGH" ReadOnly="true" /> </ColumnSettings> </ig:CellEditing> </Behaviors> </ig:EditingCore> </Behaviors> </ig:WebDataGrid> <asp:Button ID="btn_save" runat="server" Text="Save" /> </ContentTemplate> </asp:UpdatePanel>
Hello Zaid,
You can clear the selection client-side using the following code:
var grid = $find("WebDataGrid1");
grid.get_behaviors().get_selection().get_selectedRows().clear();
grid.get_behaviors().get_selection().get_selectedColumns().clear();
grid.get_behaviors().get_selection().get_selectedCells().clear();
Hope this helps.
Thanks Nikolay,
it works like a charm.
Can you please guide me on best approach to work with infragistics documentation.
what I do normally do look at the sample
http://ko.infragistics.com/products/aspnet/hierarchical-data-grid/ and work from there,
when i'm stuck I post here :)