deb*_*gme 3 sorting infragistics ultrawingrid bindingsource
我有一个使用bindingSource的Infragistics UltraGrid.
如果我在绑定列表中添加一个新对象,它会在网格底部添加一行,如果没有用户定义的排序则可以.
问题是,如果用户单击列标题对网格进行排序,是否有办法让新行以正确的排序顺序显示而不是始终位于底部?
重新排序每个插入的所有行太昂贵.
似乎有点贫民窟.Infragistics支持还表明RefreshSortPosition()方法是唯一的选择.
// Add to binding list which will trigger a row to be added to the bound ultragrid.
this.bindingList.Add(new Person("Smith", "John"));
// Get length since we know this will always be added to the end
int length = this.ultraGrid.Rows.All.Length;
// Get it to sort
this.ultraGrid.Rows[length - 1].RefreshSortPosition();
Run Code Online (Sandbox Code Playgroud)
为了提高效率,您可以通过禁用重绘等方式来聪明,然后在一批订单等之后调用一堆行上的刷新...
希望有所帮助.我很少运气搜索这个问题.