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

How to focus the fisrt cell as add a new row

1 Answer 64 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Charles
Top achievements
Rank 1
Charles asked on 28 Jun 2011, 03:58 AM
I want remove the default text "Click here...".
And,I want to focus the fisrt cell as add a new row.
Please provide the alternative solution to achieve this functionality.

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 28 Jun 2011, 04:10 PM
Hi Bang,

You can remove the string in question by introducing a custom localization provider to your RadGridViews. Just return an empty string where a 'click here to add new row' is returned. For additional information about localization providers, please refer to the following documentation article: Localization.

As to your second requirement, you can use the UserRowAdded event which is fired after the new row is committed. In the event handler of this event set the first column to be current:
void radGridView1_UserAddedRow(object sender, GridViewRowEventArgs e)
{
    foreach (GridViewColumn column in this.radGridView1.MasterTemplate.Columns)
    {
        if (column.IsVisible)
        {
            this.radGridView1.CurrentColumn = column;
            break;
        }
    }
}

However, at this time it is not possible to set the current row after a row has been added. We will consider introducing such possibility in one of our next versions.

If you have additional questions, feel free to write back.

Kind regards,
Nikolay
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
Tags
GridView
Asked by
Charles
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or