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

[Solved] How to set a default value to a GridCheckBoxColumn?

1 Answer 440 Views
Grid
This is a migrated thread and some comments may be shown as answers.
anonym
Top achievements
Rank 1
anonym asked on 13 May 2009, 07:20 AM
Hello i want to give the CheckBoxColumn a default value = true, how to set this value??

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 13 May 2009, 07:30 AM
Hi,

You can set a default value for your checkbox column using the code below:
aspx:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            ((CheckBox)item["CheckBoxColumnUniqueName"].Controls[0]).Checked = true
          
        } 
    } 

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