Hi Thanh,
Thank you for writing back.
Here is how to remove the formatting of the current and the selected row and cell and set the colors back to the one from the
ControlDefault theme:
void
EditorControl_ViewCellFormatting(
object
sender, CellFormattingEventArgs e)
{
if
(e.Row.IsSelected || e.Row.IsCurrent)
{
e.CellElement.GradientStyle = GradientStyles.Solid;
e.CellElement.BackColor = Color.White;
e.CellElement.BorderColor = Color.FromArgb(209, 225, 245);
e.CellElement.BorderWidth = 1;
e.CellElement.BorderBottomColor = Color.FromArgb(209, 225, 245);
e.CellElement.BorderBoxStyle = BorderBoxStyle.SingleBorder;
e.CellElement.BorderGradientStyle = GradientStyles.Solid;
}
else
{
e.CellElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
e.CellElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
e.CellElement.ResetValue(LightVisualElement.BorderColorProperty, ValueResetFlags.Local);
e.CellElement.ResetValue(LightVisualElement.BorderWidthProperty, ValueResetFlags.Local);
e.CellElement.ResetValue(LightVisualElement.BorderBottomColorProperty, ValueResetFlags.Local);
e.CellElement.ResetValue(LightVisualElement.BorderBoxStyleProperty, ValueResetFlags.Local);
e.CellElement.ResetValue(LightVisualElement.BorderGradientStyleProperty, ValueResetFlags.Local);
}
}
void
EditorControl_RowFormatting(
object
sender, RowFormattingEventArgs e)
{
if
(e.RowElement.IsSelected || e.RowElement.IsCurrent)
{
e.RowElement.GradientStyle = GradientStyles.Solid;
e.RowElement.BackColor = Color.White;
}
else
{
e.RowElement.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local);
e.RowElement.ResetValue(LightVisualElement.BackColorProperty, ValueResetFlags.Local);
}
}
Off topic, please try to separate your questions regarding different subjects in different threads, so it will be easier for our community to find them if needed. See p.4 in this thread:
http://www.telerik.com/community/forums/winforms/multicolumncombo/important-information-on-using-the-telerik-forums.aspx.
I hope this helps.
Kind regards,
Stefan
the Telerik team