This is a migrated thread and some comments may be shown as answers.

Grid bound column format

1 Answer 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
arijit
Top achievements
Rank 1
arijit asked on 05 Nov 2008, 11:09 AM

I have a bound column with these attribute

DataField="ManagementFee" DataType="System.Decimal" DataFormatString="{0:0.00}%"

Now I want that the column will show blank if data is null or 0.

Please answer.

1 Answer, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 05 Nov 2008, 11:15 AM
Hi Arijit,

Please test this approach:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    GridDataItem item = e.Item as GridDataItem; 
    if(item != null && item["yourColumnName"].Text == "0"
        item["yourColumnName"].Text = ""

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
arijit
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or