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

Virtual Grid Populating Custom Columns, Custom Filter

1 Answer 284 Views
VirtualGrid
This is a migrated thread and some comments may be shown as answers.
Kashif
Top achievements
Rank 1
Kashif asked on 09 Sep 2019, 09:59 PM

Dear Admins.

I was Using the following code for populating radGridView. But it was little bit slower (items Count was more then 40,000)

BindingSource source = new BindingSource
{
    //GetItemTable Return the DataTable
    DataSource = _ItemRepository.GetItemTable()
};
radGridView1.MasterTemplate.DataSource = source;

 

Then i give a try to use VirtualGrid (By using the Example given in the Documentation), to check the performance difference.it is good.

I have some question regarding presentation/ populating of VirtualGrid.

The ItemClass is used to populate the VirtualGrid have 15 columns(Attributes),

  1. I want to load only some of them, Locating at different Column Numbers not in Sequence. Like i have Column Number from 1...15, I want to display only 1,3,6,10th Column Numbers(Index Numbers).
  2. How to Hide any Column which is already populated in the Grid.
  3. I want to make custom filter functionality. I Have a Text Box above the VirtualGrid. I want to use that TextBox to apply the Filter on the Grid by Typing the Item Name, and Grid filter the Number of items according the typed text and display in the grid.
  4. How to Clear VirtualGrid rows.

I can use these functionalities by using the radGridView, but due to performance i want to use Virtual Grid.

I have achieved this behavior using the Microsoft DataGridView. But due to Conversion. I want to use all the controls only from telerik. (Using R2 2019 SP1)

If possible any working example will be appreciated. 

 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 11 Sep 2019, 01:15 PM

Hello, Muhammad,

RadVirtualGrid doesn't work with DataSource like RadGridView. It requests data on demand cell by cell. You just need to specify the rows and columns count and handle the CellValueNeeded event. In the event handler, all you need to do is to provide the Value considering the row/column index. It is up to you how you will extract the respective value from your external DataSource

If you need to clear the grid, just set the row/column count to 0.

As to the filtering, I would recommend you to have a look at the following help article demonstrating how to implement filtering behavior in RadVirtualGrid
https://docs.telerik.com/devtools/winforms/controls/virtualgrid/filtering/filtering
https://docs.telerik.com/devtools/winforms/controls/virtualgrid/filtering/setting-filters-programmatically

Our Demo application >> VirtualGrid >> Filtering with DataFilter example is quite useful on this topic. The Demo application can be found in the installation folder of the suite. 

Note that most of the forum threads are reviewed by Telerik representatives and sometimes we address the questions asked by our customers in the forums as well. However, a post in the forum doesn't guarantee you a response from the Telerik support team. Moreover, threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread.

Thank you for your understanding.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
VirtualGrid
Asked by
Kashif
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or