PC Review


Reply
Thread Tools Rate Thread

DataGrid - Headertext Issue

 
 
=?Utf-8?B?Q2hhbg==?=
Guest
Posts: n/a
 
      24th Feb 2004
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

 
Reply With Quote
 
 
 
 
Cor
Guest
Posts: n/a
 
      25th Feb 2004
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
>



 
Reply With Quote
 
=?Utf-8?B?Q2hhbg==?=
Guest
Posts: n/a
 
      25th Feb 2004
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
 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      25th Feb 2004
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


 
Reply With Quote
 
=?Utf-8?B?Q2hhbg==?=
Guest
Posts: n/a
 
      2nd Mar 2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HeaderText & HeaderImageUrl in TemplateColumn in DataGrid rn5a@rediffmail.com Microsoft ASP .NET 3 27th Apr 2007 09:51 AM
Change HeaderText in datagrid Øyvind Isaksen Microsoft ASP .NET 1 6th Nov 2005 02:19 PM
Set headertext in datagrid programatically =?Utf-8?B?bWc=?= Microsoft ASP .NET 1 27th May 2004 06:02 AM
change HeaderText of DataGrid in PreRender() Andy Wang Microsoft ASP .NET 0 12th May 2004 09:56 PM
HeaderText alignment on datagrid Melvin Weaver Microsoft C# .NET 0 29th Feb 2004 07:50 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:02 AM.