更新时间:2023-12-06 17:19:04
引用:
在WPF DataGrid中单击单击 [ WPF datagrid选择的行单击事件 [
Refer:
Single click edit in WPF DataGrid[^]
WPF datagrid selected row clicked event[^]
<grid grid.column="1" grid.row="1" height="177" horizontalalignment="Left" margin="10,12,0,0" name="grid3" verticalalignment="Top" width="595" datacontext="{Binding ElementName=DataEntrydataGrid, Path=SelectedItem}">
<grid.rowdefinitions>
<rowdefinition height="48*" />
<rowdefinition height="129*" />
</grid.rowdefinitions>
<grid.columndefinitions>
<columndefinition width="128*" />
<columndefinition width="467*" />
</grid.columndefinitions>
<textblock height="23" horizontalalignment="Left" margin="40,24,0,0" name="textBlock8" text="LastName" verticalalignment="Top" />
<textbox grid.column="1" height="23" horizontalalignment="Left" margin="9,21,0,0" name="LastNametextBox" verticalalignment="Top" width="120" text="{Binding Path=LastName}" />
</grid>
我只是使用数据绑定来完成的.无需编写任何代码
I just did it using databinding. no need to write any code
以下是一些获取示例的示例:
http://social.msdn.microsoft.com/Forums/zh/wpf/thread/a5fd5413-f055-4b56-83af-6d6bdb1d6fe9 [
Here are some examples of how you could get it:
http://social.msdn.microsoft.com/Forums/en/wpf/thread/a5fd5413-f055-4b56-83af-6d6bdb1d6fe9[^]