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

Grid, Default values for NewRow

1 Answer 301 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Lee
Top achievements
Rank 1
Lee asked on 14 Mar 2010, 06:55 PM
I have a Grid with is binded to a Typed Emp DataSet.
Emp table has a couple of columns of type bit. 
Grid automatically takes it as checkbox type of column.
When I click on AddNewRow area, it displays checkbox as UNchecked.
What i want to do is it should display checkbox as Checked. 

How to do this?

Regards
Lee

1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 17 Mar 2010, 06:09 PM
Hi Lee,

Thank you for the question.

You can use DefaultValuesNeeded event to specify any default values when adding new row. Please, consider the following code:
void radGridView1_DefaultValuesNeeded(object sender, GridViewRowEventArgs e)
{
    if (this.radGridView1.CurrentRow is GridViewNewRowInfo)
    {
        e.Row.Cells["Bool"].Value = true;
    }
}

Let me know if you have any other questions.

Sincerely yours,
Martin Vasilev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Lee
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or