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.

GridControl ColumnName

Thread ID:

Created:

Updated:

Platform:

Replies:

129963 Dec 26,2007 04:43 AM Apr 12,2017 08:03 AM ASP.NET MVC 3
loading
Tags: Grid
Amol Choudhari
Asked On December 26, 2007 04:43 AM

Hi
I am using syncfusion GridControl.
Now I have to change the 0 displaying cell to empty cell. for this I am using QueryCellInfo
event.
But my problem is either In "e" I am not getting currents cell's value or even I am not able to find the current cell's columnname.

Please help me:
In short how can I convert 0 value containing cell to empty value cell.?
How can I find the columnName in gridcontrol ?

Thanks in advance,
Amol Choudhari


haneefm [Syncfusion]
Replied On December 26, 2007 05:45 PM

Hi Amol,

For GridControl:

How can I convert 0 value containing cell to empty value cell.?
>>>>>
You can handle the QueryCellInfo event of the grid and set the e.Style.CellValue/Text to new value.

void gridControl1_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if( e.Style.Text ="0")
e.Style.Text = string.Empty;
}
How can I find the columnName in gridcontrol ?
>>>>>
Call the GetAlphaLabel method to get the column labels in a grid. Here is a code snippet

string strColumnName = GridRangeInfo.GetAlphaLabel(this.gridControl1.CurrentCell.ColIndex);

Best Regards,
Haneef


NKhumiseni
Replied On April 11, 2017 09:03 AM

Hi, I am having a similar issue, I would like to replace all cell values from the grid (cell value containing 0.00) with an empty value.

Asp.Net MVC, using .ClientSideEvents(eve => { eve.QueryCellInfo("queryC"); })

Mani Sankar Durai [Syncfusion]
Replied On April 12, 2017 08:03 AM

Hi Customer, 

We have analyzed your query and based on your requirement we have prepared a sample that can be downloaded from the below link. 
In this sample we have shown the cell text as empty when the value contains ‘0’ using QueryCellInfo event in grid. Refer the code example. 
@(Html.EJ().Grid<MvcApplication14.OrdersView>("FlatGrid") 
... 
              .ClientSideEvents(eve => eve.QueryCellInfo("query")) 
            
            .Columns(col => 
            { 
                ... 
            }) 
) 
<script type="text/javascript"> 
    function query(args) { 
        var grid = $("#FlatGrid").ejGrid("instance"); 
        if (args.column.field == "Freight" && args.data.Freight == 0) { 
            $(args.cell).text(""); 
        } 
    } 
</script> 
  
Refer the documentation link. 

Please let us know if you need further assistance. 

Regards, 
Manisankar Durai. 


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.

;