Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Dynamic DataField

Reply
Thread Tools

Dynamic DataField

 
 
Msdn
Guest
Posts: n/a
 
      09-01-2006
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
 
 
 
 
Riki
Guest
Posts: n/a
 
      09-01-2006
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
 
 
 
 
Msdn
Guest
Posts: n/a
 
      09-04-2006
I cant autogenerate cols because my dataset contains other fields which i
wont display in the grid.

Regards Keld
"Riki" <> skrev i en meddelelse
news:...
> 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

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get DataField value of a cell Dinçer ASP .Net 3 12-09-2004 09:10 AM
Get the datafield name?? Husht ASP .Net 0 08-04-2004 03:04 PM
Get the datafield name?? Husht ASP .Net 1 08-04-2004 12:49 PM
get DataField value in UpdateCommand richard ASP .Net 0 12-02-2003 07:35 AM
show just the date in a datagrid column when the datafield is an datetime field Adil Bohoudi ASP .Net 1 08-06-2003 04:07 PM



Advertisments