The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I tried the following codes, it only move the cursor from start to end, not select all of text:
GridCurrentCell cc = this.dgrLookup.CurrentCell;
cc.BeginEdit();
GridTextBoxControl tb = cc.Renderer.Control as GridTextBoxControl;
if(tb != null)
{
tb.SelectionStart = 0;
tb.SelectionLength = tb.Text.Length;
}
ADAdministrator Syncfusion Team January 20, 2005 05:26 AM UTC
Instead of
tb.SelectionStart = 0;
tb.SelectionLength = tb.Text.Length;
try
tb.SelectAll();
DBDavid BosakJanuary 20, 2005 07:22 AM UTC
The same as the result above.
private void dgrLookup_CellClick(object sender, Syncfusion.Windows.Forms.Grid.GridCellClickEventArgs e)
{
GridCurrentCell cc = this.dgrLookup.CurrentCell;
cc.BeginEdit();
GridTextBoxControl tb = cc.Renderer.Control as GridTextBoxControl;
if(tb != null)
{
//dgrLookup.Focus();
//tb.SelectionStart = 0;
//tb.SelectionLength = tb.Text.Length;
tb.SelectAll();
}
}
ADAdministrator Syncfusion Team January 20, 2005 12:34 PM UTC
There is a property that you can set so that all the text is selected anytime the cell becomes current.
this.gridDataBoundGrid1.ActivateCurrentCellBehavior = GridCellActivateAction.SelectAll;
But this will select all whether you click the cell or move with the cursor keys. To only do it whne you click, use your code above, but also add e.Cancel = true. Without this, the grid continues to process the click which will do whatever the ActivateCurrentCellBehavior indicates.