asp.net gridview itemtemplate image button click event is not fireing after convert to DataTable.
asp.net gridview itemtemplate image button click event is not fireing after convert to DataTable.
asp.net gridview itemtemplate image button click event is not fireing after convert to jquery DataTable. I used below mentioned code.In this code I used one image button.Once I clicked that image button ,I lost my gridview Data Source.and then its not load in UI also.So In code behind in page load I bind that dataSource after bind that event("GvRow_OnCommand") is not triggered.but I need to tigger this event whenever I click that image button.
$(document).ready(function () {
<%--var sw = $(".FixedHeaderPnlClass").parent().width();
var ht = $(".FixedHeaderPnlClass").height();
$('#<%= SampleGrid.ClientID %>' ).DataTable({
"scrollY": (ht - 60),
"scrollX": true,
"autoWidth": false,
"searching": false, "paging": false, "info": false,
"language": {
"zeroRecords": "No records to display"
}
});
});
<asp:GridView ID="SampleGrid" runat="server" CellSpacing="1" BorderStyle="none"
OnRowDataBound="SampleGrid_RowDataBound" AutoGenerateColumns="false" BackColor="White"
BorderWidth="0" CellPadding="0" DataKeyNames="ISSUEDETAILID" Width="100%">
<Columns>
<asp:TemplateField HeaderText="Closed Date" HeaderStyle-CssClass="pl5 rborderHeadergrid ">
<ItemTemplate>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%" align="right"
<asp:ImageButton ID="imgSample" OnCommand="GvRow_OnCommand"
CommandName="imgsamplecommand" CommandArgument='<%# Bind("SampleID") %>' ToolTip="sampleDate" />
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Replies
Hi...
Why don't you try using a Repeater instead?
Repeater gives you a more flexible structure to render your table.
For the data you could fill the table using the repeater, but I would recommend using AJAX to retrieve your data and use only JavaScript to manipulate columns.