This is a migrated thread and some comments may be shown as answers.

How to set checkbox columns in radgrid Telerik to enable drag multicheckboxselect

1 Answer 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vishal
Top achievements
Rank 1
Vishal asked on 30 Aug 2012, 05:58 AM

In my telerik radgrid i have 2 checkbox columns named "Approved" and "Denied". How do i 'check' multiple checkboxes in each column by draging over the checkboxes? Please note I DO NOT want to select multiple entire rows but just multiple checkboxes in these respective columns by just dragging. Here is the aspx:

 <telerik:GridTemplateColumn UniqueName="checkBoxYesColumn">
                           
<HeaderStyle HorizontalAlign="Center"   />
                           
<HeaderTemplate>
                                 
<asp:CheckBox  ID="cbYesHead2" runat="server" />
                               
<cc1:MutuallyExclusiveCheckBoxExtender ID="mecbeYesHead" runat="server" TargetControlID="cbYesHead2"  />
                           
</HeaderTemplate>
                             
<ItemStyle ... HorizontalAlign="Center"   />
                           
<ItemTemplate>
                                 
<asp:CheckBox ID="cbYes2" runat="server"  />
                                   
<cc1:MutuallyExclusiveCheckBoxExtender ID="mecbe1" runat="server" TargetControlID="cbYes2"  />
                             
</ItemTemplate>
                       
</telerik:GridTemplateColumn>                          
                       
<telerik:GridTemplateColumn HeaderText="" UniqueName="ignoreCheckBoxYesColumn">
                             
<HeaderStyle HorizontalAlign="Center"  />

                             
<ItemStyle  HorizontalAlign="Center"   />
                             
<ItemTemplate>    
                                 
<asp:CheckBox  ID="cbNo2" runat="server"  />
                                   
<cc1:MutuallyExclusiveCheckBoxExtender ID="mecbe2" runat="server" TargetControlID="cbNo2" />
                             
</ItemTemplate>
                       
</telerik:GridTemplateColumn>  

Here is the code behind in C#:

CheckBox cb = (CheckBox)headerItem.FindControl("cbYesHead2");

                cb
.Attributes.Add(...);
               
AjaxControlToolkit.MutuallyExclusiveCheckBoxExtender mecbeYes = (AjaxControlToolkit.MutuallyExclusiveCheckBoxExtender)headerItem.FindControl("mecbeYesHead2");
                mecbeYes
.Key = "head_" +...

cb
= (CheckBox)headerItem.FindControl("cbNo2");
                cb
.Attributes.Add(...);
               
AjaxControlToolkit.MutuallyExclusiveCheckBoxExtender mecbeNo = (AjaxControlToolkit.MutuallyExclusiveCheckBoxExtender)headerItem.FindControl("mecbe2");
                mecbeNo
.Key = "head_" + ...

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 04 Sep 2012, 04:53 AM
Hi Vishal,

We do not have a sample of such scenario, but you could try using the cell selection in RadGrid:
http://demos.telerik.com/aspnet-ajax/grid/examples/client/cellselection/defaultcs.aspx

You could use the client events related to selection in order to implement your logic which will check/uncheck the checkboxes:
OnCellSelecting
OnCellSelected
OnCellDeselecting
OnCellDeselected

Greetings,
Tsvetina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Vishal
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or