BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Query-1 How can I get the code to select the cell with cursor blinking at the end position? |
If you want to set the record with cursor at end position of the cell, you can use the CurrentCell.MoveTo method instead of using SetCurrent method of record. After moving the CurrentCell to particular cell, you can set the cursor at end position by using CurrentCell.Renderer. Please make use of below code,
Code Snippet: private void moveBtn_Click(object sender, EventArgs e) { //Set your needed column index int colIndex = this.gridGroupingControl1.TableDescriptor.FieldToColIndex(0);
//Getting the record rowIndex based on its position int rowIndex = this.gridGroupingControl1.Table.Records[0].GetRowIndex();
//Moving the current cell this.gridGroupingControl1.TableControl.CurrentCell.MoveTo(rowIndex, colIndex, Syncfusion.Windows.Forms.Grid.GridSetCurrentCellOptions.SetFocus); this.gridGroupingControl1.Focus();
//Setting the cursor at end position of cell if (this.gridGroupingControl1.TableControl.CurrentCell.Renderer is GridTextBoxCellRenderer) { GridTextBoxCellRenderer renderer = this.gridGroupingControl1.TableControl.CurrentCell.Renderer as GridTextBoxCellRenderer; renderer.TextBox.SelectionStart = renderer.TextBox.Text.Length; } } |
Query-2 How can I get the code to highlight the CellValue? |
If you want to highlight the cellvalue in cell, you can use renderer.TextBox.SelectAll() method instead of using renderer.TextBox.SelectionStart.
Code Snippet: //Highlighting the cellvalue if (this.gridGroupingControl1.TableControl.CurrentCell.Renderer is GridTextBoxCellRenderer) { GridTextBoxCellRenderer renderer = this.gridGroupingControl1.TableControl.CurrentCell.Renderer as GridTextBoxCellRenderer; renderer.TextBox.SelectAll(); } |