Chris
Chris

Reputation: 159

DevExpress GridView Select & replace item in Cell?

Is there a way like in Windows Textbox control to replace the selected text with in a cell? I know that an entire cell can be done with SetRowCellValue, but what about just a selection?

Thanks

Upvotes: 0

Views: 414

Answers (1)

Gosha_Fighten
Gosha_Fighten

Reputation: 3858

When a user edits a cell, an editor is used. So, you can get it using the GridView.ActiveEditor property:

if (gridView1.ActiveEditor == null || !(gridView1.ActiveEditor is TextEdit))
    return;
TextEdit editor = (TextEdit)gridView1.ActiveEditor;
editor.SelectedText = DateTime.Now.ToString();

Upvotes: 1

Related Questions