Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Changing Headers on DataGrid

Reply
Thread Tools

Changing Headers on DataGrid

 
 
Gary
Guest
Posts: n/a
 
      04-02-2004
I have not had my previous posts answered and I really
need to fix this problem. Please help.

I have populated a datagrid in code but I would like to
change the header text and width of two of the columns.

I used the following code after binding the dataset to
the grid:

Dim cstStartTime As New DataGridTextBoxColumn
cstStartTime.MappingName = "StartTime"
cstStartTime.HeaderText = "Start Time"
cstStartTime.Width = 1550

I did this twice. Then I added the GridColumnStyles and
finally did a TableStyles.Add.

When the grid displays the data, no columns appear. What
am I doing wrong?

Thanks,

Gary

 
Reply With Quote
 
 
 
 
Michael Tkachev
Guest
Posts: n/a
 
      04-07-2004
DataGrid.Columns[0].HeaderText = "bla-bla";
DataGrid.Columns[0].ItemStyle.Width = 1500;

Remember! You have to do it before databind of datagrid.

"Gary" <> wrote in message
news:1759201c418c2$e54cbc70$...
> I have not had my previous posts answered and I really
> need to fix this problem. Please help.
>
> I have populated a datagrid in code but I would like to
> change the header text and width of two of the columns.
>
> I used the following code after binding the dataset to
> the grid:
>
> Dim cstStartTime As New DataGridTextBoxColumn
> cstStartTime.MappingName = "StartTime"
> cstStartTime.HeaderText = "Start Time"
> cstStartTime.Width = 1550
>
> I did this twice. Then I added the GridColumnStyles and
> finally did a TableStyles.Add.
>
> When the grid displays the data, no columns appear. What
> am I doing wrong?
>
> Thanks,
>
> Gary
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Problem with wsgiref.headers.Headers Phil Python 4 01-17-2010 04:47 PM
Server cannot clear headers after HTTP headers have been sent Ian ASP .Net Security 2 03-20-2007 09:00 AM
Changing Http Headers in Axis1.4 itsprabhu@gmail.com Java 2 12-13-2006 09:18 AM
Changing Request Headers values =?Utf-8?B?SnVzdGluUw==?= ASP .Net 1 08-16-2005 05:24 PM
Reading 'received' headers: Email Headers Parsing dont bother Python 0 03-03-2004 08:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57