Hou*_*man 2 .net c# silverlight wpf datagrid
使用Silverlight/WPF Datagrid并向现有集合添加新行时,如何跳转到特定单元格的编辑模式,以便向用户提示是否需要立即填写此字段?
非常感谢,
这就是我能够在SL 5 RC中使用它的方法.
dg.ItemsSource.Add(data);
dg.SelectedItem = data; //set SelectedItem to the new object
dg.ScrollIntoView(data, dg.Columns[0]); //scroll row into view, for long lists, setting it to start with the first column
dg.Focus(); //required in my case because contextmenu click was not setting focus back to datagrid
dg.BeginEdit(); //this starts the edit, this works because we set SelectedItem above
Run Code Online (Sandbox Code Playgroud)
希望这可以帮助.
| 归档时间: |
|
| 查看次数: |
4954 次 |
| 最近记录: |