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

RadGrid with GridClientSelectColumn

1 Answer 46 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Amitkumar
Top achievements
Rank 1
Amitkumar asked on 01 Dec 2009, 04:23 AM
Hell Friends,

I am usig RadGrid with GridClientSelectColumn mention below:
<telerik:GridClientSelectColumn UniqueName="SelectColumn" />

when loading a page that time i would like to select all row with that column checkbox should be checked, and i am using following code, but it will not work, what was the wrong with that code in ItemCreated event, reply me.

if (e.Item.ItemType == GridItemType.Item)
            {
                GridDataItem item = (GridDataItem)e.Item;
                CheckBox checkBox = (CheckBox)item["SelectColumn"].Controls[0];
                
                checkBox.Checked = true;
            }

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 01 Dec 2009, 05:58 AM
Hello Amit,

You can try out the following code instead to set the GridClientSelectColumn checkboxes checked:
c#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            item.Selected = true
        } 
    }  

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