On click of “Add new item” the template is shown with Insert and Cancel button.But on click of insert I am not getting the event on the codebehind.
It’s the same on edit……when I click “Update" button.
I have pasted the code here.
<telerik:RadGrid id="RadGrid1" runat="server" Skin="Office2007" Width="40%"
AllowSorting="true" AllowMultiRowSelection="true" AllowMultiRowEdit="true"
AutoGenerateColumns="False">
<MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="ID">
<CommandItemTemplate>
<table>
<tr>
<td width="30%">
<asp:LinkButton ID="btnAdd" Text="Add new item" CommandName="InitInsert" runat="server"></asp:LinkButton>
<asp:LinkButton ID="btnEdit" Text="Edit selected" CommandName="EditSelected" runat="server"></asp:LinkButton>
</td>
<td width="40%">
</td>
<td width="30%">
<asp:LinkButton ID="btnRefresh" Text="Refresh data" CommandName="Rebind" runat="server"></asp:LinkButton>
<asp:LinkButton ID="btnUpdate" Text="Update edited" CommandName="UpdateEdited" runat="server"></asp:LinkButton>
</td>
</tr>
</table>
</CommandItemTemplate>
<Columns>
<telerik:GridEditCommandColumn ButtonType="ImageButton">
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn DataField=" ID" HeaderText="ID" SortExpression="TR_ID"
Visible="false" UniqueName="ID">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Customer" FilterControlWidth="40px" HeaderText="Customer"
SortExpression="Customer" UniqueName="Customer">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ProjectNumber" FilterControlWidth="40px" HeaderText="Project Number"
SortExpression="ProjectNumber" UniqueName="ProjectNumber">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="TestNumber" FilterControlWidth="40px" HeaderText="Test Number"
SortExpression="TestNumber" UniqueName="TestNumber">
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings EditFormType="Template">
<FormTemplate>
<table id="Table2" cellspacing="2" cellpadding="1" width="900px" border="1" rules="none"
style="border-collapse: collapse; background: white;">
<tr>
<td style="width: 50%">
<table width="100%">
<tr>
<td colspan="2">
<asp:Label ID="Label1" CssClass="tableheading" runat="server" Text="Test Info :"
Font-Bold="True"></asp:Label>
</td>
</tr>
<tr>
<td style="width: 30%">
<asp:Label ID="Label3" CssClass="data" runat="server" Text="Run No"></asp:Label>
</td>
<td>
<telerik:RadTextBox ID="RadTextBox11" Text='<%# Bind( "Customer" ) %>' runat="server"
CssClass="data">
</telerik:RadTextBox>
</td>
</tr>
<tr>
<td style="width: 30%">
<asp:Label ID="Label4" CssClass="data" runat="server" Text="Bucket Type"></asp:Label>
</td>
<td>
<telerik:RadTextBox ID="RadTextBox12" Text='<%# Bind( "ProjectNumber" ) %>' runat="server"
CssClass="data">
</telerik:RadTextBox>
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td colspan="2">
<asp:Label ID="Label31" CssClass="tableheading" runat="server" Text=""></asp:Label>
</td>
</tr>
<tr>
<td style="width: 30%">
<asp:Label ID="Label2" CssClass="tableheading" runat="server" Text="Name"></asp:Label>
</td>
<td style="width: 70%">
<telerik:RadComboBox ID="ddldrp" Width="100%" runat="server" > </telerik:RadComboBox>
</td>
</tr>
<tr>
<td style="width: 30%">
<asp:Label ID="Label5" CssClass="data" runat="server" Text="TestNumber"></asp:Label>
</td>
<td>
<telerik:RadTextBox ID="RadTextBox13" Text='<%# Bind( "TestNumber" ) %>' runat="server"
CssClass="data">
</telerik:RadTextBox>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="right" colspan="2">
<asp:Button ID="btnUpdate" Text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>'
runat="server" CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'>
</asp:Button>
<asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
CommandName="Cancel"></asp:Button>
</td>
</tr>
</table>
</FormTemplate>
<EditColumn UniqueName="EditCommandColumn1"></EditColumn>
<FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle>
<FormCaptionStyle></FormCaptionStyle>
</EditFormSettings>
</MasterTableView>
<ClientSettings>
<Selecting AllowRowSelect="True" EnableDragToSelectRows="True" />
</ClientSettings>
</telerik:RadGrid>

| Dim adapter As New SqlDataAdapter(strSQL, dbs) |
| adapter.SelectCommand.Parameters.Add("@MenuIDvalue", SqlDbType.Int, 4) |
| adapter.SelectCommand.Parameters("@MenuIDvalue").Value = MenuIDvalue |
| adapter.SelectCommand.Parameters.Add("@LangID", SqlDbType.Int, 4) |
| adapter.SelectCommand.Parameters("@LangID").Value = LangID |
| Dim Menu As New DataSet() |
| rst.Close() |
| adapter.Fill(Menu) |
| panelmenu1.DataTextField = "Pagename" |
| panelmenu1.MaxDataBindDepth = Dropdownlevels |
| panelmenu1.DataFieldID = "ID" |
| panelmenu1.DataFieldParentID = "PageID" |
| panelmenu1.DataSource = Menu |
| panelmenu1.DataBind() |

I have a RadGrid using XML file as data source and the field on this XML file is not formatted. We need to format the value in the field as percentage with two decimal digits and I have coded as shown below:
| <telerik:GridBoundColumn DataField="Percentage" HeaderText="Percentage" SortExpression="Percentage" |
| UniqueName="Percentage" DataFormatString="{0:#####.## %}" |
| EditFormHeaderTextFormat="{0:#####.## %}" > |
| </telerik:GridBoundColumn> |
However, no matter what I change on the DataFormatString the value shows without formatting. Can you please help? Thank you.