Hi I need a ultrawebgrid with column(0) as checkbox. When I check the header checkbox i have to check all the checkboxes in the column(0).
how to do this. early response would be greatly appreciated.
Thanks,
ATMY@chevron.com
I forgot to mention (I think) the declaration of the javascript variables:
var oGrid;var cbSelectAll
These are global variables.
Hi,
I am trying to make the script you provided work but need help with it. I included your script in the form header, I have to include the checkbox column as a template column at runtime, inside the header text for this column I insert
column.HeaderText = "<div><input type = 'checkbox' name = 'cbSelectAll' value = 'false' onclick='SelectAll(0);'><div>"
which inserts the checkbox in the column header but when I try to select it it gives me an error saying 'cbSelectAll.checked' is null or not an object. Can someone who has made this script work give me ideas? the only difference from your example is that I am creating the template column at runtime. Thanks in advance!!
Javascript is:
//variable used to retain a reference to the grid for when we need to check all the roads.var oGrid;var cbSelectAll;//Selects all checkboxes in the gridfunction SelectAll(colIndex){ var checked = cbSelectAll.checked; for (i = 0; i < oGrid.Rows.length; i++) { oGrid.Rows.getRow(i).getCell(colIndex).setValue(checked); }}//Intialization function which sets the grid referencefunction igrdInitializeLayout(object){ oGrid = igtbl_getGridById(object); //need to set it here due to Infragistic's handling of columns. cbSelectAll = document.getElementById("cbSelectAll");}
Band using this is (note usage of name of the checkbox in script above and templated column below):
<igtbl:UltraGridBand BaseTableName="myTable" Key="key" > <columns><igtbl:UltraGridColumn Hidden="True" Key="key" BaseColumnName="key"></igtbl:UltraGridColumn><igtbl:TemplatedColumn Key="someKey" Type="CheckBox" BaseColumnName="ColumnWhatever" AllowUpdate="Yes">
<HeaderTemplate> <input id="cbSelectAll" name="cbSelectAll" type="checkbox" onclick="BLOCKED SCRIPTSelectAll(1)" /> </HeaderTemplate></igtbl:TemplatedColumn>