[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.buildingcontrols

Dynamic GridView with Dynamic Column

bsm

5/15/2007 6:23:00 AM

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!!!

1 Answer

Riki

5/15/2007 1:57:00 PM

0


"bsm" <senthilmuruganb@saksoft.co.in> wrote in message
news:1179210154.294849.226680@p77g2000hsh.googlegroups.com...
> 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