Display column List with another separator

So i have List<string> that displayed in grid column as "value1,value2" where the separator is comma.

Here i want to change the separator for example to this : "value1, value2" (with space after comma). How can i do that ?

3 Replies

TS Thavasianand Sankaranarayanan Syncfusion Team March 15, 2018 10:27 AM UTC

Hi Trinquier, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and we suspect that you want to show the Grid column value as “val1, val2” instead of showing “val1,val2”. So, we suggest you to use the queryCellInfo event of ejGrid control to achieve your requirement. 

For an example we have change the CustomerID column value in the below code example. 

[GridFeatures.cshtml] 

@(Html.EJ().Grid<object>("FlatGrid") 
            .Datasource((IEnumerable<object>)ViewBag.datasource) 
            .AllowPaging()    /*Paging Enabled*/ 
            .ClientSideEvents(ce=>ce.QueryCellInfo("GridQueryCellInfo")) 
        .Columns(col => 
        { 
             
           ----- 
 
        })) 
</div> 
 
<script type="text/javascript"> 
 
    function GridQueryCellInfo(args) { 
 
        if (args.column.field == "CustomerID") { 
 
            var empId = args.rowData["CustomerID"]; 
            args.cell.innerText = empId.replace(/,/g, ', '); 
        } 
    } 
 
</script> 


We have prepared a sample and it can be downloadable from the below location. 


Refer the help documentation. 


Regards, 
Thavasianand S. 



TV Trinquier Vannick March 20, 2018 03:47 AM UTC

Hi Thavasianand,

Thank you for the example.




TS Thavasianand Sankaranarayanan Syncfusion Team March 21, 2018 05:25 AM UTC

Hi Trinquier, 
 
Thanks for your update. 
 
Please get back to us if you need any further assistance.  
 
Regards, 
Thavasianand S. 


Loader.
Up arrow icon