Current filter:
                                You should refresh the page.
                                0
                                  • Hello,

                                    Currently I am using a 'RepositoryItemTextEdit' for one of the columns in GridControl (GridView). I want to select(highlight) only text from 0 to n and NOT all the characters for the string.

                                    I am aware that we can do this for 'TextEdit' by using select(0,n) method. Also, I am aware that for GridControl we can use 'currentView.ActiveEditor.SelectAll()' to select the whole text. I understand that for 'BaseEdit' we cannot have the Select(0,n) method since BaseEdit can be anything PictureEdit, TextEdit, ImageEdit etc.

                                    Kindly, suggest a way to accomplish this or correct me If I am wrong.

                                    Thanks.

                                0

                                Hi Jennie,

                                Thank you for contacting us.
                                Do you want to highlight charters only in the active editor or in all cells?
                                In the first case, your approach is correct. You need to cast the ActiveEditor to the TextEdit and call its Select method.
                                If you need to highlight text in all cells, you cannot use editor's methods, because an inplace editor exists only in the focused cell. Other cells are painted directly on the GridControl. In this scenario, you need to use the Custom Draw capabilities.

                                Does this information help?

                                See Also:
                                Why doesn’t the RepositoryItem have the methods that the editor has?
                                How to highlight a text in cells

                                Thanks
                                Dimitros

                                0

                                Hello,

                                Thanks for the response. It works fine now. I was missing the Casting to "TextEdit" part and then use Select(0,n) method.

                                Thanks.

                                0

                                You're welcome, Jennie :)

                                Dimitros

                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.