HighTechTalks DotNet Forums  

Dynamic DataField

ASP.net Data Grid Control microsoft.public.dotnet.framework.aspnet.datagridcontrol


Discuss Dynamic DataField in the ASP.net Data Grid Control forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Msdn
 
Posts: n/a

Default Dynamic DataField - 09-01-2006 , 06:38 AM






I have a Gridview which have 3 boundfields and 6 templatecols with
imagebuttons.

I would like to use this grid with different dataset and must therefore
change the datafield of each boundfield based on the dataset, how do i do
that at runtime ?

Regards Keld



Reply With Quote
  #2  
Old   
Riki
 
Posts: n/a

Default Re: Dynamic DataField - 09-01-2006 , 01:58 PM






Msdn wrote:
Quote:
I have a Gridview which have 3 boundfields and 6 templatecols with
imagebuttons.

I would like to use this grid with different dataset and must
therefore change the datafield of each boundfield based on the
dataset, how do i do that at runtime ?

Regards Keld
I think you can do it by setting AutoGenerateColumns=True
(and removing the boundfields).
The grid will generate a column for each field in the dataset.

--

Riki




Reply With Quote
  #3  
Old   
Msdn
 
Posts: n/a

Default Re: Dynamic DataField - 09-04-2006 , 04:47 AM



I cant autogenerate cols because my dataset contains other fields which i
wont display in the grid.

Regards Keld
"Riki" <riki (AT) dontnagme (DOT) com> skrev i en meddelelse
news:eFkUxAfzGHA.3908 (AT) TK2MSFTNGP05 (DOT) phx.gbl...
Quote:
Msdn wrote:
I have a Gridview which have 3 boundfields and 6 templatecols with
imagebuttons.

I would like to use this grid with different dataset and must
therefore change the datafield of each boundfield based on the
dataset, how do i do that at runtime ?

Regards Keld

I think you can do it by setting AutoGenerateColumns=True
(and removing the boundfields).
The grid will generate a column for each field in the dataset.

--

Riki




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.