开发者

Getting value of a PasswordBox that's inside a ListView

开发者 https://www.devze.com 2023-03-23 15:27 出处:网络
I have a ListView that has 3 GridViewColumns and about 10 items. The third GridViewColumn\'s content is:

I have a ListView that has 3 GridViewColumns and about 10 items. The third GridViewColumn's content is:

<GridViewColumn.CellTemplate>
<DataTemplate>
<PasswordBox Width="200" Name="pbPass" />
</DataTemplate>
</GridViewColumn.CellTemplate>

Can someone tell me ho开发者_如何学运维w to get the value of pbPass for say ListViewItem no 3?


The value should be in PasswordBox.Password

From code-behind, you'll probably want to loop through MyListBox.Items, get the Container for each Item using MyListBox.ItemContainerGenerator, find the PasswordBox named pbPass in each ListBoxItem, and read the Password property

0

精彩评论

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