0

I am using a Xtra Grid Control (Dev express 11.2). All columns are Read Only

AllowEdit = false

and I have created a function witch user can make Right-Clickand choose edit in a column, then this column if is 'amaColumn' or 'phoneColumn' then change to AllowEdit=true; My Code is bellow

private void SetFocusedColumnOptionAllowEdit(bool allowEdit) 
{
     try 
     {                
        GridColumnCollection column = mainGridView.Columns;
        GridColumn focusedColumn = column.View.FocusedColumn;
        switch (focusedColumn.Name) 
        {

            case "amaColumn":
            case "phoneColumn":
                 focusedColumn.OptionsColumn.AllowEdit = allowEdit;
                 break;
         }
     }
     catch (Exception ex) {
        _logger.ErrorException("SetFocusedColumnOptionAllowEdit", ex);
     }  
}

But then to that I want to pu the cursor to flashing in the end of text without extra click in these columns. Is it possible?

if yes how can to that in c#?

Can anyone help me? Thank you!

A. Zalonis
  • 1,599
  • 6
  • 26
  • 41

1 Answers1

1

You need to open editor first. Then you will be able to put a cursor at an appropriate position:

mainGridView.ShowEditor();
TextEdit editor = (TextEdit)mainGridView.ActiveEditor();
editor.SelectionStart = editor.Text.Length - 1;
editor.SelectionLength = 0;
Uranus
  • 1,690
  • 1
  • 12
  • 22