I'm using some WebPercentEditProviders, but if no value has been entered it shows 0 (zero).
I would like to implement some display formatting such as {0:#.####} but the BoundDataColumn does not understand # formatting.
How can I get a column to display numbers as normal, but display nothing instead of 0 (zero). A srting column would do this but then you lose the ability to set MinValue and MaxValue and number of decimals places.
Any help much appreciated.
Hello ChristopherTo achieve this you will have to handle the valuechanged event of the editor: in the WDG:<EditorProviders>
<ig:PercentEditorProvider ID="WebDataGrid1_PercentEditorProvider1" >
<EditorControl BackColor="Red" BorderColor="Blue" ClientIDMode="Predictable">
<ClientEvents
ValueChanged="ValueChanged" />
</EditorControl>
</ig:PercentEditorProvider>
</EditorProviders>
the event:function ValueChanged(sender, eventArgs)
{
if (eventArgs.get_value() == 0)
sender._text = "";
}
Hi Nikifor, this only works when you change the value in that column.
There are still two situations where it does not work;
1. upon grid loading
2. upon changing the value and moving selection to another row
FYI: I'm using Manual CRUD.
I can get the column to format upon grid loading using the InitializeRow in the code-behind.
But InitializeRow only seems to work during initial page loading. When a row is updated, it calls the RowUpdating event, and in my code behind I amend the object the grid is bound to. You see the InitializeRow being triggered and running, but the formatting doesn't take effect. The column gets set to 0.
Quite odd.
Hello Cristopher,Please confirm that the attached with this post sample reproduces the issue.
Hello, Please let me know if you still need assistance for this case.