Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / DataGrid / April 2004

Tip: Looking for answers? Try searching our database.

Changing Headers on DataGrid

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gary - 02 Apr 2004 15:58 GMT
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
Michael Tkachev - 07 Apr 2004 10:54 GMT
DataGrid.Columns[0].HeaderText = "bla-bla";
DataGrid.Columns[0].ItemStyle.Width = 1500;

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

> I have not had my previous posts answered and I really
> need to fix this problem.  Please help.
[quoted text clipped - 19 lines]
>
> Gary

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.