Dynamic DataField

M

Msdn

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
 
R

Riki

Msdn said:
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.
 
M

Msdn

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

Regards Keld
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top