Where is the datasourceID for gridview?
compare with the below code.. If you face any problem, let me know
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" BorderStyle="None" DataKeyNames="Title"
DataSourceID="ObjectDataSource1" EmptyDataText="No Data Found" Font-Bold="True"
OnRowCommand="GridView1_RowCommand" PageSize="5" Visible="False" Width="62%">
<PagerSettings PageButtonCount="5" Position="Top" />
<RowStyle BackColor="#66FFFF" HorizontalAlign="Center" VerticalAlign="Middle" />
<EmptyDataRowStyle ForeColor="Red" />
<Columns>
<asp:BoundField />
<asp:TemplateField>
<HeaderTemplate>
Delete
</HeaderTemplate>
<ItemTemplate>
<asp:Button ID="BtnDelete" runat="server" CommandArgument='<%#Eval("Title")%>'
CommandName="Del"
OnClientClick="return confirm('Are you sure you want to delete this record?');"
Text="Delete" />
<asp:Button ID="BtnEdit" runat="server" CommandArgument='<%#Eval("Title") %>'
CommandName="edit" Text="Edit" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<PagerStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<HeaderStyle BackColor="#FF9966" />
<EditRowStyle BackColor="White" HorizontalAlign="Center"
VerticalAlign="Middle" />
<AlternatingRowStyle BackColor="White" HorizontalAlign="Center"
VerticalAlign="Middle" />
</asp:GridView>
---------------------------------------
Live the life you've dreamed
Regards
MADHU
Cvbharathi89, if this helps please login to Mark As Answer. |
Reply | Alert Moderator