if you did assign a value into the CommandArgument e.g. below, you need to use the #1 methond else #2
<itemtemplate> <asp:imagebutton id="imgUpdate" runat="server" commandname="Update1" commandargument="'<%#">' ImageUrl="~/icons/Update001 (2).gif" /></itemtemplate>
#1
VB
Dim selectedRow As GridViewRow = DirectCast(DirectCast(e.CommandSource, LinkButton).NamingContainer, GridViewRow)Dim intRowIndex As Integer = Convert.ToInt32(selectedRow.RowIndex)GridView.Rows(intRowIndex).BackColor = System.Drawing.Color.Blue
C#
GridViewRow selectedRow = (GridViewRow)((ImageButton)e.CommandSource).NamingContainer;int intRowIndex = Convert.ToInt32(selectedRow.RowIndex);GridView.Rows[intRowIndex].BackColor = System.Drawing.Color.Blue;
or #2
VB
Dim selectedRow As GridViewRow = GridView.Rows(Convert.ToInt32(e.CommandArgument))selectedRow.BackColor = System.Drawing.Color.Blue
C#
GridViewRow selectedRow = GridView.Rows[Convert.ToInt32(e.CommandArgument)];selectedRow.BackColor = System.Drawing.Color.Blue;
Subscribe to:
Post Comments (Atom)
-
Hi, How to correct spell mistake in SSC Certificate To correct you name in SSC certificate you need to submit the following documents to...
-
Introduction Group discussions are today an important part of the selection process to many entry-level executive jobs and management insti...
-
The nation observed the birth centenary of Swami Vivekananda recently to commemorate the great visionary. (Pandit Nehru called him "the...
No comments:
Post a Comment