Ticket Q335512
Visible to All Users

Scroll bar in inactive editor

created 14 years ago

Hello,

  1. Is there a posibility to display scrollbar in grid cell when its editor is not activated?
    I need it because I would like to show to user that the text in cell is not fully visible and user should scroll cell's content.
  2. How to hide blinking edit cursor in cell? When grid view is editable and readonly=true I would like to hide cursor.
    Thanks,
    Yevgen

Answers

created 14 years ago (modified 6 years ago)

Hi Yevgen,
Thank you for contacting us.

  1. Please review the approaches described in the similar issues: cell scrollbar and Memoedit Scrollbar. If these approaches do not suit your needs, you can draw scrollbars manually in theCustomDrawCell event handler. You can utilize the MeasureStringmethod to determine the text size and draw a scrollbar if the text does not fit cell bounds.
  2. To hide the caret in the editor, follow the approach described in the hide caret topic (i.e. handle the ShownEditorevent).
    Attached is a small sample project that illustrates these approaches.
    Thanks,
    John.
    Comments (3)
    YL YL
    Yevgen Lisovenko 14 years ago

      Thanks for the answers.

      1. I use RepositoryItemRichTextEdit which can contain RTF-text - in this case MeasureString will not work, because text can be displayed with different fonts, styles, sizes. Is there MeasureString for RTF text ?
      2. Can you show the example how to hide caret for RepositoryItemRichTextEdit ?
        Thanks!
      YL YL
      Yevgen Lisovenko 14 years ago

        For the second question I've found answer:
        HideCaret((view.ActiveEditor as MemoEdit).MaskBox.Handle);
        ==>
        HideCaret((view.ActiveEditor as RichTextEdit).Handle);
        But the first is still actual - I cannot use MeasureString for RTF text…

        DevExpress Support Team 14 years ago

          Hi Yevgen,
          Thank you for the additional clarification.
          I should say that there are no existing methods that allow measuring RTF strings. To accomplish your task, you need to obtain the required RepositoryItemRichTextEdit's height by using the RichTextEditViewInfo.CalcHeight method and compare it to the actual cell height.
          I have created a sample project to illustrate the idea. Please let us know whether or not this solution satisfies your requirements. I'm looking forward to your feedback.
          Thank you,
          Pavel.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.