![](/img/trans.png)
[英]Databinding within Cell templated Devexpress:GridControl not working
[英]DevExpress select text range within a TextEdit repositoryItem cell of a GridControl
有人知道如何在GridControl的TextEdit repositoryItem單元格中選擇文本范圍嗎?
以下代碼選擇單元格的全文:
gvMemoryMap.FocusedRowHandle = 4;
gvMemoryMap.FocusedColumn = gvMemoryMap.VisibleColumns[1];
gvMemoryMap.ShowEditor();
gvMemoryMap.ActiveEditor.SelectAll();
但我想在Winforms控件中選擇一個文本范圍以及someTextBox.Select(2,5)。
我得到了與你一樣滿足相同要求的DevExpress線程 。 根據您的要求檢查修改后的代碼,並遵循以下方法。
將您的ActiveEditor
為DevExpress.XtraEditors.TextEdit
,您就可以像在TextEdit Control
。
gvMemoryMap.FocusedRowHandle = 4;
gvMemoryMap.FocusedColumn = gvMemoryMap.VisibleColumns[1];
gvMemoryMap.ShowEditor();
(gvMemoryMap.ActiveEditor as DevExpress.XtraEditors.TextEdit).Select(0, 1);
經過測試和工作..希望這有幫助..
請使用以下方法:
TextEdit textEdit = gvMemoryMap.ActiveEditor as TextEdit;
textEdit.Select(2, 3);
相關幫助主題: TextEdit.Select(Int32,Int32)方法
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.