c# - OpenFileDialog.ShowDialog() raises InvalidOperationException in Silverlight -
below code snippet.
openfiledialog dialog = new openfiledialog() { filter = "excel files (*.xlsx;*.xls;)|*.xlsx;*.xls;", }; if (dialog.showdialog().value == false) { iscommiting = false; return; } else { items.clear(); } when dialog.showdialog() called, invalidoperationexception raised message "showdialog failed.".
i've found related article google search. http://social.msdn.microsoft.com/forums/en-us/silverlightmvvm/thread/6ae9454b-b5ba-4286-959f-6dc4d347ebf7/
this article multi-selection in open file dialog. didn't set multiselect property true. problem doesn't happen often, , cannot reproduced.
is there suffered same problem?
can try:
openfiledialog dialog = new openfiledialog() { filter = "excel files (*.xlsx,*.xls)|*.xlsx,*.xls" }; if (dialog.showdialog() == false) { iscommiting = false; return; } else { items.clear(); }
Comments
Post a Comment