Hi,
I use a ggc which has an autoformat("Vista"), but, i use conditional formatting, my GGC doesn´t applies the format color.
In this sample, doesn´t has a autoformat feature.
http://samples.syncfusion.com/ASPNET/8.1.0.30/Web/Grid.Grouping.Web/samples/3.5/Appearance/ConditionalFormatting/cs/conditionalformatting.aspx?args=2 runat="server" DataMember="DefaultView" DataSourceCachingMode="ViewState" AutoFormat="None"
BorderCollapse="Separate" GroupDropAreaCssClass="GroupCss" ShowGroupDropArea="false">
This examples run it goods!. But, in my case, my GGC has an autoformat
EnableCallbacks="False" PostBackOnRowDblClick="False"
BorderColor="#2A437E" ShowIndicator="False"
DataSourceCachingMode="ViewState" DataMember="DefaultView" AutoFormat="Office 2007 Blue"
BorderCollapse="Separate" DragSelectionBackColor="Yellow"
HotTrackButtons="False" ClientSideOnRecordClick="fORC(this)" onbarbuttonitemclicked="GGC_BarButtonItemClicked"
PageSize="6" ReadOnly="true" onquerycellstyleinfo="GGC_QueryCellStyleInfo">
CS
--
protected void GGC_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell || e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell)
{
Record record = e.TableCellIdentity.DisplayElement.GetRecord();
if (e.TableCellIdentity.Column.Name == "EmployeeID")
{
int Result = 0;
if (record == null)
{
Result = 0;
}
else
{
Result = int.Parse(record.GetValue("EmployeeID").ToString());
}
if (Result < 3)
{
e.Style.CssClass = "MyGreenTextStyle";
e.Style.CellValue = Result.ToString() + " < 3";
//e.Style.BackColor = System.Drawing.Color.Green;
}
else if (Result > 2)
{
e.Style.CssClass = "MyGreenTextStyle";
e.Style.CellValue = Result.ToString() + " > 2";
//e.Style.BackColor = System.Drawing.Color.Yellow;
}
else if (Result == 0)
{
e.Style.CssClass = "MyGreenTextStyle";
e.Style.CellValue = Result.ToString() + " = 0";
//e.Style.BackColor = System.Drawing.Color.DarkRed;
}
}
}
}
css
---
.MyGreenTextStyle
{
background-color:Lime;
}
My GGC doesn't changes the background color.
References
----------
http://www.syncfusion.com/support/forums/grid-aspnet/72305/auto-format-and-grid-customization
Does anyone helps me, plz ?
Greeting !