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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

customize cell does not work

Thread ID:

Created:

Updated:

Platform:

Replies:

143064 Mar 3,2019 01:45 PM UTC Mar 4,2019 05:50 AM UTC ASP.NET Core - EJ 2 1
loading
Tags: DataGrid
reinhard
Asked On March 3, 2019 01:45 PM UTC


My Code:

<ejs-grid id="grid" dataSource="ViewBag.dataSource"   queryCellInfo="customiseCell" ..

 <e-grid-column field="UmsatzVj" headerText="UmsatzVj" format="N0" textAlign="Right" width="150"></e-grid-column>

<script>
                        function customiseCell(args) {
                            if(args.column.field > 'UmsatzVj') {
                                if (args.data['UmsatzVj'] < 0) {
                                    args.cell.classList.add('below-0');
                                    } else {
                                        args.cell.classList.add('above-0');
                                    }
                                }
                            }
</script>

 <style>
                below-0{
                    color:red;
                }
                above-0 {
                    color: black;
                }
            
</style>

What's wrong???

Pavithra Subramaniyam [Syncfusion]
Replied On March 4, 2019 05:50 AM UTC

Hi Reinhard, 
 
Greetings from Syncfusion. 
 
We have checked your query and we suspect that the cause of the reported behavior might be the condition(“if(args.column.field > 'UmsatzVj')” ) you are using inside the ‘queryCellInfo’ event. Could you please ensure whether any reason for this condition (comparing two strings). If no, We suggest you to change the operator “>” to “==” to achieve your requirement. 
 
 
If you are still facing the issue could you please provide the below details that will be helpful for us to provide a better solution as early as possible. 
 
  1. Sharer your full Grid code.
  2. Ensure whether the custom CSS classes (“below-0” Or “above-0”) are added to the Cell element.
  3. Share your Syncfusion package version.
 
Regards, 
Pavithra S. 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

;