Solved

asp.net vb.net how can acces label control inside gridview column template

Posted on 2010-08-27
2
449 Views
Last Modified: 2012-06-21
I need show/hide a label control inside gridview column template, how can access from aspx.vb code.
0
Comment
Question by:rflorencio
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 20

Assisted Solution

by:informaniac
informaniac earned 100 total points
ID: 33542503
I'm not sure of vb but in C# it's like this

Label lblName = Gv.Rows[0].FindControl("lblName") as Label;
lblName.Visible = false;
0
 
LVL 3

Accepted Solution

by:
raaziq earned 400 total points
ID: 33543576
u can use the gridview RowDatabound event,

 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
              Label lbl = e.Row.FindControl("Label1");
        }


u can set its visibility frm here based on any conditions. it occurs during the binding of each rows of the gridview.

cheers.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question