Protected Overridable Sub SaveColumnSettings() Settings.ColumnSettings.Clear() Dim i = 0 For Each column As GridColumn In Grid.MasterTableView.Columns Debug.Print("column no " + i.ToString() + " with OrderIndex " + column.OrderIndex.ToString()) i += 1 Settings.ColumnSettings.Add(GetColumnSettings(column)) Next.....column no 0 with OrderIndex 2column no 1 with OrderIndex 3column no 2 with OrderIndex 4column no 3 with OrderIndex 5column no 4 with OrderIndex 6column no 5 with OrderIndex 7.....<ClientSettings EnableRowHoverStyle="true" AllowColumnsReorder="true" ReorderColumnsOnClient="true" AllowDragToGroup="false" ColumnsReorderMethod="Reorder" AllowColumnHide="true" Selecting-AllowRowSelect="false"><MasterTableView AllowMultiColumnSorting="false" AllowNaturalSort="true" AllowCustomSorting="true" AllowCustomPaging="true" .... >.....
rlv.DataSource = rlv.Page.Session[rlv.UniqueID + "_MyItems"]List<MyItem>;rlv.InsertItemTemplate = new CustomTemplate();rlv.ShowInsertItem(RadListViewInsertItemPosition.LastItem);rlv.PerformInsert(); // calls without error, but no event fired.rlv.InsertItemPosition = RadListViewInsertItemPosition.None;<telerik:RadGrid ID="grdLibraryGlobalRates" runat="server" DataSourceID="dsLibraryGlobalRateManager"
AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True">
<MasterTableView CommandItemDisplay="Top" DataSourceID="dsLibraryGlobalRateManager"
DataKeyNames="_LibraryGlobalRateScheduleID">
<DetailTables>
<telerik:GridTableView Name="grdGlobalRateScheduleEvent"
DataKeyNames="_LibraryGlobalRateScheduleEventID"
DataSourceID="dsLibraryGlobalRateManagerEvent" Width="100%"
runat="server" AutoGenerateColumns="False" CommandItemDisplay="Top">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="_LibraryGlobalRateScheduleID"
MasterKeyField="_LibraryGlobalRateScheduleID"></telerik:GridRelationFields>
</ParentTableRelation>
.............. Columns here
<EditFormSettings EditFormType="WebUserControl"
UserControlName="UserControls_EditUpdate/LibraryGlobalRateEvents.ascx">
<EditColumn FilterControlAltText="Filter EditCommandColumn1 column"
UniqueName="EditCommandColumn1">
</EditColumn>
</EditFormSettings>
</telerik:GridTableView>
</DetailTables>
............Columns here
<EditFormSettings EditFormType="WebUserControl" UserControlName="UserControls_EditUpdate/LibraryGlobalRates.ascx">
<EditColumn FilterControlAltText="Filter EditCommandColumn1 column" UniqueName="EditCommandColumn1">
</EditColumn>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
Protected Sub grdLibraryGlobalRates_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles grdLibraryGlobalRates.ItemCommand
If e.CommandName = "LibraryGlobalRateEventUpdate" Then
Try
Dim MyUserControl As UserControl = CType(e.Item.FindControl(Telerik.Web.UI.GridEditFormItem.EditFormUserControlID), UserControl)
End If
If e.CommandName = "LibraryGlobalRateEventInsert" Then
Try
Dim MyUserControl As UserControl = CType(e.Item.FindControl(Telerik.Web.UI.GridEditFormItem.EditFormUserControlID), UserControl)
End If
End Sub
On the LibraryGlobalRateEventInsert command, e.item evaluates to
{Telerik.Web.UI.GridEditFormInsertItem} and MyUserControl gets set to the usercontrol I am using for the EditFormSettings
On the LibraryGlobalRateEventUpdate command, e.item evaluates to
{Telerik.Web.UI.GridDataItem} and MyUserControl gets set to Nothing
At this point I am unable to update values when edit is selected.
Please help me resolve this or point me to a post that will explain the update process for details tables as it pertains to UserControls for editing.
Thanks,
Marty
<div style="width:200px;"> <p>This div has a width of 200px only:</p> <dl> <dt> <telerik:RadButton runat="server" ID="MyButton1" ButtonType="ToggleButton" ToggleType="CheckBox" AutoPostBack="false" Text="This text should be long enough to create a second line and maybe a third line because the next checkbox will overlaps with this one and maybe more." /> </dt> <dt> <telerik:RadButton runat="server" ID="RadButton1" ButtonType="ToggleButton" ToggleType="CheckBox" AutoPostBack="false" Text="Might be one line." /> </dt> <dt> <telerik:RadButton runat="server" ID="RadButton2" ButtonType="ToggleButton" ToggleType="CheckBox" AutoPostBack="false" Text="A word." /> </dt> <dt> <telerik:RadButton runat="server" ID="RadButton3" ButtonType="ToggleButton" ToggleType="CheckBox" AutoPostBack="false" Text="This text should be long enough to create a second line and maybe a third line because the next checkbox will overlaps with this one and maybe more." /> </dt> <dt> <telerik:RadButton runat="server" ID="RadButton4" ButtonType="ToggleButton" ToggleType="CheckBox" AutoPostBack="false" Text="This text should be long enough to create a second line and maybe a third line because the next checkbox will overlaps with this one and maybe more." /> </dt> </dl></div><telerik:RadMaskedTextBox id="txtFlightNumber" runat="server" width="70px" SelectionOnFocus="SelectAll" Mask="<C|D|E>L ####<E|F>" />
<telerik:RadGrid ID="RadGrid" ... <Columns> <telerik:GridTemplateColumn HeaderText="ClickMe" UniqueName="ClickMe" ShowFilterIcon="false" AllowFiltering="false" ItemStyle-HorizontalAlign="Center"> <HeaderStyle HorizontalAlign="Center" Font-Bold="true" /> <ItemTemplate> <asp:CheckBox ID="chkClickMe" runat="server" Checked='<%# Eval("ClickMe") %>' Visible='<%# Eval("ClickMe") %>' OnClick='<%# Eval("ID", "ClickMe(this,{0});") %>' EnableViewState="true" /> </ItemTemplate> </telerik:GridTemplateColumn></Columns></telerik:RadGrid><script type="text/javascript"> var currentLoadingPanel = null; var currentControl = null; function ShowLoading() { currentLoadingPanel = $find('<%= loadingPanel.ClientID %>'); currentControl = $find("<%= RadGrid.ClientID %>"); currentLoadingPanel.show(currentControl); } function HideLoading() { if (currentLoadingPanel != null) { currentLoadingPanel.hide(currentUpdatedControl); } currentUpdatedControl = null; currentLoadingPanel = null; }var sender_id; function ClickMe(sender, id) { ShowLoading();}</script>