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

IsInEditMode

4 Answers 193 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rieni De Rijke
Top achievements
Rank 1
Rieni De Rijke asked on 15 Sep 2010, 12:27 PM
I want to find out if one of the cells/rows in my GridView is in EditMode.

I tried this, but it didn't work:

        private bool GridInEditModus()
        {
            foreach (var row in myGrid.Items)
            {
                if (((GridViewRow)row).IsInEditMode)
                {
                    return true;
                }
            }
            return false;
        }
Unable to cast object of type 'Cars.Infrastructure.Car' to type 'Telerik.Windows.Controls.GridView.GridViewRow'.

Is there a simple way to find out if my grid is in editmode?

4 Answers, 1 is accepted

Sort by
0
Yavor Georgiev
Telerik team
answered on 15 Sep 2010, 12:28 PM
Hi Rieni De Rijke,

 You are probably looking for the IsInEditMode property of RadGridView.

Greetings,
Yavor Georgiev
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
0
Rieni De Rijke
Top achievements
Rank 1
answered on 15 Sep 2010, 12:32 PM
<<You are probably looking for the IsInEditMode property of RadGridView.>>

Hmm... my RadGridView does not have such a property.
0
Yavor Georgiev
Telerik team
answered on 15 Sep 2010, 12:39 PM
Hello Rieni De Rijke,

 Please accept my apologies, I mixed up the control versions. What you can do is:

private bool isGridInEditMode = false;
 
private void grid_BeginningEdit(object sender, GridViewBeginningEditRoutedEventArgs e)
{
    this.isGridInEditMode = true;
}
 
private void grid_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
{
    this.isGridInEditMode = false;
}

and then check the value of the isGridInEditMode flag.

Sincerely yours,
Yavor Georgiev
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
0
Rieni De Rijke
Top achievements
Rank 1
answered on 15 Sep 2010, 12:45 PM
Yes, I know that one can use grid_BeginningEdit and grid_EndEdit.

But I thought that there maybe was a simple way to check if the grid is in EditMode without using a bool or 
Beginning/End Edit.




Tags
GridView
Asked by
Rieni De Rijke
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Rieni De Rijke
Top achievements
Rank 1
Share this question
or