0

I have a gridview as :

<asp:GridView ID="gvAppRejProfiles" runat="server" AutoGenerateColumns="false">
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    Resumes
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbtnResumes" runat="server"></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

i have a list of resume names (string format) that i want to add as the text of the linkbutton "lbtnResumes" for all the resume names that i have in a string array.

Pranay Rana
  • 175,020
  • 35
  • 237
  • 263
NayeemKhan
  • 1,210
  • 7
  • 19
  • 38

2 Answers2

0

make use of FindControl() mehod ....to search control

void gvAppRejProfiles_RowDataBound(object sender, GridViewRowEventArgs e)
{

    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        LinkButton bl = 
         (LinkButton)e.Row.FindControl("lbtnResumes");


    }
}
Pranay Rana
  • 175,020
  • 35
  • 237
  • 263
0
for (int count = 0; count < gvAppRejProfiles.Rows.Count; count++)
                {
                    LinkButton lbtnResumes = (LinkButton)gvAppRejProfiles.Rows[count].FindControl("lbtnResumes");
                    if (lbtnResumes.Text == "resume")
                    {
                        // Store and perform any operation
                    }
                }
Saurabh
  • 5,661
  • 2
  • 26
  • 32