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

TreeView with radiobuttons

5 Answers 21 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
GEB
Top achievements
Rank 1
GEB asked on 24 May 2010, 03:31 PM
I would like to create a 2-tier treeview.  The parent nodes would simply be text, but the child nodes would have three radiobuttons and a textblock (horizontal stackpanel).  Is this possible with the RadTreeView and databinding?

Regarding the databinding, the database would contain an int value that would determine which radiobutton was checked, and the database would also contain the text value for the textblock.

Any ideas or examples would be appreciated.

5 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 27 May 2010, 01:51 PM
Hi GEB,

Please accept my apology for the delayed response.

I prepared a sample project illustrating a  possible approach towards the described scenario. Please take a look at it and let me know if this is what you had in mind or if you need more info.

Greetings,
Tina Stancheva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
GEB
Top achievements
Rank 1
answered on 27 May 2010, 02:42 PM
Thank you for the sample project.  However, this only seems to solve half of the problem.  How to change the value of the int when the RadioButton is checked by the user?  The sample program sets the initial value to checked or unchecked, but does not seem to handle the two-way binding.
0
Tina Stancheva
Telerik team
answered on 27 May 2010, 03:29 PM
Hello GEB,

I modified the example by modifying the ConvertBack() method to return an approproate value when the user checks a button.

Please take a look at it and let me know if it works for you.

Sincerely yours,
Tina Stancheva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
GEB
Top achievements
Rank 1
answered on 28 May 2010, 08:48 PM
Thank you for the updated example.  I did find an interesting timing issue.  When a RadioButton is pressed, it causes two converters to be called for the same bound property.  One converter is called because a radio button is unchecked, and the second converter is called because another radio button is simultaneously checked.  Therefore, the bound property will be set to the value of the converter that is called last.  In order to fix this issue, I changed the setter of the property to check for a value of 0.  If 0, then setter ignores the value, and does not change the value of the property.  If you can think of a better way to handle this condition, I'd love to hear it.
0
Tina Stancheva
Telerik team
answered on 31 May 2010, 09:17 AM
Hello GEB,

Changing the setter of the property to check for 0 value is a good solution.

However, if you encounter any issues, please do not hesitate to contact us.

Kind regards,
Tina Stancheva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TreeView
Asked by
GEB
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
GEB
Top achievements
Rank 1
Share this question
or