开发者

Set default value of ComboBox in grouping DataGrid

开发者 https://www.devze.com 2023-02-19 12:44 出处:网络
I have this, Now, I need to set the default value of my ComboBox, (i.e., to the first value of my database table). I have tried to do this manually, ComboScanner.Text = \"\", however, I get an erro

I have this,

Set default value of ComboBox in grouping DataGrid

Now, I need to set the default value of my ComboBox, (i.e., to the first value of my database table). I have tried to do this manually, ComboScanner.Text = "", however, I get an error saying:

Could not find 'ComboScanner'.

开发者_JS百科

I am wondering if this is because I am using a DataTemplate, if not, how can I solve this?


Have you tried setting your ComboBox's SelectedIndex = 0?

<ComboBox Name="ComboScanner" SelectedIndex="0" ... />
0

精彩评论

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

关注公众号