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

Problem with the Clear button and bound to an int

1 Answer 61 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Scott
Top achievements
Rank 1
Scott asked on 05 Dec 2013, 08:18 AM

I have several RadTextbox's all bound using two way binding.  In my model and view model, everything implements INotifyPropertyChange.

I have one textbox that is mapped to a string and if I press the clear button on the textbox (and after binding.Updatesource on the textbox binding is executed), the setter of the bound field executes.



However, I have one textbox that is mapped to an integer and if I press the clear button that textbox (and after binding.UpdateSource on the textbox is executed), the setter of the bound field does not execute.  It will execute just fine if I change the value of the textbox with another integer.



How come or what does the X Clear button do when bound to an integer to not change the value of the bound field?



The clear button works on the Publisher textbox but does not on the Page Count textbox



<telerikPrimitives:RadTextBox x:Name="publisherTextBox" Header="Publisher"

HeaderStyle="{StaticResource HeaderAccentStyle}"

Text="{Binding Publisher, Mode=TwoWay}" Grid.Row ="3"/>

                   

<telerikPrimitives:RadTextBox x:Name="pageCountTextBox" Header="Page Count"

HeaderStyle="{StaticResource HeaderAccentStyle}"

InputScope="Number"

Text="{Binding NoOfPages, Mode=TwoWay}" Grid.Row ="5" />



[global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_NoOfPages", DbType = "Int", UpdateCheck = UpdateCheck.Never)]

public int NoOfPages

{

get

{

return this._NoOfPages;

}

set

{

if ((this._NoOfPages != value))

{

this.OnNoOfPagesChanging(value);

this.SendPropertyChanging();

this._NoOfPages = value;

this.SendPropertyChanged("NoOfPages");

this.OnNoOfPagesChanged();

}

}

}



[global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_Publisher", DbType = "NVarChar(50)", UpdateCheck = UpdateCheck.Never)]

public string Publisher

{

get

{

return this._Publisher;

}

set

{

if ((this._Publisher != value))

{

this.OnPublisherChanging(value);

this.SendPropertyChanging();

this._Publisher = value;

this.SendPropertyChanged("Publisher");

this.OnPublisherChanged();

}

}

}




1 Answer, 1 is accepted

Sort by
0
Accepted
Valentin.Stoychev
Telerik team
answered on 06 Dec 2013, 12:05 PM
Hi Scott,

from what you described and from the code you send us we can not find a reason why it is not working.

Please open a support ticket and send us the sample project where we can see the behavior.

Regards,
Valentin.Stoychev
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
TextBox
Asked by
Scott
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Share this question
or