zoukankan      html  css  js  c++  java
  • SelectRow seems to not work

    from:
    http://www.devexpress.com/Support/Center/p/B191028.aspx

    Hi,

    I have a Grid, on which a user can change certain fields, like on a right click they can increase a counter on the row by one (just changes a field by + 1, nothing else). Now when the user does this, the RowHandle seems to increment by 1. So if I was on row 0, it then goes to the second row in the grid (i.e. row handle 1). I've tried to write code to prevent this, by doing the following:

    //From the right click event we get the row
    var menuInfo = grdView.GridMenu.MenuInfo as GridCellMenuInfo;
    var listIndex = grdDetail.GetRowListIndex(menuInfo.Row.RowHandle.Value);

    ... all the changing of stuff happens...

    grdView.SelectRow(grdDetail.GetRowHandleByListIndex(listIndex));

    (also tried with grdView.BeginSelection(); and grdView.EndSelection(); around this line, no change.)

    But having debugged the code, everything looks fine, the listIndex is correct, and the GetRowHandleByListIndex returns the correct RowHandle, just just the SelectRow that seems to not be working as it should.

    Or am I missing something?

    Thanks.
    <-     Reviewed by DevExpress Team         2010/9/15 12:44:09
    <-     Processed (Can't Reproduce) by DevExpress Team         2010/9/15 13:09:44

    Hi Richard,

    Thank you for the report.

    I'm afraid I do not quite understand under which conditions the situation you described occurs and how to reproduce it. However, I think I've found the cause of the problem. In fact, the SelectRow method works in MultiSelect mode only (please look at the Multiple Row Selection help topic to learn more). If that is not the case, you should manipulate the GridView's focused row instead. Please modify the code as follows:

    [C#]
    grdView.FocusedRowHandle = grdDetail.GetRowHandleByListIndex(listIndex);

    If my guess is valid, this should help you address the issue.

    Thanks,
    Vito

  • 相关阅读:
    js正则表达式,判断字符串是否以数字组结尾,并取出结尾的数字
    js中的正则表达式入门
    jQuery获取元素对象本身的html
    正则表达式,求判断字符串是否以数字组结尾,并取出结尾的数字 正则表达式
    行为树的设计与实现
    BMFONT 字体制作
    VMware 9.0.1安装Mac OS X Mountain Lion 10.8.2
    XCODE修改IOS应用的名称
    Xcode 生成 ipa包
    Xcode 打包 ipa 包
  • 原文地址:https://www.cnblogs.com/luoyaoquan/p/2125335.html
Copyright © 2011-2022 走看看