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

How to find out if "Refresh" button was clicked

1 Answer 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JP
Top achievements
Rank 1
JP asked on 14 May 2012, 08:42 AM
Hi,

the data bound to the grid is stored in the session and bound to the grid in the DataBound event. 
Now I want to reload the data from the database only when the user clicks the "Refresh" button. In all other cases, the data is taken from the session.
I thought I could use the 
e.RebindReason == GridRebindReason.ExplicitRebind
but this is also the case when e.g. the columns are reordered.

Whats the check for the Refresh button?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 14 May 2012, 09:04 AM
Hello,

Try the following in ItemCommand event.
C#:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
 if (e.CommandName == RadGrid.RebindGridCommandName)
 {//your code
 }
}

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