tryCurrencyManager cm = (CurrencyManager)BindingContext[dataGrid1.DataSource, dataGrid1.DataMember];dataGrid1.CurrentRowIndex = cm.Position;
解决方案 »
- (WINDOWS API)mouse_event问题
- [分享]更新上一次发的socket传大文件(加了断点续传)
- 为啥这样呢会
- 各位牛人,小弟又来请教了!
- 有没有用Odp.net做开发的,知道如何返回在oracle中自定义的类型,然后在c#中接收呢?
- winform中如何关闭子窗口frmData的同时,执行主窗口的方法?
- C#写的类,添加了XML注释(///<summary> myremark ///</summary> ) ,为什么编译为dll后,这些函数参数注释却没有显示?
- 数字格式
- 小弟打算学c#,各位大侠推荐几本好书
- 在C#里如何用程序自动生成一篇WORD文档?
- 怎样在VB中求本地机的网卡号?
- 在线等待!如何在Btn_Click事件中,用代码使绑定到DataTable的DataGrid的当前行移到最下面的“新增”位置上?
DataRow dr = ((DataRowView)cm.Current).Row; after sorting, find the position of this DataRow, something likeint n=0;
DataView dtView = (DataView)dataGrid1.DataSource;
for (int i=0; i < dtView.Count;i++)
if (((DataRowView)dtView[i]).Row == dr)
n=i;dataGrid1.CurrentRowIndex = n;
if (this.dataGrid1.HitTest(p).Type==DataGrid.HitTestType.ColumnHeader)
{
BindingManagerBase bm= this.BindingContext[this.dataGrid1.DataSource,this.dataGrid1.DataMember];
this.dataGrid1.CurrentRowIndex=bm.Count-this.dataGrid1.CurrentRowIndex-1;
}
有没有办法不用遍历?
to: dy_2000_abc(芝麻开门)
你的办法,对其中一列排序过之后,再次排序该列,是可以的,但是其他情况不灵啊。