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. Image for the cookie policy date

Change colors in GridListControl


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



3 Replies

NA Nisha Arockiya A Syncfusion Team February 23, 2009 11:58 AM UTC

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.



NA Nalin February 24, 2009 07:27 AM UTC

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.





NA Nisha Arockiya A Syncfusion Team February 25, 2009 12:52 PM UTC


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.


Loader.
Live Chat Icon For mobile
Up arrow icon