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

Ignore SelectionChanged event when rowloaded?

2 Answers 58 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chet Watkins
Top achievements
Rank 1
Chet Watkins asked on 29 Jul 2010, 04:59 PM
Is there anyway to ignore the SelectionChanged event from the GridViewSelectColumn when the grid is loading?
 
When the grid is loading, I make the row selected during the rowloaded event based on a value in the row (to indicate something was "selected" in past use of the grid). I then want to have code in the selectionChanged method that kicks off based on what happens to these rows after the grid is loaded from the user interaction, but i can't seem to figure out how isolate the code to run only during this time and not every time it is selected in the rowloaded event.

Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Milan
Telerik team
answered on 29 Jul 2010, 05:23 PM
Hi Chet Watkins,

You can introduce a flag that will signal if a row is being initialized and based on this flag you can ignore SelectionChanged:

void gridView_SelectionChanged(object sender, SelectionChangeEventArgs e)
{
    if (loadingRow)
        return;
}
  
private bool loadingRow;
  
void gridView_RowLoaded(object sender, RowLoadedEventArgs e)
{
    loadingRow = true;
  
    // initialize row properties
  
    loadingRow = false;
}

Greetings,
Milan
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
Chet Watkins
Top achievements
Rank 1
answered on 29 Jul 2010, 05:28 PM
Hah. That was too easy. I was digging through the properties of the grid and current row. Guess I needed to step back and take a broader approach. =p

Thanks for the quick response.
Tags
GridView
Asked by
Chet Watkins
Top achievements
Rank 1
Answers by
Milan
Telerik team
Chet Watkins
Top achievements
Rank 1
Share this question
or