Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Datagrid colums name ??

 
Thread Tools Search this Thread
Old 01-20-2006, 04:56 PM   #1
Default Datagrid colums name ??


Dear all,

I have a datagrid erver control which is bind to a dataset.
How to display as column name custom text instead of database fields name ?

Ex :
Started At instead of START_TIME_COL

thnaks
regards
serge


=?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=
  Reply With Quote
Old 01-20-2006, 06:05 PM   #2
joshuacoad@gmail.com
 
Posts: n/a
Default Re: Datagrid colums name ??
You can go into the DataGrid's Property Builder (right-click on
DataGrid -> Property Builder) and accomplish this. Under the Columns
section, uncheck "Create columns automatically at run time" and then
add each Bound Column, if they are not already there. Under each Bound
Column's properties, you can change the HeaderText property to whatever
you want. Just make sure to leave the DataField property to the field
name in the database.



joshuacoad@gmail.com
  Reply With Quote
Old 01-20-2006, 08:25 PM   #3
=?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=
 
Posts: n/a
Default Re: Datagrid colums name ??
Thanks for your reply
I need to bind datset to datagrid dynamically , so grid column name as well,
so I do not want to you the propertie builder from the IDE.
I rather prefer to code it

If I do that, is there a particular event that I can play with which occurs
just before the grid gets dispay and allows me to change column text and
datbound filed ?

thnaks

"" wrote:

> You can go into the DataGrid's Property Builder (right-click on
> DataGrid -> Property Builder) and accomplish this. Under the Columns
> section, uncheck "Create columns automatically at run time" and then
> add each Bound Column, if they are not already there. Under each Bound
> Column's properties, you can change the HeaderText property to whatever
> you want. Just make sure to leave the DataField property to the field
> name in the database.
>
>



=?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=
  Reply With Quote
Old 01-24-2006, 01:52 PM   #4
joshuacoad@gmail.com
 
Posts: n/a
Default Re: Datagrid colums name ??
I don't blame you on not wanting to use the IDE, I prefer not to as
well.

It might be easier to come up with a solution if I knew a little bit
more about what the application is doing, for instance, when you are
collecting the data that determines the column names. One suggestion
would be to use a DataTable instead of a DataSet. Is there a fixed
number of columns and how are you determining what the columns are to
be named? The DataSet does have the following property that maybe you
could use:

oDataSet.Tables(0).Columns(0).ColumnName

You could traverse through the DataSet and change the ColumnName based
on the index, before you bind it to the DataGrid.



joshuacoad@gmail.com
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Get datagrid textbox value kanchangorak Software 0 03-11-2009 11:11 AM
Loading 24,000 rows into C# .net Datagrid Kagu Software 0 03-10-2009 06:51 PM
validating textbox inside datagrid susan_1516 Software 0 11-09-2008 01:29 PM
ASP.NET VB Using ItemDataBound to create textbox in datagrid rows. smi59550 General Help Related Topics 0 01-18-2008 07:42 PM
Disable ASP Button in a Datagrid ChrisClayko General Help Related Topics 0 08-02-2006 03:08 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

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