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.

Change colors in GridListControl

Thread ID:

Created:

Updated:

Platform:

Replies:

79702 Feb 23,2009 12:06 AM Feb 25,2009 07:52 AM Windows Forms 3
loading
Tags: GridControl
Nalin
Asked On February 23, 2009 12:06 AM


I set cell type as GridListControl in DataGridBound control.

How do I change colors and font size in a GridListControl because it get colors of a DataGridBound control

Thank You



Nisha Arockiya A [Syncfusion]
Replied On February 23, 2009 06:58 AM

Hi Nalin,

Thanks for your interest in Syncfusion Products.

You can refer to our browser sample Customized List Control Demo.This sample demonstrates customizing the appearance of a grid list control.

\My Documents\Syncfusion\EssentialStudio\7.1.0.20\Windows\Grid.Windows\Samples\2.0\GridListControl\Customized List Control Demo

Let me know if this helps.

Regards,
Nisha.


Nalin
Replied On February 24, 2009 02:27 AM

That can use if use seperate GridListControl.
But I use GridListControl as celltype of a GridDataBoundGrid control. So it is embedad in a cell.





>Hi Nalin,

Thanks for your interest in Syncfusion Products.

You can refer to our browser sample Customized List Control Demo.This sample demonstrates customizing the appearance of a grid list control.

\My Documents\Syncfusion\EssentialStudio\7.1.0.20\Windows\Grid.Windows\Samples\2.0\GridListControl\Customized List Control Demo

Let me know if this helps.

Regards,
Nisha.




Nisha Arockiya A [Syncfusion]
Replied On February 25, 2009 07:52 AM


Hi Nalin,

Thanks for the Update.

Here is a way to change style of the Embedded GridListcontrol. After you have placed the control into the cell by setting the CellType to "GridListControl", you can retrieve a reference to the GridDropDownGridListControlCellRenderer for that cell, and then handle the PrepareViewStyleInfo EventHandler to change the style.


//There is a way to get the control renderer in particular cell(1,1)
GridDropDownGridListControlCellRenderer cr =(GridDropDownGridListControlCellRenderer)this.gridControl1.GetCellRenderer(1,1)
//There is a way to get the control renderer without having to access a particular cell
GridDropDownGridListControlCellRenderer cr =(GridDropDownGridListControlCellRenderer)this.gridControl1.CellRenderers["GridListControl"];
cr.ListControlPart.Grid.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(Grid_PrepareViewStyleInfo);

void Grid_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
if (e.ColIndex == 3 && e.RowIndex > 0)
{
e.Style.BackColor = Color.Red;
e.Style.Font.Size = 20;
}
}


Let me know if this helps.

Regards,
Nisha.


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.

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.

;