开发者

Silverlight Dataform Question

开发者 https://www.devze.com 2022-12-15 19:07 出处:网络
Whenever a user adds a new re开发者_如何学Pythoncord to the dataform I want to auto populate a field(integer datatype) with a default value, but I am not sure how to do this.I should also mention that

Whenever a user adds a new re开发者_如何学Pythoncord to the dataform I want to auto populate a field(integer datatype) with a default value, but I am not sure how to do this. I should also mention that I am populating the dataform using RIA services. Any ideas?


I found a way to do it. What you have to do is give the field a name in XAML:

<dataFormToolkit:DataField >
     <TextBox x:Name="dftb_examid" Text="{Binding ExamId, Mode=TwoWay}" />
</dataFormToolkit:DataField>

Then in the clicked event on the update button:

private void cb_update_Click(object sender, RoutedEventArgs e)
{
    TextBox tb = df_eq.FindNameInContent("dftb_examid") as TextBox;
     tb.Text = "12345";
}
0

精彩评论

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