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.
Unfortunately, activation email could not send to your email. Please try again.

Virtual Tree Grid Sample and Column Headers

Thread ID:





48097 Aug 18,2006 05:01 PM Aug 23,2006 07:58 PM Windows Forms 2
Tags: GridControl
Julie Levy
Asked On August 18, 2006 05:01 PM

I''m trying to get a treecell to appear in the first column header so i can trap the click to expand all/collapse all (instead of the buttons).

I''ve altered GridQueryCellInfo in the following way, but the tree cell isn''t painting. Is this possible? Do i need to add another base style?

if (e.RowIndex == 0 && e.ColIndex == 1)
e.Style.CellValue = "Test";
e.Style.CellType = "TreeCell";
e.Style.Tag = 0;
e.Style.ImageIndex = 1;


Administrator [Syncfusion]
Replied On August 19, 2006 03:55 AM

Try this.

At the bottom of Form.Load, add:

// this.gridControl1[0, 1].BaseStyle = "Standard";
this.gridControl1[0, 1].Themed = false;
this.gridControl1[0, 1].CellType = "TreeCell";
this.gridControl1[0, 1].ImageIndex = 0;
this.gridControl1[0, 1].Tag = 0;
this.gridControl1[0, 1].ImageList = this.imageList1;
this.gridControl1.CellClick += new GridCellClickEventHandler(gridControl1_CellClick);

Then use this handler:

void gridControl1_CellClick(object sender, GridCellClickEventArgs e)
if (e.RowIndex == 0 && e.ColIndex == 1)
if(this.gridControl1[0, 1].ImageIndex == 0)

Then at the top of saveCellInfo, add

if (e.ColIndex == 1 && e.RowIndex == 0)

This will just store the cell 0,1 information in the grid and let it be maintained internally, and not rely on the external datasource for its value.

Julie Levy
Replied On August 23, 2006 07:58 PM

Thanks for your help Clay, this works great.


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.

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.