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

How to trigger "Refresh" programmatically?

7 Answers 232 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 15 Jul 2014, 09:05 PM
Dear All,

Is that a possible way that I can pull the exact function of the "Refresh" as shown in the attachment?

Thank you and Regards.
Attila Antal
Telerik team
commented on 27 Apr 2021, 02:26 PM

Hi Tim,

The refresh button of the PivotGrid is actually calling the rebind() method. You could do that too either on the client-side by using the rebind() method (see RadPivotGrid Client-Side Methods) or you could call the Rebind() method on the server-side (see RadPivotGrid Server-Side Methods).

7 Answers, 1 is accepted

Sort by
0
Tim
Top achievements
Rank 1
answered on 16 Jul 2014, 02:56 PM
Anyone can give a hand? I'm asking the question because I was following this telerik demonstration to build a drill down pivotgrid. However it stops working when I switch the fields until I need to press the "Refresh" manually. I've tried using Rebind(), but that doesn't do the trick.
0
Tim
Top achievements
Rank 1
answered on 18 Jul 2014, 11:20 AM
I don't think it'll be that difficult but I've not clue where to start, any suggestions to this work around?
0
Viktor Tachev
Telerik team
answered on 18 Jul 2014, 11:44 AM
Hi Tim,

The issue you describe seems rather strange. You could try couple of things that could help point us in the right direction.

Would you check the browser console and ensure that there are no JavaScript errors on the page? Would you also try disabling Ajax on the page and let me know if the behavior changes?


Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Tim
Top achievements
Rank 1
answered on 18 Jul 2014, 12:32 PM
Hi Viktor, 

Thanks for the reply, it's not actually an error, but more of incompatibility between the drill down functionality and my project. Sorry for overly simplifying the question.

As we know the key principal of the drill down functionality is to allow the users to read what filters the cell is under when user clicks: for instance from the demo, wheres give the filter and their corresponding values.

Extracted codes from demo:
string[] groups = e.CommandArgument.ToString().Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                StringBuilder wheres = new StringBuilder();

                if (groups.Count() > 0)
                {
                    string[] elements = groups[0].Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                    foreach (var element in elements)
                    {
                        var pairs = element.Split(new char[] { '~' }, StringSplitOptions.RemoveEmptyEntries);
                        wheres.Append(string.Format("{0} = '{1}' AND ", pairs[0], pairs[1]));
                    }

The problem occurs when I change my filters, the e.CommandArgument will continue to read the old filter value, and this can only be corrected by clicking the "Refresh" button manually. That's why giving the question as described.

Thanks.
0
Viktor Tachev
Telerik team
answered on 23 Jul 2014, 08:23 AM
Hi Tim,

I am afraid that without debugging the code it would be hard to determine what is causing the old filter values to be applied.

Would you build a runnable project where the issue is replicated and send it to us in a support ticket? This would allow us to thoroughly investigate the issue and look for its cause.


Regards,
Viktor Tachev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Tim
Top achievements
Rank 1
answered on 25 Jul 2014, 12:07 PM
Hi Viktor, I'll gladly do. Thanks!
0
Prof. Francisco Araújo
Top achievements
Rank 2
Iron
answered on 22 Apr 2021, 07:17 PM
Any solution?...
Attila Antal
Telerik team
commented on 27 Apr 2021, 02:31 PM

Hi Francisco,

We have not heard from Tim about his request and therefore we do not know what can be the cause. In order to investigate an issue, we need more details that will help us replicate the problem. 

Please share a runnable sample we could use, or post the current configuration of the PivotGrid, describe the problem, and share any error logs, screenshots that could be helpful.

Once we have enough information to replicate the scenario, we will be able to identify the issue and give you further instructions.

Tags
PivotGrid
Asked by
Tim
Top achievements
Rank 1
Answers by
Tim
Top achievements
Rank 1
Viktor Tachev
Telerik team
Prof. Francisco Araújo
Top achievements
Rank 2
Iron
Share this question
or