0

I have a DataForm where I set the CurrentItem to an Entity returned from a LINQ RIA DataService. I am using Silverlight 4 with RIA services.

My "Current Item" is an Entity that a is row from SQL table. There's a column called "RestartType" on that table.

I have a DataForm where I set the DataForm.EditTemplate in the XAML.

I have three RadioButtons in my EditTemplate:

<RadioButton Content="Restart 1" /> <RadioButton Content="Restart 2" /> <RadioButton Content="Restart 3" />

How do I make it so IF the RestartType value is 0, then the Restart 1 radio button gets selected but the other ones don't get selected, or if the RestartType value is 1, then Restart 2 gets selected, and if it is 3 then Restart 3 gets selected and other radio buttons get de-selected.

I hope you can understand what I'm trying to do.

Thanks

1
  • Does anyone know how to do this?
    – Andrei B
    May 4, 2011 at 17:46

1 Answer 1

0

I ended up using the ContentLoaded event handler in my DataForm then I got the CurrentItem of the DataForm as my object. I used DataForm.FindNameInContent to get the EditTemplate controls and set the right RadioButton checked appropriately.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.