Hi All,
I have generated a RadGrid using a table. Code below is
While delete I need confirmation.
For that I have added confirmationtext usin
I have generated a RadGrid using a table. Code below is
While delete I need confirmation.
For that I have added confirmationtext usin
gtelerik:GridButtonColumn But it is not deleting. Only it is howing a message box. So what code we need to put in code-behind or aspx page to do deletions. Tell me some suggestions<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" ShowStatusBar="True" AllowPaging="True" Skin="Office2007" AutoGenerateDeleteColumn="True" AutoGenerateColumns="False" AllowFilteringByColumn="True" DataSourceID="SqlDataSource5" GridLines="None" Width="520px"AllowAutomaticUpdates="True" AllowAutomaticInserts="True" AutoGenerateEditColumn="True"> <MasterTableView DataSourceID="SqlDataSource5" AllowAutomaticUpdates="True" CommandItemDisplay="Top" DataKeyNames="ID" AllowAutomaticInserts="true"> <Columns> <telerik:GridBoundColumn DataField="ID" HeaderText="ID" SortExpression="ID" UniqueName="ID" DataType="System.Int32" ReadOnly="True" Visible="false" /> <telerik:GridBoundColumn DataField="Class" HeaderText="Class" SortExpression="Class" UniqueName="Class" /> <telerik:GridBoundColumn DataField="Course" HeaderText="Course" SortExpression="Course" UniqueName="Course" AllowFiltering="false"> </telerik:GridBoundColumn> <telerik:GridButtonColumn ConfirmText="Are you sure you want to delete this row or record?" CommandName="Delete" Text="Delete"></telerik:GridButtonColumn> <%--<telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"UniqueName="DeleteColumn"><ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /></telerik:GridButtonColumn>--%> </Columns> </MasterTableView> <HeaderStyle HorizontalAlign="Center" /> </telerik:RadGrid> <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:SearchingConnectionString %>" DeleteCommand="DELETE FROM [Clas_Course] WHERE [ID] = @ID" InsertCommand="INSERT INTO [Clas_Course] ([Class], [Course]) VALUES (@Class, @Course)" SelectCommand="SELECT [ID], [Class], [Course] FROM [Clas_Course]" UpdateCommand="UPDATE [Clas_Course] SET [Class] = @Class, [Course] = @Course WHERE [ID] = @ID"> <DeleteParameters> <asp:Parameter Name="ID" Type="Int32" /> </DeleteParameters> <InsertParameters> <asp:Parameter Name="Class" Type="String" /> <asp:Parameter Name="Course" Type="String" /> </InsertParameters> <UpdateParameters> <asp:Parameter Name="Class" Type="String" /> <asp:Parameter Name="Course" Type="String" /> <asp:Parameter Name="ID" Type="Int32" /> </UpdateParameters> </asp:SqlDataSource> </td></tr> </table> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> </telerik:RadScriptManager> </div> <div class="cornerDiv"> <img src="Images/bLeft_corner.gif" class="float"/> <div class="bg_div"></div> <img src="Images/bRight_corner.gif" class="float"/> </div>