简体   繁体   English

WPF DataGrid行选择问题

[英]WPF DataGrid Row Selection Issue

I have one text box, DataGrid and save button which is calling WCF service for saving the changed value of the Textbox.Before giving call to wcf service the form (main grid) is disabled and enabled again when wcf call is complete . 我有一个文本框,DataGrid和保存按钮,该按钮正在调用WCF服务以保存Textbox的更改的值。在对wcf服务进行调用之前,已禁用并在wcf调用完成后再次启用表单(主网格)。 I used threading to call wcf service. 我使用线程调用wcf服务。 Pattern used is MVVM. 使用的模式是MVVM。

My problem is When the form is enabled after completing the wcf service process the Wpf datagrid lost its row selection (means no row is selected in the DataGrid not even default 0). 我的问题是,在完成wcf服务过程后启用表单时,Wpf Datagrid失去了行选择(意味着在DataGrid中没有选择行,甚至没有默认值0)。

Any kind of help is appreciated!!! 任何帮助表示赞赏!!! Thanks :) 谢谢 :)

尝试不要禁用datagrid,但要这样做:

datagrid.IsHitTestVisible = false.

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

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