public static void SelectCellText(GridControl grid, int row, int col)
        {
            // ref: http://www.syncfusion.com/forums/67771/select-text-programmatically-in-gridtextboxcellrenderer
            GridTextBoxCellRenderer cr = grid.CurrentCell.Renderer as GridTextBoxCellRenderer;
            TextBoxBase             tb = cr.TextBox;

            if (tb != null && tb.TextLength > 0)
            {
                tb.SelectionStart  = 0;
                tb.SelectionLength = tb.TextLength;
            }
        }
        public Form2()
        {
            InitializeComponent();
            this.gridControl1.GridVisualStyles = Syncfusion.Windows.Forms.GridVisualStyles.Metro;
            gridControl1.ThemesEnabled         = true;
            GridTextBoxCellRenderer ren = gridControl1.CellRenderers["TextBox"] as GridTextBoxCellRenderer;

            gridControl1.TableStyle.VerticalAlignment = GridVerticalAlignment.Middle;
            gridControl1.RowCount = 10;
            gridControl1.ColCount = 9;
            this.gridControl1.DefaultRowHeight = 150;
            this.gridControl1.ColWidths[9]     = 200;
            CreateTable();
            this.gridControl1.PopulateHeaders(GridRangeInfo.Cells(0, 1, 0, this.gridControl1.ColCount), dt);
            this.gridControl1.ColStyles[9].CellType = GridCellTypeName.Image;
            for (int i = 1; i <= this.gridControl1.RowCount; i++)
            {
                for (int j = 1; j <= this.gridControl1.ColCount; j++)
                {
                    this.gridControl1[i, j].CellValue = dt.Rows[i - 1][j - 1];
                }
            }
        }
Пример #3
0
 /// <summary>
 /// Initializes a <see cref="EllipsisCellButton"/> and associates it with a <see cref="GridTextBoxCellRenderer"/>
 /// </summary>
 /// <param name="control">The <see cref="GridTextBoxCellRenderer"/> that draws this cell button element.</param>
 public EllipsisCellButton(GridTextBoxCellRenderer control)
     : base(control)
 {
 }
Пример #4
0
 /// <summary>
 /// Initializes a <see cref="ButtonEditCellButton"/> and associates it with a <see cref="ButtonEditCellRenderer"/>
 /// </summary>
 /// <param name="control">The <see cref="ButtonEditCellRenderer"/> that draws this cell button element.</param>
 public ButtonEditCellButton(GridTextBoxCellRenderer control)
     : base(control)
 {
 }
Пример #5
0
 public BrowseButton(GridTextBoxCellRenderer control)
     : base(control)
 {
 }