简体   繁体   中英

Editable Data Grid tab out

I am working on WPF , editable data grid. I am having problem, when the user tabs out from the last cell of the grid, data grid is automatically creating new row. I want to restrict the data grid, as when a user tabs out, in code behind it check if current row was empty( no details were entered), then don't add a new row. Please help me with this.

不知道您在哪里有问题,但希望能对您有所帮助..xaml中有datagrid的属性

<DataGrid Margin="22,187,-155,20" Name="DgStaffRoles" CanUserDeleteRows="False" CanUserAddRows="False" CanUserReorderColumns="False" CanUserResizeRows="True" CanUserResizeColumns="True"  AutoGenerateColumns="False" Grid.ColumnSpan="2"  >

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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