Link to home
Start Free TrialLog in
Avatar of udir
udir

asked on

DataGrid n CheckBoxList

Hi,
I built a dataGrid (auto generate) and add a column - TemplateColumn, and in it a CheckBoxList.
1) How can i make the Header of that column be like a linkLable/LinkButton (i did Allow Sorting=True, but nothing)
2) I need to click that LinkLable/LinkButton and turn all the CheckBoxes turn to "selected" and if click again, turn off.
Thanks
Avatar of renjurdevan
renjurdevan
Flag of India image

Set HeaderText property of templatcolumn accordingly

Regards
Renju
Avatar of udir
udir

ASKER

Hi,
pls, can u give an example... i wrote :
<Columns>
                <asp:TemplateColumn HeaderText="Ñ×è">
                <ItemTemplate>
                <asp:CheckBoxList runat="server"
                   RepeatDirection="Horizontal" ID="Selection">
                    <asp:ListItem Selected="False"></asp:ListItem>
                    </asp:CheckBoxList>
                </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>

where and what i need to add?
(and what about que 2?)
Thanks

ASKER CERTIFIED SOLUTION
Avatar of Gautham Janardhan
Gautham Janardhan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
and

      function CheckAll()
      {
            var data = document.getElementById("DataGrid1").all;
            for(var i=0;i<data.length;i++)
            {
                  if(data[i].id.indexOf("CheckBox1")>=0)
                  {
                        data[i].checked = true;
                  }
            }
            return false;
      }

to do check All
Avatar of udir

ASKER

Hi gauthampj,
Is there some option to add a LinkLable/LinkButton and not a button?