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.
Syncfusion Feedback

Virtual Tree Grid Sample and Column Headers

Thread ID:

Created:

Updated:

Platform:

Replies:

48097 Aug 18,2006 09:01 PM UTC Aug 23,2006 11:58 PM UTC Windows Forms 2
loading
Tags: GridControl
Julie Levy
Asked On August 18, 2006 09:01 PM UTC

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;
}

Thanks,
Julie

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

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)
{
button4.PerformClick();
}
else
{
button5.PerformClick();
}
}
}


Then at the top of saveCellInfo, add

if (e.ColIndex == 1 && e.RowIndex == 0)
{
return;
}

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 11:58 PM UTC

Thanks for your help Clay, this works great.

CONFIRMATION

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.

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

;