Yes, it is possible to achieve this. You can use the CellFormatting event to change the text of the cell if its value is 0:
privatevoidRadGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.Column is GridViewDecimalColumn && e.CellElement.Value != null)
{
varvalue = (decimal)e.CellElement.Value;
if (value == 0)
{
e.CellElement.Text = "";
}
}
}
I hope this helps. Should you have other questions I will be glad to help.
Regards,
Nadya
Progress Telerik
Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic. Our thoughts here at Progress are with those affected by the outbreak.
That's obviously the first idea, but i hoped you had a better one. And you do, as i found recently:
var obj = new ExpressionFormattingObject("Condition_" + colName, colName + " = 0", true) {CellForeColor = Color.Transparent};
this.Grid.Columns[colName].ConditionalFormattingObjectList.Add(obj);
0
Nadya | Tech Support Engineer
Telerik team
answered on 09 Apr 2020, 04:35 AM
Hello Uwe,
I am glad that you managed to find another solution to achieve your goal. Thank you for sharing it with the community. Feel free to use this one that suits your requirements the best.
Should you have other questions do not hesitate to ask.
Regards,
Nadya
Progress Telerik
Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic. Our thoughts here at Progress are with those affected by the outbreak.