develop

DevExpress GridControl 특정 셀에 핸드 커서 표시

파드파드 2023. 11. 13. 10:41
반응형

public static void GridBandColumnHandCursor(BandedGridView view, params string[]fieldName) {
    view.MouseMove += (sender, e) => HandCursor_BandedGridView_MouseMove(sender, e, fieldName);
}


private static void HandCursor_BandedGridView_MouseMove(object sender, MouseEventArgs e, params string[]fieldName) {
    BandedGridView view = sender as BandedGridView;
    if (view != null) {
        DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo hitInfo = view.CalcHitInfo(e.X, e.Y);
        if (hitInfo.InRowCell == true && Comm.IN(hitInfo.Column.FieldName, fieldName)) {
            view.GridControl.Cursor = Cursors.Hand;
        } else {
            view.GridControl.Cursor = Cursors.Default;
        }
    }
}

반응형