RadGridView - Sorting/Filtering/Grouping while using VirtualMode

1 Answer 63 Views
Form GridView
João
Top achievements
Rank 1
Iron
Iron
Iron
João asked on 11 Nov 2024, 12:38 PM

Hello!

I was trying to use Sorting/Filtering/Grouping while using VirtualMode by using the default properties and methods and wasn't able to. I found this that said "In the future editions of RadGridView, we have planned to implement virtual grouping operations with a simpler and more useful API." in the year 2009. Have there been any changes? Can i use the functionalities that i want while using VirtualMode without having to override and subscribe several events to workaround this problem?

 

JP

1 Answer, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 14 Nov 2024, 08:31 AM

Hello, João,

Currently, when RadGridView is in VirtualMode, it does not support sorting, filtering, grouping, paging. This is also stated in our documentation in the green note here: Virtual Mode - RadGridView - Telerik UI for WinForms

The virtual mode provides quite different approach when loading data and it requires different implementation. We have another control - RadVirtualGrid which uses similar approach and I would recomend you to use RadVirtualGrid over RadGridView if you prefer working in virtual mode. Here you can find our documentation: VirtualGrid - RadVirtualGrid - Telerik UI for WinForms

I would like to note that RadVirtualGrid does support:

- Filtering: Filtering Overview - RadVirtualGrid - Telerik UI for WinForms

- SortingSorting Overview - RadVirtualGrid - Telerik UI for WinForms

Grouping is currently not available out of the box. We have already logged it as a feature request on our feedback portal. Here is the feedback item: ADD. RadVirtualGrid - add grouping support

You can cast your vore for the item to increase its priority, add your comments to it, and subscribe for status updates.

I hope this information is useful. If you have other questions, please let me know. 

Regards,
Nadya | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

João
Top achievements
Rank 1
Iron
Iron
Iron
commented on 20 Nov 2024, 05:01 PM

HI Nadya!

Sorry for the late response.

I tried to use the RadGridView without the grouping and I had problems with some blinking. However, I used the same logic I had originally with the RadVirtualGrid and the blinking was nowhere to be found, which is perfect.
However, when I tried to apply the filters and sorting, I came across something that I assume it's very simple to achieve but I don't seem to able to. I searched some forums and documentation with no avail as well. Can you tell me how I can iterate the columns of a RadVirtualGrid? I need to be able to isolate specific columns so I know which exact column has the sort/filter applied to (I don't have any problem doing this in the RadGridView). I know you can get the PropertyName from the events, but if I have a column with the same "HeaderText" (which I will) then I won't know exacly which column was being "used".


JP
Nadya | Tech Support Engineer
Telerik team
commented on 22 Nov 2024, 12:14 PM

Hello, João,

In RadVirtualGrid you can not itterate columns as you can in RadGridView, because RadVirtualGrid does not have columns collection as the other grid. In RadVirtualGrid you should work with ColumnIndex since the data loading mechanism relies on column count and row count. If I understand you correctly, you need to know which which exact column has the sort/filter applied. What I can sugges is to handle the CellEditorInitialized event and get the e.ColumnIndex. Thus, you will know the exact column index of edited column even if you have columns with the same names:

private void RadVirtualGrid1_CellEditorInitialized(object sender, VirtualGridCellEditorInitializedEventArgs e)
{
    var virtualGridFilterRowElement = this.radVirtualGrid1.TableElement.ViewElement.TopPinnedRows.Children[2];    
    if (virtualGridFilterRowElement != null)
    {
        int filteredColumnIndex = e.ColumnIndex;
    }
}

Can you please give this suggestion a try and let me know how it works for you. If this is not exactly what you are looking for, please share more details about your case. 

I am looking forward to your reply.

João
Top achievements
Rank 1
Iron
Iron
Iron
commented on 25 Nov 2024, 01:22 PM

hey Nadya.

I tried this and it didn't help. Doesn't help in the situation i have. I managed to go back to the "radgridview" and fixing some problems by updating the DLL and adjusting my code making it work. I have a new problem tho. How can i update the rowcount? I have around 500k records and it takes time to get that number to define in the 'rowcount' property. Is there a way i can define 100 rows and then gradually raise the row amount while the user scrolls down or up?

Nadya | Tech Support Engineer
Telerik team
commented on 28 Nov 2024, 11:08 AM

Hello, João,

When the grid is in virtual mode, essentially the control remains in unbound mode and while scrolling up and down it fires the CellValueNeeded event giving you an index so that you can connect to your data source and/or server and fetch the records to display in the grid. The CellValueNeeded event will be fired only when a cell is about to become visible so that you can request data and display it in the control. This will allow you to request data in the form of chunks just as in your requirement.

Please note that it is important to know the boundaries of your data beforehand so that you need to specify the RowCount and as well as ColumnCount properties initially. You can not change those rows count while scrolling up and down. 

I hope this information is useful.

João
Top achievements
Rank 1
Iron
Iron
Iron
commented on 28 Nov 2024, 02:58 PM

Thank you for the answer. I'll have to adjust my code to make it work.

Out of curiosity, do you guys share your source code? That way i could create custom DLL's that would satisfy my needs...

Nadya | Tech Support Engineer
Telerik team
commented on 29 Nov 2024, 02:30 PM

Hello, João,

Yes, our source code is available for downloading from licensed users only. I have checked your account and it seems that you do not have a valid license on this account. You can take a look at our purchasing plans: Purchase Telerik Software Development Tools

When you purchase a Telerik UI for WinForms license, you should be able to download the whole Telerik UI for WinForms source code from your Telerik account and run it locally. Here is how you can download product files: Download Product Files - Telerik UI for WinForms

I hope this informaion is useful. If you have any other questions please let me know.

Tags
Form GridView
Asked by
João
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
Share this question
or