Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGrid Header

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I am trying to rename the HeaderText of my columns in a datagrid..

.Columns(1).HeaderText = "QTY"

I am getting an error message "Index Out of Range"

Any help would be appreciated

 
Collections are zero bound in vb.net. Either that, or you are trying to do this before the .databind method has been called on the datagrid, and it has not been populated.

Mark [openup]
 
I am doing this after th grid has been bound

It wont let me do anything to the grid.. cant rename headertext or set visable = false to any column???

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index


What does this mean???

 
Are you using a bound column? If so try this...

<asp:BoundColumn DataField="Customer_ID" SortExpression="CustID" ReadOnly="True" HeaderText="Cust ID"></asp:BoundColumn>

Hope this helps!


Hope everyone is having a great day!

Thanks - Jennifer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top