Jump to content
Sign in to follow this  
rhishi20

how to access column value of gridview under rowdatabound event

Recommended Posts

please suggest me how i can access Gridview's column value under rowdatabound event.

 

I have tried below

 

Protected Sub GridView2_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView2.RowDataBound

 

Dim asbcdval As String

 

asbcdval = e.Row.Cells(0).Text

 

end sub

 

but this returns "" means nothing.

 

please solve my problem

Edited by rhishi20

Share this post


Link to post
Share on other sites

You need to use gridView.FindControl("controlName"); to get the control in the row.

 

Example:

 

//Find textbox control

TextBox txtname = (TextBox)e.Row.FindControl("txtName"); string Name = txtname.Text;

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×