Skip to content

Replies

0
Groove
Groove answered on Jan 9, 2008 10:09 PM

Hi Hs2,

    I was able to figure out how to store the values of the checkboxes but it was kinda tricky. Since I had multiple pages in the gridview and would lose the selected options when I went to the next page because of post back I ended up storing the values (any unique item in the row) in an Arraylist. Then I put this arraylist into the view state and retrieved it when the page reloaded with the next results. I did this in the datagrid_pageindexchanged Event.  

now Im stuck on trying to edit the column header so I can put a check all checkbox in the Column header. I tried doing:

col.HeaderItem.TemplateControl.Controls.Add(CheckAll)

but this did not work. I need to be able to do this at Runtime and need a way to select/unselect all rows.

0
Groove
Groove answered on Jan 8, 2008 4:20 PM

 

 Thanks so much HS2, That worked! 🙂 I wasted so much time yest on this. For anyone else reading this you can enable the webgrid to be updatable if you have a similar problem by changing the AllowUpdate to yes

datagrid.DisplayLayout.AllowUpdateDefault = AllowUpdate.Yes 

Now I just have to figure out how to store the checked boxes since they lose their value when you go to another page on the grid.