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.

  • 相关阅读:
    分布式框架---Dubbox 简介
    MySql 多表查询
    MySql 增删改查
    redis
    spring security 自定义登录页面及从数据库查询账户登录
    java数据结构-
    Maven-
    有关多行相同数据,只显示在第一行的实现
    javaWEB的第一次MVC之旅
    JavaWeb中的 请求转发 和 重定向
  • 原文地址:https://www.cnblogs.com/luoyaoquan/p/2116011.html
Copyright © 2011-2022 走看看