We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Close Icon
Unfortunately, activation email could not send to your email. Please try again.
Close Icon
close icon
Vote for your favorite ebook
Succinctly Readers Awards 2020
Syncfusion Feedback

Tree Virtual Grid

Thread ID:





55615 Feb 1,2007 04:48 PM UTC Jun 22,2012 04:21 AM UTC WinForms 12
Tags: GridControl
Adnan Sohail
Asked On February 1, 2007 04:48 PM UTC

Can anyone please put an example for creating virtual data grid using collection of objects?

I want the first column to represent the tree view.

There is an example in the samples, but it uses the .cds file that i cannot make changes to.


Administrator [Syncfusion]
Replied On February 1, 2007 10:28 PM UTC

Hi Adnan,

Do you want to use the custom collection in a VirtTreeGrid? If yes, you would have to create and populate a CollapsibleDataSource.data using a code similar to that in CollapsibleDataSource.InitData method. Here is a sample which populates the CollapsibleDataSource.data with a data set. Please refer to the attached sample for more details.

Sample : VirtTreeGrid.zip


Adnan Sohail
Replied On February 1, 2007 10:42 PM UTC

Hi Haneef,

This pretty much solves my issue.

I have another post regarding virtual grid treeview and i really need help with that.

Could you please look at it and let me know if it is possible.

Administrator [Syncfusion]
Replied On February 2, 2007 05:49 PM UTC

Hi Adnan,

Your fourm thread has been updated. Please refer this

Tree Virtual Grid -- Urgent

Thank you very much for your interest in Syncfusion’s products.

Best regards,

Adnan Sohail
Replied On February 5, 2007 05:46 PM UTC

Hi Haneef,

I have attached the grid example and this is currently bound to a dataset. I have created a Product Object that has a collection of child Products.

The startup page is instantiating a product object. Now i want to bind this product object to the virtual grid.

Also Is there any way to expand columns? For example i have following columns headers:

Week 1 - Week 2 --> They both have + sign next to them. When a user clicks plus the columns expands to days (i.e. show day1, day2, etc).

Thanks for your help.


Administrator [Syncfusion]
Replied On February 5, 2007 09:35 PM UTC

Hi Adnan,

Question 1: create the collapsible datasource for product object

To display the product object in a virtualtree grid, you neeed to populate a CollapsibleDataSource.data for product object using the below code. Here is a sample which populates the CollapsibleDataSource.data with a prodcute object. Please refer to the attached sample for more details.

Sample : ModifiedTesting2.zip

public void InitFromProduct(Product product)
int rows = product.childProducts.Count;
int cols = 0;

this.data = new SampleData[rows + 2];
cols = product.GetType().GetFields().Length;
int ncols = TypeDescriptor.GetProperties(product.childProducts).Count ;

if (cols < ncols)
cols = ncols;

int row = 0;
///For product name datatable.
string[] s = new string[cols];
s[0] = product.ToString();
data[row] = new SampleData(0, TreeNodeState.NoChildren, s);

//product object items...
s = new string[cols];
s[0] = product.ProductName;
s[1] = product.ProductDescription;

data[row] = new SampleData(1, TreeNodeState.NoChildren, s);

//childproduct item.
foreach (Product item in product.childProducts)
s = new string[cols];
s[0] = item.ProductName;
s[1] = item.ProductDescription;
data[row] = new SampleData(2, TreeNodeState.NoChildren, s);

internalColCount = cols;
Locked = false;
internalRowCount = rows;
visibleRows = new ArrayList();

Question 2: Is there any way to expand columns?
Here is a forum thread that discuss with the excel like grouping( Expanding/Collapshing the columns) in a grid.

Best Regards,

Replied On June 9, 2012 03:21 AM UTC

Hi all!

I find source of Tree Vitual Grid project. But Links are Died....hic hic...So, Help me, please
Give me source of Sample: ModifiedTesting2.zip, Testing2.zip, VirtTreeGrid.zip....Admin, Help me.....
Thank you!

Jeya Preetha M [Syncfusion]
Replied On June 14, 2012 05:02 AM UTC


Hi TrungdaicaCIT,

We have a sample in our dashboard which explains about the step-by-step tutorial on binding a data source to the Grid Grouping control using Visual Studio.

Please refer the sample in the following link:

..\..\AppData\Local\Syncfusion\EssentialStudio\{Installed version}\Windows\Windows\ Grid.Grouping.Windows\Samples\2.0\Getting Started\Data Binding VS Demo

Please let me know if you have any concerns.


Jeya Preetha M

Replied On June 15, 2012 04:25 AM UTC

Thank you Syncfusion forum. Thank you Mr. Jeya Preetha M

Ragamathulla B [Syncfusion]
Replied On June 18, 2012 04:22 AM UTC

Hi TrungdaicaCIT,

Thanks for the update.

Please let me know if you have any further concerns.


Ragamathullah B.

Replied On June 18, 2012 08:27 AM UTC

I have "Format Cells Demo" of "Dynamic Formatting" on Syncfusion sample. I want to Merge data in gridview from database SqlServer. I need a source like it.I hope your helpers....thank you!

Replied On June 18, 2012 08:37 AM UTC

This is my demo sample about "Format Cells Demo"


Ragamathulla B [Syncfusion]
Replied On June 22, 2012 04:21 AM UTC

Hi TrungdaicaCIT,


Thank you for update.


We will update details for your reported query in that forum '40735'. Please refer the forum for better follow up.


Let me know if you have any further concerns.



Ragamathullah B.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon