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.

Conditional Formatting doesn´t aplly when GGC has autoformat = "Vista"

Thread ID:

Created:

Updated:

Platform:

Replies:

93215 Mar 3,2010 03:57 PM Mar 11,2010 10:40 PM ASP.NET Web Forms (Classic) 5
loading
Tags: Grouping
Ricardo Ismael Sanchez Condori
Asked On March 3, 2010 03:57 PM


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 !


Jaffersathick B [Syncfusion]
Replied On March 4, 2010 01:26 AM

Hi Ricardo,

Thank you for your interest in Syncfusion products.

We referred the forum which you mentioned as reference and found that your issue is resolved. Please let us know if you have any other concerns. We will be happy to help you out.

Regards,
Jaffer.B

Ricardo Ismael Sanchez Condori
Replied On March 4, 2010 11:23 AM


No, because, i have a GGC, and it has an autoformat = "Vista", i implemented a QueryCellStyleInfo, and applies an css, when its runs doesn't changes background color cell. i put my code above. I use 7.203.0.20. Do you have an example with this version ? because an example that you commented is for previous version, when i compiled the site, doesn't runns.

greeting y thnks !

Jaffersathick B [Syncfusion]
Replied On March 7, 2010 11:13 PM

Hi Ricardo,

Thank you for your interest in Syncfusion products.


We suggest you to set the e.Handled as true after applying the CSS class to the cell value. Please refer the code snippet below,


[CS]
if (Result < 3)
{
e.Style.CssClass = "MyGreenTextStyle";
e.Style.CellValue = Result.ToString() + " < 3";
e.Handled = true;
}



Due to security reason we are unable to provide you sample in public forums.

Let me know if you have any other queries.


Regards,
Jaffer.B

Ricardo Ismael Sanchez Condori
Replied On March 9, 2010 12:48 PM

well! that was what I needed e.Handled = true; in the solution above does not specify this. Greetings and thanks

Jaffersathick B [Syncfusion]
Replied On March 11, 2010 10:40 PM

Hi Ricardo,

Thanks for update.

We are glad to hear that your issue is resolved.

Please do not hesitate to get back to us for further assistance.

Regards,
Jaffer

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.

;