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

Disable Select-All Tickbox in radGrid

1 Answer 459 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 22 Oct 2008, 10:44 AM
Hi there, I've enabled the tick-boxes to select a row in the grid view, I need multi-select to work (which it does), but I need to achieve the following:

1. To disable the select-all tick box in the header column to ensure each tick is manual
2. To prevent clicking a row ticking the tick box (the user must use the box).

The radGrid I'm currently using is thus:

<telerik:RadGrid ID="RadGrid1" AllowSorting="True" AllowPaging="True" PageSize="5" AllowMultiRowSelection="true" runat="server" GridLines="None" Width="75%" OnSortCommand="RadGrid1_SortCommand" OnPageIndexChanged="RadGrid1_PageIndexChanged" OnItemDataBound="RadGrid1_ItemDataBound">
    <MasterTableView>
        <Columns>
            <
telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" visible="false" />
        </Columns>
    </MasterTableView>
    <PagerStyle NextPageText="Next" PrevPageText="Prev" Mode="NextPrevAndNumeric"></PagerStyle>
    <ClientSettings>
        <Selecting AllowRowSelect="True"></Selecting>
    </ClientSettings>
</telerik:RadGrid>

 

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Oct 2008, 11:20 AM
Hello Michael,

To disable/hide the header CheckBox for the GridClientSelectColumn, you can try out the following code.
cs:
 protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridHeaderItem) 
        { 
            CheckBox chkbx = (CheckBox)(e.Item as GridHeaderItem)["SelectColumn"].Controls[0]; 
            //to disable the chekbox 
            chkbx.Enabled = false
            //or to hide the checkbox 
            chkbx.Visible = false
        } 
    } 

Go through the following code library submission link to allow only client side selection using checkboxes.
ClientSideSelectColumn - Disallow other selection

Thanks
Princy.
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or