1

在我的 Telerik radgrid 中,我有 2 个复选框列,名为“已批准”和“已拒绝”。如何通过拖动复选框来“检查”每列中的多个复选框?请注意,我不想通过拖动来选择多个整行,而只是选择这些相应列中的多个复选框。这是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 class="enforceAll" 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>  

下面是 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_" + ...
4

0 回答 0