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

Force a re-display of the grid/list view

6 Answers 341 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 16 Mar 2012, 03:29 AM
I have a grid and a list view that I need to render with slightly different data based upon buttons a user will press.  The Bound data is not changing, just how I display it.  What I really need is to force the grid to fire off its Cell Formatting or Row Formatting events.  I'm hacking it right now by:

            radGridView1.EnableSorting = false;
            radGridView1.EnableSorting = true;

Which is doing what I want.  Is there a better way?

6 Answers, 1 is accepted

Sort by
0
Accepted
Dan
Top achievements
Rank 1
answered on 18 Mar 2012, 01:21 AM
Stumbled upon the solution.  Depending upon what I'm doing I will use one of the following:

radGridView1.TableElement.Update(GridUINotifyAction.ResetView);

or

radGridView1.TableElement.Update(GridUINotifyAction.Reset);
0
Stefan
Telerik team
answered on 19 Mar 2012, 04:44 PM
Hi Dan,

Indeed, the Update method of the TableElement is the correct way to reset your UI.

Let me know if you have any other questions.

All the best,
Stefan
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
0
William
Top achievements
Rank 1
answered on 09 Jan 2017, 05:19 PM
If this is the way to re-display a radgridview, why is this NOT AVAILABLE as a choice in the latest version? There is NO "Update" capability for any element in the radgridview.
0
Hristo
Telerik team
answered on 10 Jan 2017, 11:13 AM
Hi William,

Thank you for writing.

The Update method is available and it can be called this way: 
this.radGridView1.TableElement.Update(GridUINotifyAction.ResetView);

Please note that this forum thread discusses RadGridView for WinForms, in case you are using a different product please post your question in the relevant forums.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Greg
Top achievements
Rank 1
answered on 13 Mar 2017, 06:23 PM

Using (GridView).TableElement.Update(GridUINotifyAction.Reset) in the SelectionChanged event handler works well to unselect rows, but it forces the grid to return to the first row. Is there a way to prevent this behavior?

 

I tried using (GridView).TableElement.Update(GridUINotifyAction.ResetView), but it had no effect.

 

Thanks,

Greg

 

 

0
Hristo
Telerik team
answered on 14 Mar 2017, 01:35 PM
Hi Greg,

Thank you for writing.

If you would like to clear the selection in RadGridView you can call its ClearSelection method. If you are losing the current row at some point I can suggest to cache it and then set it programmatically:
I hope this helps. Should you have further questions please do not hesitate to write back.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Dan
Top achievements
Rank 1
Answers by
Dan
Top achievements
Rank 1
Stefan
Telerik team
William
Top achievements
Rank 1
Hristo
Telerik team
Greg
Top achievements
Rank 1
Share this question
or