469,331 Members | 1,757 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,331 developers. It's quick & easy.

first time using gridview

Hi,

This is the first time I use a gridview.
I have two big problems:

1) I need to assign the columns of the gridview from the code (the cs
file )- because the assignment of the columns depends on the user.
Different users see different columns.

2) There is a dataTable column that I need to convert in the code
before showing it - from number to specific text. Where do I do the
conversion ? The gridview datasource contains, as I understand, only
one datasource.

I hope that I am clear.
Mayby someone has an idea?
Thanks.
Ruthie.

Feb 26 '07 #1
3 1039
On Feb 26, 10:28 am, "goldie11" <ruthie...@yahoo.comwrote:
Hi,

This is the first time I use a gridview.
I have two big problems:

1) I need to assign the columns of the gridview from the code (the cs
file )- because the assignment of the columns depends on the user.
Different users see different columns.

2) There is a dataTable column that I need to convert in the code
before showing it - from number to specific text. Where do I do the
conversion ? The gridview datasource contains, as I understand, only
one datasource.

I hope that I am clear.
Mayby someone has an idea?
Thanks.
Ruthie.
Hi,

Problem 1 is solved by using -
grid1.ColumnFields.Add(field);

Problem 2 - not a clue.

Thanks.
Ruthie.

Feb 26 '07 #2
2) do it in RowDataBound event. It fires as the rows get bound to the data
source. At this stage you can access the values of all columns and process
them as needed.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"goldie11" <ru*******@yahoo.comwrote in message
news:11**********************@t69g2000cwt.googlegr oups.com...
Hi,

This is the first time I use a gridview.
I have two big problems:

1) I need to assign the columns of the gridview from the code (the cs
file )- because the assignment of the columns depends on the user.
Different users see different columns.

2) There is a dataTable column that I need to convert in the code
before showing it - from number to specific text. Where do I do the
conversion ? The gridview datasource contains, as I understand, only
one datasource.

I hope that I am clear.
Mayby someone has an idea?
Thanks.
Ruthie.

Feb 26 '07 #3
On Feb 26, 1:13 pm, "Eliyahu Goldin"
<REMOVEALLCAPITALSeEgGoldD...@mMvVpPsS.orgwrote:
2) do it in RowDataBound event. It fires as the rows get bound to the data
source. At this stage you can access the values of all columns and process
them as needed.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldinhttp://usableasp.net

"goldie11" <ruthie...@yahoo.comwrote in message

news:11**********************@t69g2000cwt.googlegr oups.com...
Hi,
This is the first time I use a gridview.
I have two big problems:
1) I need to assign the columns of the gridview from the code (the cs
file )- because the assignment of the columns depends on the user.
Different users see different columns.
2) There is a dataTable column that I need to convert in the code
before showing it - from number to specific text. Where do I do the
conversion ? The gridview datasource contains, as I understand, only
one datasource.
I hope that I am clear.
Mayby someone has an idea?
Thanks.
Ruthie.- Hide quoted text -

- Show quoted text -
Dear Eliyahu,

Thanks so much for your help.

Your help, as always, solved the problem.

Best Regards,
Ruthie.

Feb 26 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Patrick Jox | last post: by
3 posts views Thread by tarscher | last post: by
1 post views Thread by Evan M. | last post: by
7 posts views Thread by =?Utf-8?B?V2FubmFiZQ==?= | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Purva khokhar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.