TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
yashvant k
NA
29
0
problem getting rowid in gridview
May 10 2010 12:16 AM
hi,
i am not able to get rowindex of grid, i used onclick of link button event.
here i ma code..
<asp:GridView ID="GridView1" AutoGenerateColumns="False" runat="server" CellPadding="4"
CellSpacing="10" Width="580px" ShowHeader="False"
OnRowDataBound="GridView1_RowDataBound"
OnPageIndexChanging="gvPageIndexChanged" AllowPaging="True" PageSize="15">
<PagerSettings FirstPageText="&lt;&lt;&nbsp;&nbsp;"
LastPageText="&nbsp;&nbsp;&gt;&gt;" NextPageText="&nbsp;&nbsp;Next"
PreviousPageText="Prev&nbsp;&nbsp;" />
<HeaderStyle ForeColor="Black" CssClass="head" ></HeaderStyle>
<RowStyle CssClass="gvrowstyleread" ForeColor="black" />
<PagerStyle CssClass="gridview" />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table class="bg_grid_color" cellpadding="15" style="font-size:13px;">
<tr>
<td width="280"id="details">
<div >
<asp:Label runat="server" ID="lbl1" Font-Bold ="true">From: </asp:Label><asp:Label ID="lblAnswerUserInfo" runat="server" Text="User Information"></asp:Label>
</div>
<div >
<asp:Label runat="server" ID="lbl2" Font-Bold ="true">School: </asp:Label><asp:Label ID="lblSchool" runat="server" Text="School"></asp:Label>
</div>
<div >
<asp:Label runat="server" ID="lbl3" Font-Bold ="true">Date: </asp:Label><asp:Label ID="lblDate" runat="server" Text="Date"></asp:Label>
</div>
</td>
<td width="580" id="answer">
<div >
<asp:Label ID="Label1" runat="server" Text='<%# Bind("message") %>'></asp:Label>
</div>
</td>
</tr>
</table>
</ItemTemplate>
<ItemStyle HorizontalAlign="Left" />
</asp:TemplateField>
<asp:TemplateField HeaderText="User ID">
<ItemTemplate>
<asp:Label ID="lblSender" runat="server" Text='<%# Bind("UniqueIdsender") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Reply" ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="lnkReply" runat="server" CausesValidation="false"
CommandName="" Text="Reply" OnClick = "lnkReply_Click"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="gvheader"></HeaderStyle>
<RowStyle CssClass="gvrowstyleread" />
</asp:GridView>
Reply
Answers (
1
)
Assembly
How to get rowindex of gridview on button click