Reputation: 159
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
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