Hi Team,
I am using the Telerik Radgrid to populate the data from Database in 2 level Hierarchical (Master and Details) as below. I want to reorder the rows similar to Column on client side without Postback to the server.
Also I want to save the Grid data changes at once to the Database on a ASP.Net Button Click.
Could you please help me.
Thanks,
Sujana.
<telerik:RadGrid ID="RadDetails" runat="server" AutoGenerateColumns="False" AutoGenerateHierarchy="True" GroupPanelPosition="Top"
OnDetailTableDataBind="RadDetails_DetailTableDataBind" Style="overflow: hidden" Height="600px" OnBatchEditCommand="RadDetails_BatchEditCommand"
OnItemCreated="RadDetails_ItemCreated">
<ClientSettings AllowColumnsReorder="true" AllowExpandCollapse="true" AllowRowsDragDrop="true" ReorderColumnsOnClient="true" ColumnsReorderMethod="Reorder">
<Selecting AllowRowSelect="true" EnableDragToSelectRows="true" />
<Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" />
<Resizing AllowColumnResize="true" EnableRealTimeResize="true" AllowResizeToFit="true" ResizeGridOnColumnResize="true" />
<ClientEvents OnRowClick="RowClicked" OnRowDropping="onRowDropping" OnRowDropped="OnRowDropped" />
</ClientSettings>
<MasterTableView HierarchyLoadMode="Client" HierarchyDefaultExpanded="true" ClientDataKeyNames="DisplayOrder" DataKeyNames="DisplayOrder" EditMode="Batch" TableLayout="Fixed">
<HeaderStyle Font-Bold="true" Wrap="false" />
<ItemStyle Wrap="false" Width="200px" />
<BatchEditingSettings EditType="Cell" SaveAllHierarchyLevels="true" OpenEditingEvent="DblClick" />
<Columns>
<telerik:GridBoundColumn ItemStyle-Font-Bold="true" HeaderText="" DataField="OrderFormSubCategory"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Category Notes" DataField="CategoryNotes"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="DisplayOrder" DataField="DisplayOrder" Visible="false"></telerik:GridBoundColumn>
</Columns>
<DetailTables>
<telerik:GridTableView DataKeyNames="OrderFormSubCategory" runat="server" Name="Details" AutoGenerateColumns="false" EditMode="Batch" HierarchyLoadMode="Client">
<HeaderStyle Font-Bold="true" Wrap="false" Width="100px" HorizontalAlign="Center" VerticalAlign="Middle" />
<ItemStyle Wrap="false" HorizontalAlign="Left" VerticalAlign="Middle" />
<AlternatingItemStyle Wrap="false" HorizontalAlign="Left" VerticalAlign="Middle" />
<BatchEditingSettings EditType="Cell" OpenEditingEvent="DblClick" />
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="OrderFormSubCategory" MasterKeyField="DisplayOrder" />
</ParentTableRelation>
<Columns>
<telerik:GridBoundColumn HeaderText="Order Form Sub Category" DataField="OrderFormSubCategory" Visible="false"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="ISBN" DataField="ISBN" HeaderStyle-Width="100px" ReadOnly="true">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="ISBN13" DataField="ISBN13" ReadOnly="true"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Shot Title" DataField="TitleDesc" ReadOnly="true" Resizable="true"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Author" DataField="Author" ReadOnly="true"></telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Indent" UniqueName="Indent" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:CheckBox ID="chkIndent" runat="server" Checked='<%# Eval("IsIndent") %>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn HeaderText="Format" DataField="Format" ReadOnly="true"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="RRP" DataField="RRP" ReadOnly="true" DataType="System.Decimal" DataFormatString="{0:F2}"></telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Featured Title" UniqueName="FeaturedTitle">
<ItemTemplate>
<asp:CheckBox ID="chkFeaturedttl" runat="server" Checked='<%# Eval("IsShaded") %>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn HeaderText="Notes" HeaderStyle-Width="200px" DataField="Notes"></telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Page After" UniqueName="PageAfter">
<ItemTemplate>
<asp:CheckBox ID="chkPageAfter" runat="server" Checked='<%# Eval("NewPageAfter") %>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="LocalAuthor" UniqueName="LocalAuthor">
<ItemTemplate>
<asp:CheckBox ID="chkLocalAuthor" runat="server" Checked='<%# Eval("IsAustAuthor") %>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn HeaderText="Order" DataField="DisplayOrder" ReadOnly="true"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Boxed" DataField="Boxed"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="BIC" DataField="BIC" ReadOnly="true"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Series" DataField="Series" ReadOnly="true"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Page Extent" DataField="PageExtent" ReadOnly="true"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Long Title" DataField="LongTitle" ReadOnly="true"></telerik:GridBoundColumn>
</Columns>
</telerik:GridTableView>
</DetailTables>
</MasterTableView>
</telerik:RadGrid>