开发者

Textbox binding does not work ,when changes are made

Hoping I have an object (skuform),whose property(SKUCode) is bound to a textbox. If I run this form , change the value in the textbox (say "test123"), and hit the button, I notice that the object's (skuForm) property does not reflect the new value ("test123"), could you please suggest what could be wrong.

<td>
    <telerik:RadTextBox runat="server" ID="txtSKUCode"  
                   text='<%# skuForm.SKUCode %>' 
                   EnableViewState="true开发者_C百科"
                   Wrap="false" 
                   ontextchanged="txtSKUCode_TextChanged">
    </telerik:RadTextBox>
</td></tr> 

<telerik:RadButton ID="RadButton1" 
                   runat="server" 
                   onclick="RadButton1_Click">
</telerik:RadButton>


Try to set RadTextBox DataContext property to class wich implemented INotifyPropertyChanged interface. So when PropertyChanged event will occurs, you RadTextBox will change his value.

You can see sample of this on msdn page.


When do you call DataBind? If you're not calling it on the postback, then it won't get updated.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜