I am putting into my heriarchial grids in-line editing but am running into a problem of how to get at the editing of the lower grids. i have the 1st grid working but how can I get at the sub grid to edit them inline. How can I have a unique update name, insert or delete fro each level of the grid. How can I differenitate between these 2 update commands for differetn grids. the 1st one is for the top level grid and the second one is for the 1st sub-level.
Protected Sub myRadGrid_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles myRadGrid.ItemCommand 'All the Inline Update Commands If (e.CommandName = RadGrid.UpdateCommandName) Then Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem) Dim Id As Integer = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("intCategoryId") Dim Cat As TextBox = CType(editedItem.FindControl("txtCategory"), TextBox) Dim NSN As TextBox = CType(editedItem.FindControl("txtNSN"), TextBox) Dim LIN As TextBox = CType(editedItem.FindControl("txtLin"), TextBox) sql = "Update Drat_Category set strCategory = '" & sanitizeString(Cat.Text.ToUpper) & "', strNSN = '" & sanitizeString(NSN.Text.ToUpper) & "', strLIN = '" & sanitizeString(LIN.Text.ToUpper) & "' " _ & "where intCategoryId = " & Id insertUpdateDelete(sql) myRadGrid.Rebind() End If If (e.CommandName = RadGrid.UpdateCommandName) Then Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem) Dim Id As Integer = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("intManufacturerId") Dim Man As TextBox = CType(editedItem.FindControl("txtManufacturer"), TextBox) sql = "Update Drat_Manufacturer set strmanufacturer = '" & sanitizeString(Man.Text.ToUpper) & "' where intManufacturerId = " & Id insertUpdateDelete(sql) myRadGrid.Rebind()<%@ Control language="vb" Inherits="DotNetNuke.Modules.CSAEditor.View" AutoEventWireup="false" Explicit="True" Codebehind="View.ascx.vb" %><%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %><telerik:RadGrid ID="rgcsaEditor" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowMultiRowEdit="True" AutoGenerateColumns="False" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" CellSpacing="0" DataSourceID="CSAlDataSource" GridLines="None" Skin="Telerik"><ClientSettings><Selecting CellSelectionMode="None"></Selecting> <Scrolling AllowScroll="True" UseStaticHeaders="True" /></ClientSettings><MasterTableView datakeynames="csaId" datasourceid="CSAlDataSource"><CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings><RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"><HeaderStyle Width="20px"></HeaderStyle></RowIndicatorColumn><ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"><HeaderStyle Width="20px"></HeaderStyle></ExpandCollapseColumn> <Columns> <telerik:GridBoundColumn DataField="csaId" DataType="System.Int32" Display="False" FilterControlAltText="Filter csaId column" HeaderText="csaId" ReadOnly="True" SortExpression="csaId" UniqueName="csaId"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="csaName" FilterControlAltText="Filter csaName column" HeaderText="csaName" SortExpression="csaName" UniqueName="csaName"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="csaWebAddr" FilterControlAltText="Filter csaWebAddr column" HeaderText="csaWebAddr" SortExpression="csaWebAddr" UniqueName="csaWebAddr"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="csaNotes" FilterControlAltText="Filter csaNotes column" HeaderText="csaNotes" SortExpression="csaNotes" UniqueName="csaNotes"> </telerik:GridBoundColumn> <telerik:GridCheckBoxColumn DataField="csaActive" DataType="System.Boolean" FilterControlAltText="Filter csaActive column" HeaderText="csaActive" SortExpression="csaActive" UniqueName="csaActive"> </telerik:GridCheckBoxColumn> <telerik:GridCheckBoxColumn DataField="csaBuyingClub" DataType="System.Boolean" FilterControlAltText="Filter csaBuyingClub column" HeaderText="csaBuyingClub" SortExpression="csaBuyingClub" UniqueName="csaBuyingClub"> </telerik:GridCheckBoxColumn> </Columns><EditFormSettings><EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn></EditFormSettings></MasterTableView><FilterMenu EnableImageSprites="False"></FilterMenu></telerik:RadGrid><asp:SqlDataSource ID="CSAlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:CsalwfConnectionString %>" DeleteCommand="usp_DeleteCSA_INFO" DeleteCommandType="StoredProcedure" InsertCommand="usp_InsertCSA_INFO" InsertCommandType="StoredProcedure" SelectCommand="usp_SelectCSA_INFOsAll" SelectCommandType="StoredProcedure" UpdateCommand="usp_UpdateCSA_INFO" UpdateCommandType="StoredProcedure"> <DeleteParameters> <asp:Parameter Name="csaId" Type="Int32" /> </DeleteParameters> <InsertParameters> <asp:Parameter Name="csaName" Type="String" /> <asp:Parameter Name="csaWebAddr" Type="String" /> <asp:Parameter Name="csaNotes" Type="String" /> <asp:Parameter Name="csaActive" Type="Boolean" /> <asp:Parameter Name="csaBuyingClub" Type="Boolean" /> <asp:Parameter Direction="InputOutput" Name="csaId" Type="Int32" /> </InsertParameters> <UpdateParameters> <asp:Parameter Name="csaId" Type="Int32" /> <asp:Parameter Name="csaName" Type="String" /> <asp:Parameter Name="csaWebAddr" Type="String" /> <asp:Parameter Name="csaNotes" Type="String" /> <asp:Parameter Name="csaActive" Type="Boolean" /> <asp:Parameter Name="csaBuyingClub" Type="Boolean" /> </UpdateParameters></asp:SqlDataSource>
<
MasterTableView DataKeyNames="Id" AutoGenerateColumns="false" CommandItemDisplay="Top">
<Columns>
<telerik:GridEditCommandColumn UniqueName="EditCommandColumn" HeaderText="Edit column" ButtonType="ImageButton"
EditImageUrl = "
~/Alarm.png"
>
<ItemStyle Width="50px" />
</telerik:GridEditCommandColumn>
......
GridEditCommandColumn edc = new GridEditCommandColumn();
edc.ButtonType =
GridButtonColumnType.ImageButton;
edc.EditImageUrl =
"~/Alarm.png";
Response.Write(edc.EditImageUrl);
$(window).load(function(){ Resize(); $(window).resize(function() { Resize(); });});function Resize() { var grid = $find("<%= mygrid.ClientID %>"); if (grid != null) { grid.get_element().style.height = $("#form1").height() + "px"; grid.repaint(); } }