Hello,
I'm using Version 11.2 and have a WebDataGrid with a TemplateDataField where I created an ImageButton in the ItemTemplage - see code below
<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <ig:WebDataGrid ID="WebDataGrid1" runat="server" AutoGenerateColumns="False" Height="347px" Width="578px" DataKeyFields="Id" > <Columns> <ig:TemplateDataField Key="TemplateField_0"> <ItemTemplate> <asp:ImageButton ID="ImageButton1" runat="server" ToolTip="Handles Click Event of the ImageButton" /> </ItemTemplate> <Header Text="TemplateField_0" /> </ig:TemplateDataField> <ig:BoundDataField DataFieldName="Id" Key="OrderId" Header-Text="Order No" > <Header Text="Order No" /> <ig:BoundDataField DataFieldName="username" Key="UserName" Header-Text="User Name" > <Header Text="User Name" /> </ig:BoundDataField> </Columns> </ig:WebDataGrid>
When the user click on the imagebutton - to delete a record - I need to confirm it before the delete process occurs. i know how to display the confirm alert using Javascript. The only question I have is how to call the C# code behind when the user clicks Ok to actually delete the record. Can anyone help me on this? Thanks!
Thank you for your reply. It is working now.
Hello tangolp,
I'm just checking if you need any further assistance with the matter.
Hi tangolp,
You can create template for a column and not for a row. You could create button templates for all columns but doing this will place buttons in all rows.
Thank you Nikolay for your response. Based on your sample, can you please tell me how I can put 1 button in a each column? Thanks!
I would suggest you to delete the row client-side. Here is a sample, demonstrating scenario, similar to yours - http://help.infragistics.com/Help/NetAdvantage/ASPNET/2012.1/CLR4.0/html/WebDataGrid_Using_Item_Template.html. Please let me know if you have any questions.