Nothing, no ID attached to that cell
The HTML code of that gridview is
<asp:GridView ID="gridSearchR esult" runat="server" CellPadding="4"
ForeColor="#333 333" GridLines="None " AutoGenerateCol umns="false">
<FooterStyle BackColor="#5D7 B9D" Font-Bold="True"
ForeColor="Whit e" />
<RowStyle BackColor="#F7F 6F3" ForeColor="#333 333" />
<EditRowStyle BackColor="#999 999" />
<SelectedRowSty le BackColor="#E2D ED6" Font-Bold="True"
ForeColor="#333 333" />
<PagerStyle BackColor="#284 775" ForeColor="Whit e"
HorizontalAlign ="Center" />
<HeaderStyle BackColor="#5D7 B9D" Font-Bold="True"
ForeColor="Whit e" />
<AlternatingRow Style BackColor="Whit e" ForeColor="#284 775" />
<Columns>
<asp:TemplateFi eld HeaderText="Ena ble/Disable User Account">
<ItemTemplate >
<asp:CheckBox ID="checkBox_Di sable_User_Acco unt"
runat="server" />
</ItemTemplate>
</asp:TemplateFie ld>
<asp:HyperLinkF ield DataNavigateUrl Fields="User Name,Server
IP / HOST NAME"
DataNavigateUrl FormatString="e ditUserPwd.aspx ?username={0}&a mp;server={1}"
HeaderText="Edi t User" Text="Edit" />
<asp:BoundFie ld HeaderText="Use r Name" DataField="User
Name"/>
<asp:BoundFie ld HeaderText="Ser ver IP / HOST NAME"
DataField="Serv er IP / HOST NAME" />
</Columns>
</asp:GridView>
I want to get the value of boundfield Server IP, thank you.
"Siva M" <sh******@onlin e.excite.comwro te in message
news:0A******** *************** ***********@mic rosoft.com...
What type of control is it? Label? If so, do the same FindControl() method
passing the ID of the label.
"LamSoft" wrote:
>If there is a table(2x2) generated from the gridview as below
checkbox-1 mytest-1 mytest-2
checkbox-1 mytest-3 mytest-3
I know how to check that two checkbox are checked or not, but how to get
the
value of other column at the same row while in the for-loop statement.
for (int i = 0; i < gridSearchResul t.Rows.Count; i++)
{
CheckBox cb =
(CheckBox)grid SearchResult.Ro ws[i].FindControl("c heckBox_-1");
if (cb.Checked)
{
// get the value of the row in second column
// how to get it?
}
}
Thanks