zoukankan      html  css  js  c++  java
  • DevExpress GridView限制列只允许输入数字

    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Views.Grid;
    
    private void gridView1_KeyPress(object sender, KeyPressEventArgs e) {
        GridView view = sender as GridView;
        string s = "0123456789";
        if (view.FocusedColumn.FieldName == "CustomerID" && s.IndexOf(e.KeyChar) >= 0)
            e.Handled = true;
    }
    private void gridControl1_EditorKeyPress(object sender, KeyPressEventArgs e) {
        GridControl grid = sender as GridControl;
        gridView1_KeyPress(grid.FocusedView, e);
    }
  • 相关阅读:
    CF1480
    网络编程中常见地址结构与转换(IPv4/IPv6)
    inet_pton, inet_ntop
    mktime 夏令时
    C/C++中volatile关键字详解
    STL之vector容器详解
    Linux学习--gdb调试
    Linux编程基础——GDB(设置断点)
    FTP模式简式:PORT/PASV/EPRT/EPSV
    strchr和strstr 函数
  • 原文地址:https://www.cnblogs.com/cainiaoji/p/1997961.html
Copyright © 2011-2022 走看看