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

RadNumericUpDown in GridViewDataColumn and UpdateSourceTrigger=Explicit does not like zéro values

2 Answers 167 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
Jonx
Top achievements
Rank 2
Jonx asked on 03 Feb 2011, 06:07 AM

Hello,

I have a column in my grid letting me edit a numeric value like that.

<telerik:GridViewDataColumn Header="Abscence" DataMemberBinding="{Binding Abscence}" UniqueName="Abscence" TextAlignment="Right" >
                            <telerik:GridViewDataColumn.CellEditTemplate>
                                <DataTemplate>
                                    <telerik:RadNumericUpDown Loaded="Editor_Loaded" Maximum="25" UpdateValueEvent="PropertyChanged"
                                    Value="{Binding Abscence, Mode=TwoWay, UpdateSourceTrigger=Explicit}" IsInteger="True" />
                                </DataTemplate>
                            </telerik:GridViewDataColumn.CellEditTemplate>
                        </telerik:GridViewDataColumn>

I seems to me that this changed with the latest framework version as it was working before.

The thing is that when the value in my cell is zéro it cannot be changed. Wheter I use up, down or I type new value directly.

When I get out of the cell, I'm still at zéro.

Now when the cell has a value différent from zéro, 20 for example, the cell behaves correctly. When I get out it keeps the value and I get notified.

But here comes the strange... When I set the content of my cell back to zéro... it cannot be changed anymore...

When I remove the UpdateSourceTrigger=Explicit eveything works fine. Can someone explain this to me?

Thank you for your help,

John. 

2 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 08 Feb 2011, 10:11 AM
Hello John,

I do not think it is a good idea to set the UpdateValueEvent to PropertyChanged (which means the source is updated on every keystroke) and the UpdateSourceTrigger to Explicit (which means that you should manually call the UpdateSource() method). These properties seems incompatible with each other.

Still, I have just tried your case in a sample project and everything worked as expected. Find it attached.

Kind regards,
Veselin Vasilev
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Jonx
Top achievements
Rank 2
answered on 18 Feb 2011, 05:30 PM
Hello Veselin,
It's true, thank you for you sample. It doesn't have the problem...
And my project has two many changes now for me to try to reproduce the problem.
And anyway like you said, it's not a good idea to use both properties.
I did remove "UpdateSourceTrigger=Explicit" and everything worked fine.

I'll come back to you in case I get the problem again.
Thank you for your help,
John.
Tags
NumericUpDown
Asked by
Jonx
Top achievements
Rank 2
Answers by
Veselin Vasilev
Telerik team
Jonx
Top achievements
Rank 2
Share this question
or