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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Adding a Primitives to a column in MultiColumnTreeView

Thread ID:

Created:

Updated:

Platform:

Replies:

133047 Oct 5,2017 06:24 PM UTC Oct 9,2017 12:39 PM UTC WinForms 3
loading
Tags: MultiColumnTreeView
khayralla
Asked On October 5, 2017 06:24 PM UTC

Hi

I am looking for an example on how to add a Primitive to TreeColumnAdv in MultiColumnTreeView ?

what I found is how to add it as a TreeNodeAdv only.

thanks 

Mallika Kannan [Syncfusion]
Replied On October 6, 2017 12:48 PM UTC

Hi Khayralla   
   
Thank you for contacting Syncfusion support.   
   
As like in below screenshot, MultiColumnTreeview contains 3 parts.    
  
  1. Main TreeNodeAdv – To display the TreeNodeAdv.
  2. Column Header – To display Column header information.
  3. TreeNodeAdv Subitem – To display the additional information of TreeNodeAdv.  
Screenshot   
   
     
   
   
As you have mentioned only main TreeNodeAdv part can have. And still you can display images in both Left and Right Image in the TreeColumnAdv Header and TreeNodeAdvSubItems. Please refer the below Screenshot.   
   
Screenshot   
   
     
   
Code example [C#]:   
   
//Set TreeColumnAdv Left Image and Right Image   
   
treeColumnAdv1.LeftImage = ((System.Drawing.Image)(resources.GetObject("treeColumnAdv1.LeftImage")));   
treeColumnAdv1.RightImage = ((System.Drawing.Image)(resources.GetObject("treeColumnAdv1.RightImage")));   
treeColumnAdv4.LeftImage = ((System.Drawing.Image)(resources.GetObject("treeColumnAdv4.LeftImage")));   
treeColumnAdv4.RightImage = ((System.Drawing.Image)(resources.GetObject("treeColumnAdv4.RightImage")));   
treeColumnAdv4.LeftImage = ((System.Drawing.Image)(resources.GetObject("treeColumnAdv4.LeftImage")));   
treeColumnAdv4.RightImage = ((System.Drawing.Image)(resources.GetObject("treeColumnAdv4.RightImage")));   
treeColumnAdv4.LeftImage = ((System.Drawing.Image)(resources.GetObject("treeColumnAdv4.LeftImage")));   
treeColumnAdv4.RightImage = ((System.Drawing.Image)(resources.GetObject("treeColumnAdv4.RightImage")));   
   
//Set TreeNodeAdvSubItem LeftImage and RightImage   
   
treeNodeAdvSubItem3.LeftImage = imageList1.Images[1];   
treeNodeAdvSubItem4.LeftImage = imageList1.Images[1];   
treeNodeAdvSubItem5.LeftImage = imageList1.Images[1];   
treeNodeAdvSubItem7.LeftImage = imageList1.Images[1];   
treeNodeAdvSubItem7.RightImage = imageList1.Images[1];   
treeNodeAdvSubItem8.LeftImage = imageList1.Images[1];   
treeNodeAdvSubItem8.RightImage = imageList1.Images[1];   
treeNodeAdvSubItem9.LeftImage = imageList1.Images[1];   
treeNodeAdvSubItem9.RightImage = imageList1.Images[1];   
treeNodeAdvSubItem11.LeftImage = imageList1.Images[1];    
treeNodeAdvSubItem12.LeftImage = imageList1.Images[1];   
treeNodeAdvSubItem13.LeftImage = imageList1.Images[1];   
treeNodeAdvSubItem15.LeftImage = imageList1.Images[1];    
treeNodeAdvSubItem15.RightImage = imageList1.Images[1];   
treeNodeAdvSubItem17.LeftImage = imageList1.Images[1];   
treeNodeAdvSubItem17.RightImage = imageList1.Images[1];   
 
   
We have prepared the sample for your reference. It can be downloaded from the below link,   
   
   
Kindly confirm us what are all the Primitives support and in which portion you are expecting it? Upon your confirmation, we will let you know this.    
   
Regards,   
Mallika 
 


khayralla
Replied On October 6, 2017 01:43 PM UTC

Thanks for your replay. However, I need to add a progress bar control under column 4, not just an image.

see the attached file.


thanks


Attachment: OVM__Copy_8f3686b2.zip

Vijayalakshmi Roopkumar [Syncfusion]
Replied On October 9, 2017 12:39 PM UTC

Hi Khayarla,

Thank you for contacting Syncfusion Support.

We have checked the reported requirement in the attached screenshot and found that your requirement is to customize the fourth column in MultiColumnTreeView. In the MultiColumnTreeView, you can customize and place Custom controls in TreeNodeAdv column and not in any other column. So to fulfill your requirement, we have achieved it using the GridControl Control. Please find the code example for the same: 
  
The QueryCellStyleInfo event can be used to set the ProgressBar as CellType. Please make use of the below code,C#: 
  
//Event Triggering 
gridControl1.QueryCellInfo += new GridQueryCellInfoEventHandler(GridQueryCellInfo); 
  
//Event Customization 
void GridQueryCellInfo(object sender, GridQueryCellInfoEventArgs e) 
{ 
    if (e.RowIndex > 0 && e.ColIndex > 0 && e.ColIndex == 4) 
    { 
        e.Style.CellType = GridCellTypeName.ProgressBar; 
    } 
} 
  
(Or) 
  
//To add the CustomControl 
this.gridControl1.ColStyles[4].CellType = GridCellTypeName.ProgressBar; 
  
  
Please refer to the below KB to customize the progress bar cell,

UG link: https://help.syncfusion.com/windowsforms/grid/cell-types#progressbar-cell-type 

Note

You can also place any custom control in any Cell. Please make use of below code snippets. 
  
gridControl1.QueryCellInfo += new GridQueryCellInfoEventHandler(GridQueryCellInfo); 
//Event Customization 
void GridQueryCellInfo(object sender, GridQueryCellInfoEventArgs e) 
{ 
    if (e.RowIndex > 0 && e.ColIndex > 0 && e.ColIndex == 4) 
    { 
        e.Style.CellType = "Control"; 
        e.Style.Control = progressBar1; 
    } 
} 
  
  
Kindly check with above solution and let us know if it helps.

Regards,
Vijayalakshmi V.R.
 


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

;