14Sep/096
How to Set or Change the HeadText values in GridView control
GridView control offers us to bind the data and list the data in columns with nice format. However, when I want bind the HeadText properties for the columns of the data, I have to use this way:
--------------------------------------------------------------------------------
MyGridView.Columns[0].HeadText = "Head Text For Column 1"; MyGridView.Columns[1].HeadText = "Head Text For Column 2";
--------------------------------------------------------------------------------
Just FYI, *_*
September 15th, 2009 - 06:32
This method has some disadvantages. Whenever columns are added, removed or the order is changed, the code behind must be updated with the correct column index. On larger GridView’s with many columns, it’s thus easy to get errors. There should be a better way to do this.
September 15th, 2009 - 16:13
Thanks for the reply, however, I did spend sometime on finding a better way to work it out. I can not use MyGridView.FindControl(“Balala”). Maybe can use Javascript, I didnot try that. And thanks for the info.
September 16th, 2009 - 17:19
Super post, Need to mark it on Digg
Charlie
September 18th, 2009 - 17:34
GridView outputs contents with ‘<table…' The <table element is slow to render in IE, because IE does not render the '<table' element until all HTML is loaded. One way to play around it is to avoid using <table, div is a nice alternative. However, GridView cannot output <div, even you change the render mode to 'flow', if I remember it correctly, but, a DataList can.
September 18th, 2009 - 17:36
GridView outputs contents with ‘table…’ The table element is slow to render in IE, because IE does not render the ‘table’ element until all HTML is loaded. One way to play around it is to avoid using table, div is a nice alternative. However, GridView cannot output div, even you change the render mode to ‘flow’, if I remember it correctly, but, a DataList can.
May 5th, 2011 - 20:05
hello! somebody maybe use google?
google