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

Programatically sort RadGridView and grid data

10 Answers 310 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Yogesh
Top achievements
Rank 1
Yogesh asked on 01 Apr 2011, 12:17 PM
Hello There,
          I am working with RadControls for WinForms Q1 2010 from last 1 and half year.
         Now, My current requirement is that, I have remember the sorting of the single column of the grid and show it as same on next load time.
         I have able to remember the sorting settings of the particular grid column but I am unable to sort it programatically. I have tried to call events Grid_SortChanging and Grid_SortChanged by passing them the required information like following :

 
GridSortField field = new GridSortField(_sortableColumn.ColumnHeading, RadSortOrder.Ascending);<br>                    ArrayList list = new ArrayList();<br>                    ArrayList emptyList = new ArrayList();<br>                    list.Add(field);<br>                    GridViewCollectionChangingEventArgs e = new GridViewCollectionChangingEventArgs(this.MasterGridViewTemplate, Telerik.WinControls.Data.NotifyCollectionChangedAction.Add, list, emptyList, 0, -1, String.Empty);<br>                    this.Grid_SortChanging(this, e);<br><br><br><br>void Grid_SortChanged(object sender, GridViewCollectionChangedEventArgs e)<br>        {<br>        }<br><br>        void Grid_SortChanging(object sender, GridViewCollectionChangingEventArgs e)<br>        {<br>            this.Grid_SortChanged(sender,new GridViewCollectionChangedEventArgs(e.GridViewTemplate,e.Action,e.NewItems,e.OldItems,e.NewStartingIndex,String.Empty));<br>        }


and when I debug the code I found that When I programmatically sort the grid It able to pass the parameters to Grid_SortChanging which gets called but after that the event Grid_SortChanged doesn't gets called.
 Can anyone please suggest me where I am getting it wrong. Any code may also be appreciated.

Thanks in advanced.


Regards,
Yogesh



10 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 01 Apr 2011, 01:31 PM
Hello,

In order to sort the RadGridView programatically you need to add SortDescriptors. Please have a look at this help topic which will guide you through the process.

Hope that helps
Richard
0
Yogesh
Top achievements
Rank 1
answered on 01 Apr 2011, 01:48 PM
Hello Richard,
         Thanks for your immediate reply. The version is having release date 03/08/2010. Do you think that these SortDescriptors is available in the version I am using ??
              If yes then Where could I possibly find the Telerik.Windows.Data.dll for my project reference also my radGridView does not have the SortDescriptors Property. Can you please suggest me now then.
               If it's not available in the version I am using then Please suggest any way with the my current version or do I really need to upgrade my version Please suggest.
        Thanks in advanced.


Regards,
Yogesh
0
Richard Slade
Top achievements
Rank 2
answered on 01 Apr 2011, 01:56 PM
Hi,

Most of the assemblies for WinFOrms are named Telerik.WinControls.Something
If you let me know what you are trying to do, I'll do my best to help
Richard
0
Yogesh
Top achievements
Rank 1
answered on 01 Apr 2011, 02:20 PM
Hello,
  I want my grid to be having a sorting on the load time itself.  My version release date is 03/08/2010.
  I followed up the code prescribed by the link you shared for me But, when I am trying using the SortDescriptor then my gridview object is not having the property like SortDescriptors and so I think that my version doesn't have this feature yet.
  So, Can you please suggest me something which will help me without upgrading my current telerik version. I want my grid to be having a sorting order on the first time load it self which will be same as when the grid was disposed (means the application closing time).
 Thanks in advanced.

Regards,
Yogesh
0
Richard Slade
Top achievements
Rank 2
answered on 01 Apr 2011, 04:22 PM
Hello,

I don't have the older version of the controls to check this for you, but could you tell me the actual version number that you are using?
Thanks
Richard
0
Yogesh
Top achievements
Rank 1
answered on 05 Apr 2011, 06:15 AM
Hi Richard,
     The version I am using is 9.2.1. can you please let me know how the task I updated on this thread can be achieved in this version
(9.2.1) and if the your answer is yes then how. Please suggest me.


Thanks,
Yogesh
0
Richard Slade
Top achievements
Rank 2
answered on 05 Apr 2011, 01:42 PM
Hello,

I'm afriad I don't have this older vdrsion to be able to try this for you. It all changed in Q2 2010. I'd suggest upgrading your Telerik controls to the latest version as there are many enhancements, fixes, improvements and new controls that you will find useful. In addition, Telerik don't supoort versions that are older than a year old as far as I'm aware.

Hope that helps
Richard
0
Yogesh
Top achievements
Rank 1
answered on 05 Apr 2011, 01:51 PM
Hello Richard,
        Thanks for your reply. but I think it will very much critical for me to upgrade my Telerik version at this stage of product I am developing.
       Also, I am shocked to hear that You don't support for the product you sold just an year ago. Can you please provide me the support team contact medium so that I could reach them and get patch or so that could troubleshoot the problem for me.


Regards,
Yogesh
0
Richard Slade
Top achievements
Rank 2
answered on 05 Apr 2011, 03:45 PM
Hello Yogesh,

If you go to your account on the website then you may be able to open a support ticket which I would advise. You may attach any projects there that you need help with
Regards,
Richard
0
Svett
Telerik team
answered on 07 Apr 2011, 10:32 AM
Hi Yogesh,

I would second what Richard said. Generally, it will be best if you update your application to the latest Telerik version as it contains many improvements and fixes. In addition, we do not tend to support versions older than an year, because most of the issues that you experience in these versions have already been addressed in the latest versions and depending on the nature of the issues, some of them can't be worked around.

What is more important, however, we do not have a version with number 9.2.1. Could you please re-check the version number of the assemblies that you are using? In addition, despite the fact that you have been using our controls for more than an year, your account shows no purchases it seems that you have not downloaded the WinForms suite from our site:
- In case you have downloaded it from another site, please let us know so that we can update your account and provide you with proper support services;
- In case you have obtained a copy of our controls through the company you work for, please ask the purchase holder to add you as a License Developer to the purchase.

After we confirm your license status, we will look into your issue.

All the best,

Svett
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
GridView
Asked by
Yogesh
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Yogesh
Top achievements
Rank 1
Svett
Telerik team
Share this question
or