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

[Solved] Identfy request from Refresh button

1 Answer 93 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sabyasachi Dechaudhari
Top achievements
Rank 1
Sabyasachi Dechaudhari asked on 05 Mar 2010, 12:27 PM
Hi,
   There are cases when the grid is sorted. In that request, i dont want to go to the database.
   How ever, when the refresh button is pressed or the grid is loaded for the first time, I want to go to the database.

   How can i identify the difference between these 2 requests.

Currently the signature of the function is

public

 

static List<Employee> getAllEmployee(string sortExpression)
{..}
comming from object datasource mapped to the grid

 

<asp:ObjectDataSource ID="dsEmployee" runat="server" SelectMethod="getAllEmployee" 
        TypeName="Employee" DataObjectTypeName="Employee" 
        SortParameterName="sortExpression"></asp:ObjectDataSource> 

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 05 Mar 2010, 05:26 PM
Hello Sabyasachi,

You can try to handle the ItemCommand event as demonstrated below:
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
{
    if (e.CommandName == "RebindGrid")
    {
        ....
    }
    if (e.CommandName == "Sort")
    {
        ....
    }
}

Regards,
Daniel
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
Grid
Asked by
Sabyasachi Dechaudhari
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or