|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Get number of columns of a late bound GridViewIf I have a GridView that I don't bind until run time like so...
GridView1.DataSource = someTable; GridView1.DataBind(); Is it possible for me to use the Count property? When I attempt something like this.. GridView1.Columns.Count I always get a 0. I can't figure it out. Any thoughts? Regards. cti***@gmail.com wrote:
Show quoteHide quote > If I have a GridView that I don't bind until run time like so... Its only matters that in which event you're binding the data and calling > > GridView1.DataSource = someTable; > GridView1.DataBind(); > > Is it possible for me to use the Count property? When I attempt > something like this.. > > GridView1.Columns.Count I always get a 0. I can't figure it out. > > Any thoughts? > > Regards. > the Count property. GridView control will assign the data source once after the RowDataBound event. Check for this and call the Count property in appropriate place. If you're problem is not solved, please post some of your code here. - Vadivel Kumar http://vadivelk.net
Other interesting topics
Adding WebControl using a Button....
TextBox TextChanged Event changing cursor of ImageButton Custom Controls with non-String Attributes Responding to changes to controls in a Repeater Response.Redirect not being called after sending an email Dynamically Creating A CSS Class Validation messages not displaying How to use gridview Bitmap as a Image web control |
|||||||||||||||||||||||