Hi Guyot,
Thanks for contacting Syncfusion support.
To achieve your requirement, use queryCellInfo event of ejGrid. In this event we check the condition with the column and apply the css based on the mentioned condition.
Find code example, screenshot and sample:
<div>
<ej:Grid ID="FlatGrid" runat="server" AllowSorting="True" AllowPaging="True">
<ClientSideEvents QueryCellInfo="formatingCell" />
<Columns>
--------------------------------
<ej:Column Field="OrderDate" HeaderText="Order Date" TextAlign="Right" Width="80" Format="{0:MM/dd/yyyy}" Priority="2" />
-------------------------
</Columns>
</ej:Grid>
</div>
-----------------------------------------
<script>
function formatingCell(args) {
if (args.column.field == "OrderDate") {
var date = args.data.OrderDate;
var currentDate = new Date();
if (date < currentDate) {
$(args.cell).css("color", "red");
}
}
}
</script>
|
Screenshot:
Refer to the Help document for the queryCellInfo event.
Regards,
Prasanna Kumar N.S.V