Hi Marcelo,
Thanks for using Syncfusion Products.
We have analyzed and a created sample for your requirement. Please find the sample and the code snippet.
Sample:
Sample.zip<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
<div>
<ej:Grid ID="Grid" runat='server' AllowPaging="true" >
<ClientSideEvents QueryCellInfo="querycellinfo" />
</ej:Grid>
</div>
</asp:Content>
<asp:Content runat="server" ID="Content1" ContentPlaceHolderID="ScriptSection">
<script>
function querycellinfo(args) {
if (args.column.field == "Number" && args.data.Number == 1)
$($(args.cell).parent()).css("backgroundColor", "Green");/*custom css applied to the row */
if (args.column.field == "Number" && args.data.Number == 2)
$($(args.cell).parent()).css("backgroundColor", "Red");/*custom css applied to the row */
}
</script> </asp:Content>
|
We would like to let you know that we can’t apply the background color to the row base on the values in server side. But we can change the rows background color based on the values by using “
QueryCellInfo” client side event. So we suggest you to use the client side event “
QueryCellInfo” to achieve your requirement.
Please refer the online documentation for further details.
Documentation:
http://www.syncfusion.com/kb/2979/how-to-select-or-highlight-rows-based-on-dataPlease let us know if you have any queries.
Regards,
Balaji Marimuthu