简体   繁体   English

我如何获得Wpf项目模板列内的单选按钮

[英]how can i get the radio button inside a Wpf item template column

i hv a problem im using Wpf Grid there is one itemtemplate column(radio button) my grid first row bind always with my form load event but the radio button is not selected..i want bind the row with radio button selcted 我使用Wpf Grid遇到问题,有一个itemtemplate列(单选按钮)我的网格第一行始终与我的表单加载事件绑定,但未选中单选按钮。.我想选择单选按钮绑定该行

how can i achive it 我怎么能做到

Put a boolean in the your model class and bind the Radiobutton.IsChecked to that property. 在模型类中放入一个布尔值,然后将Radiobutton.IsChecked绑定到该属性。 Then you will just have to set that property in your model to make the button be checked. 然后,您只需要在模型中设置该属性即可对按钮进行检查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM