473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

DataGrid - Headertext Issue

When I try to change the header text after Databind for a column (ASP.Net) I am getting the following error
dgTest.Columns(0).HeaderText = "TEST#

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

PS: I am using ASP.Net 2002 with servicepack

Nov 22 '05 #1
4 1619
Cor
Hi Chan,

Did you check by deleting this row if your Datagrid is loading?

Cor
When I try to change the header text after Databind for a column (ASP.Net) I am getting the following error: dgTest.Columns(0).HeaderText = "TEST#"

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
PS: I am using ASP.Net 2002 with servicepack2

Nov 22 '05 #2
Hi Cor

Datagrid load the data with the header as the column name
But I want to change the header
So I tried to us
dgTest.Columns(0).HeaderText = "TEST#
to set my header instead of the database column name
But this is not working

Please let me know how to set the headertext right in the VB module without the scripts
Thanks in advanc
Chan
Nov 22 '05 #3
Cor
Hi Chan,

If you said that immidiatly,
Have a look at the datagridstyles and datagrid columnstyles
http://msdn.microsoft.com/library/de...mberstopic.asp

I think this helps you further, if not ask again?

Cor
Nov 22 '05 #4
Cor & All

I actually used that information
So I had something like this in my cod
dgTest.Columns(0).HeaderText = "TEST#

But this throw error lik
"Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

Thanks in advanc
Chan
Nov 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Derek | last post by:
I have an aspx page where I use a reversebind and templates to edit the entire datagrid at one time. I added a textbox and button to change the parameter criteria and then rerun the databind2...
2
by: David Stephen | last post by:
I'd like to use a datagrid to display a result from a datatable but based on the data I'd like to display rows with merged cells is a new type of heading across a couple of standard cells or a...
2
by: Ken Tucker | last post by:
I've read about this issue in many articles across the net... But haven't found a solution. I see all kinds of custom code to perform sorting with datagrids, but my example is so simple, I must...
2
by: Daniel Walzenbach | last post by:
Hi, I created an ASP.NET Datagrid where a single row can be selected by clicking anywhere on the row (according to...
1
by: m3ckon | last post by:
Hi there, please help if you can, I'm having an issue with droponnlists in a datagrid I have a datagrid which is populated from a query .. all works fine I've added two extra columns, one...
1
by: I am Sam | last post by:
I need to be able to delete a record/row from a database table. I am using a DataGrid which is not sending the row index key properly to the event in the codebehind. When I set a break point and...
4
by: Hexman | last post by:
I was going along fine in my test to see how to manipulate the DataGrid (dgTrans) and its columns. I have a single form with one DataGrid (dgTrans) on it. The code I have in my form load event...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
1
by: Steven Van Eyck | last post by:
Hi there There are probably lots of questions being posted about datagrids, but I can't resist... ;-) Here's my issue: I have an aspx page with a datagrid in which I manually declare the...
1
by: Tarik Monem | last post by:
Hi everyone and I hope that you can help. I am trying to send a value of a cell within a Datagrid to my php file which has a simple sql query: here's the php: <? $server = "localhost";
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.