zoukankan      html  css  js  c++  java
  • *****How to scroll in the grid when editing data in a cell

    How to scroll in the grid when editing data in a cell

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

    Hi,


    I would like to know how can I allow to scroll the grid when I'm editing a cell. Currently the scroll doesn't work

    Thanks

    Christophe
    <-     Reviewed by DevExpress Team         2006/12/19 6:44:05
    <-     Processed (Answered) by DevExpress Team         2006/12/19 9:33:49

    Hi Christophe,

    Sorry, this is impossible. The cell editor is a separate control shown over the grid. So the scrolling is blocked to avoid visual separation of the editor and the edited cell. Please explain, why you need this functionality.

    Thanks,
    Michael.
    ->     Reactivated by Jürg Furthmüller         2006/12/19 11:29:40

    Because I'm currently implementing an application that already existed on another platform and had this functionnality.

    Is it possible to emulate this behaviour? for example can we handle the event MouseWheel on a gridView in order to allow scrolling the grid while editing a cell? I mean, if I want to scroll the grid then the current edited cell's editor is closed and the grid is scrolled.

    I would like to be able to scroll with the mouse wheel through the rows of the grid even if there is no vertical scrollbar. Is it possible? The focus should be placed on the next row above/below the current focused one when scrolling one step up/down. And if there is a vertical scrollbar, this one should be moved only when the next row is not visible. This is a common behaviour. Currently the scrolling of the grid moves the vertical scrollbar and not the focus of the current row, is it just a option to set correctly or should I implement this functionality?
    Thanks
    Christophe
    <-     Processed (Answered) by DevExpress Team         2006/12/19 16:23:44

    Hi Christophe,

    The XtraGrid doesn't provide this functionality. However, it can be implemented by handling the GridView.MouseWheel event. The base scrolling behavior can be disabled by creating the DXMouseEventArgs and setting the Handled property to True. Please use the following code:

            void gridView1_MouseWheel(object sender, MouseEventArgs e)
            {
                DevExpress.XtraGrid.Views.Grid.GridView view = sender as DevExpress.XtraGrid.Views.Grid.GridView;
                view.CloseEditor();
                if (e.Delta < 0)
                    view.MoveNext();
                else if(e.Delta > 0)
                    view.MovePrev();
                DevExpress.Utils.DXMouseEventArgs.GetMouseArgs(e).Handled = true;
            }

    Thanks,
    Michael.

  • 相关阅读:
    h.264并行解码算法2D-Wave实现(基于多核共享内存系统)
    h.264并行解码算法2D-Wave实现(基于多核非共享内存系统)
    h.264 去块滤波
    h.264并行解码算法分析
    phpstrom 快速定位到当前编辑文件
    省市区多级联动js代码
    原生js开发,无依赖、轻量级的现代浏览器图片懒加载插件,适合在移动端开发使用
    Let’s Encrypt 通配符证书,泛域名https证书申请配置
    js 获取链接参数的方法
    秒杀、抢购解决方案
  • 原文地址:https://www.cnblogs.com/luoyaoquan/p/2116011.html
Copyright © 2011-2022 走看看