Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 717
  • Last Modified:

How to use the DataGrid Findcontrol in asp.net

How to use the DataGrid Findcontrol in asp.net with examples
0
Nissi_infotech
Asked:
Nissi_infotech
1 Solution
 
DreamMasterCommented:
This link explains it all..

http://www.odetocode.com/Articles/116.aspx

Regards,
Max.
0
 
kaliyugkaarjunCommented:
Hi

just check the following Link
http://www.dotnetjohn.com/articles.aspx?articleid=83

Cheers!!!
0
 
ayha1999Commented:
<asp:datagrid id="Datagrid1" runat="server" Font-Size="Small"  AutoGenerateColumns="False">
<Columns>
<asp:TemplateColumn HeaderText="Status">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemTemplate<asp:Label ID="lblStatus" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Status") %>'>      </asp:Label></ItemTemplate>
</asp:TemplateColumn>

...
</Datagrid>

Here you can retrive lblStatus value as follows:

dim dim YourVariableName as string = CType(e.Item.FindControl("lblStatus"),Label).Text

Just replace Label with textbox or hyperlink with appropriate controls name.

hope this helps.

ayha
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now