Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Dynamic GridView with Dynamic Column

Reply
Thread Tools

Dynamic GridView with Dynamic Column

 
 
bsm
Guest
Posts: n/a
 
      05-15-2007
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!!!

 
Reply With Quote
 
 
 
 
Riki
Guest
Posts: n/a
 
      05-15-2007

"bsm" <> wrote in message
news: oups.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


 
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
Pump data by row and column to dynamic created column in gridview johnsonlim026 ASP .Net 0 02-27-2010 05:29 PM
gridview column values to another page via gridview hyperlink column Keith G Hicks ASP .Net 3 02-18-2008 06:17 AM
1 Gridview. Dropdown A is column from database, Dropdown B is column from database, Data in A and B must be from same row. anonymoushamster@gmail.com ASP .Net 2 11-07-2007 12:40 PM
GridView - Setting the text of the 'select' column to the value of another column Greg Smith ASP .Net 0 04-12-2007 03:11 PM
How to hide a GridView column when the column's Visible property does not support databinding? Keithb ASP .Net 2 10-27-2006 05:02 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57