Dynamic GridView with Dynamic Column

B

bsm

Hi,
I want to create Gridview dnymically. Because I need to achieve the
following task on it.

1. The Data source may contain different columns based on the user
selection.
2. I want to find DateTime column and format the same as I like. (MMM
dd-yyyy).
3. I don't want to use RowDataBound event. Because GridView may have 1
lakh record. So if we use RowDataBound, it will execute for each and
every rows.

For the above I tried to create Dynamic GridView, but When user clicks
hyperlink column, GridView disappeared,

Any idea to solve this.

Thanks in Advance!!!
 
R

Riki

bsm said:
Hi,
I want to create Gridview dnymically. Because I need to achieve the
following task on it.

1. The Data source may contain different columns based on the user
selection.
2. I want to find DateTime column and format the same as I like. (MMM
dd-yyyy).
3. I don't want to use RowDataBound event. Because GridView may have 1
lakh record. So if we use RowDataBound, it will execute for each and
every rows.

For the above I tried to create Dynamic GridView, but When user clicks
hyperlink column, GridView disappeared,

I suggest still going for the GridView itself.
1) use autogeneratefields=true
2) handle the OnCreateAutoGeneratedColumn event and modify your column there
3) RowDataBound is executed for every row anyway (internally), there's no
big penalty for handling it. But with method 2) you can avoid it.

Riki
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top