Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
185
Insert Check All/Unselect All Checkbox in template column header
posted

Hi,

   I have created a column at runtime that I need to be able to modify and add a checkbox in the header. This checkbox should enable the user to select all / unselect all items in the ultrawebgrid. If anyone knows please tell me how I can add this checkbox to the header at runtime and make this happen. I tried doing

Dim CheckAll As New CheckBox

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

but this did not work. I have to create this at Runtime since the column is also created in Runtime, all examples I found so far show how to do this in design. Any help is greatly appreciated

Parents
No Data
Reply
  • 2636
    posted

    its better to do this in the grid_init event and dont use a dim checkall as new checkbox but rather set the text to something
    like <div><input type='checkbox' name='checkall' value='false' onclick='CheckAllRows();'></div> then just write a JS functions
    called CheckAllRows() and grab a handle to the grid and loop through the rows and check the boxes.

     

Children