Geeks With Blogs

News My Blog has been MOVED to https://mfreidge.wordpress.com
Michael Freidgeim's OLD Blog My Blog has been MOVED to https://mfreidge.wordpress.com
I found a few articles , that try to create multi-row gridview Header
 
All solutions suggest to create extra DataViewRow(s) of a type DataControlRowType.Header on RowDataBound event.
However on Postback DataBind usually is not called, and so RowDataBound event will not occur.
It means that the second header will not be recreated on Postback -not good.
 
Discussion GridView - trouble with double header row has a suggestion to use rowcreated event  that should be called during initial DataBind and during subsequent postback.
 
Using RowCreated event to create additional rows in header works perfectly for me.
 
Note that RowCreated event is called within parent LoadViewState event, but before LoadViewState for individual row.
So not all info could be available at that time.

Alternatively it can be tried on page_load time on PostBack when state has been loaded already as suggested in Access Dynamic GridView ItemTemplate after postback discussion.
I strongly recommend to read a great atricle: TRULY Understanding Dynamic Controls  -Parts 1-4 and avoid using dynamic controls if possible.
Posted on Wednesday, March 5, 2008 11:50 PM ASP.NET | Back to top


Comments on this post: Create multi-row gridview Header with buttons in header

# re: Create multi-row gridview Header with buttons in header
Requesting Gravatar...
Estimado,
Me podrías explicar con mas detalle como lo haces para agregar la fila adicional en la cabecera.
Gracias
Left by Alejandro on Nov 16, 2010 8:08 AM

# re: Create multi-row gridview Header with buttons in header
Requesting Gravatar...
Estimated
I could explain in more detail as you do to add the extra row in the header.
Thanks
Left by Alejandro on Nov 16, 2010 8:42 AM

# re: Create multi-row gridview Header with buttons in header
Requesting Gravatar...
its urgent
Left by san on Feb 20, 2012 1:35 AM

Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net