As Steve suggested, try it after you did the databinding on the grid.
"IGotYourDotNet" <IG************@discussions.microsoft.com> wrote in message
news:F8**********************************@microsof t.com...
it is but i get this error message when i try to change the first column
header.
Index was out of range. Must be non-negative and less than the size of the
collection. Parameter name: index
heres my code i'm changing it in
dgStuff.Columns(0).HeaderText = "Cars"
"Shiva" wrote:
Hi,
You can access individual columns using DataGrid.Columns[<col index>]. For
eg, to change the header text of the first column,
DataGrid.Columns[0].HeaderText = "My Col1 Text".
Hope this is what you are looking for.
"IGotYourDotNet" <IG************@discussions.microsoft.com> wrote in
message news:0F**********************************@microsof t.com...
on my web app, i need to display data from a table in a grid. (i know how
to do that). The grid will be populated with data depending on what the user
selects in a drop down box. My question is instead of having 20 grids can
i use only 1 and change the data that should be displayed and the headers
via code, or do I need a seperate grid per choice in the drop down box.