473,473 Members | 2,153 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Changing datagrid header text

Hi all,
I have problem with datagrid in asp.net using vb as the
language. This is how I show the datagrid from database

datagrid1.datasource = dataset1
datagrid1.DataBind()

Is there any possibility to change the header on every
column and how to set the column width

Thanks
Nov 19 '05 #1
2 1592
You mean you are using autogenerated columns. The only way to change header
columns is to handle ItemCreated event. You can detect header item, get
access to the cells and change their text and width.

Eliyahu

"Herry" <an*******@discussions.microsoft.com> wrote in message
news:54****************************@phx.gbl...
Hi all,
I have problem with datagrid in asp.net using vb as the
language. This is how I show the datagrid from database

datagrid1.datasource = dataset1
datagrid1.DataBind()

Is there any possibility to change the header on every
column and how to set the column width

Thanks

Nov 19 '05 #2
Hi Eliyahu

I dont understand how to use ItemCreated event.
can u show me the code to change the header.

Thanks a lot
-----Original Message-----
You mean you are using autogenerated columns. The only way to change headercolumns is to handle ItemCreated event. You can detect header item, getaccess to the cells and change their text and width.

Eliyahu

"Herry" <an*******@discussions.microsoft.com> wrote in messagenews:54****************************@phx.gbl...
Hi all,
I have problem with datagrid in asp.net using vb as the
language. This is how I show the datagrid from database

datagrid1.datasource = dataset1
datagrid1.DataBind()

Is there any possibility to change the header on every
column and how to set the column width

Thanks

.

Nov 19 '05 #3

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

Similar topics

1
by: Webgour | last post by:
Hi, I'm tring to add a column to a datagrid with a linkbutton as header that can be used to sort the column. The column and the linkbutton are added programmatically (see below). However the...
3
by: Ben | last post by:
Hi, I'm wondering how can i change the datagrid header text at runtime so that it keeps the sorting enabled? I can do; e.Item.Cells.Text = "foo"; But then foo is the text of the table cell...
2
by: rooster575 | last post by:
I would like my datagrid to have the following format: ID - Name - Phone Title - Birthday - email Is this possible for the header and result items? Thanks.
0
by: Danny | last post by:
I am trying to sort my second datagrid. And it works but only after i click 2 times on the column header. The first time i click on the header the data in the right order will add to the rows in...
2
by: saleek | last post by:
I was wondering if there is a way I can add an extra header to a datagrid? I found this solution on the internet - but it seems quite old and didn't work for me. ...
0
by: Daniel Doyle | last post by:
Hello and apologies in advance for the amount of code in this post. I've also sent this message to the Sharepoint group, but thought that ASP.NET developers may also be able to help, even though...
4
by: Mac via DotNetMonster.com | last post by:
I am attempting to change the header text on all the columns in my datagrid once it was been populated from a dataset. I have tried to implement some code from the following MSDN document but what...
1
by: Veeves | last post by:
I would like to change the width of a datagrid column at run time. I have noticed when creating a datagrid, if the header text is shorter than the data in the column, then the column width set by...
2
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
1
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.