Resizing row

10 posts, 0 answers
  1. acola
    acola avatar
    15 posts
    Member since:
    Aug 2006

    Posted 18 Jul 2007 Link to this post

    Hello -

    I have one of my gridview columns set to wrap text. What I would like to see happen is that when the text wraps in a row, the row resizes itself to show all the text. However, it isn't doing that, so my text in the column that wrapped is all scrunched up. Is there a way to tell the grid to either resize the rows where the text in a column has wrapped, or at least, set each row to be 2 rows high?
  2. Phi
    Phi avatar
    19 posts
    Member since:
    Jun 2007

    Posted 18 Jul 2007 Link to this post

    Hi,

    I also agree this would be a good idea. Column text wrapping is much more useful if you can see all the text in the cell. Maybe something like AutoRowHeight feature would be useful.

    acomes:
    You can set double the Row height by listening to the RowFormatting event of the RadGridView.

    this.radGridView1.RowFormatting += new Telerik.WinControls.UI.RowFormattingEventHandler(this.radGridView1_RowFormatting);  
     
    private void radGridView1_RowFormatting(object sender, RowFormattingEventArgs e)  
    {  
       e.RowElement.RowInfo.Height *= 2;  
     
    But is there a way to auto-size the row height?

    Cheers
    Phi
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 19 Jul 2007 Link to this post

    Hi guys,

    Phi, thank you for the workaround, indeed it will get things done. Anne, we will suggest using the work around that Phi has posted.

    But the idea of auto resizing columns is definitely good and I have logged it for the next release. Thank you very much for the feature request.

    I have added Telerik points to your accounts for the suggestion.

     
    All the best,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Brandon
    Brandon avatar
    2 posts
    Member since:
    Apr 2007

    Posted 20 Mar 2008 Link to this post

    Jack,

    Could you confirm whether or not the auto row resize feature will be included in the next release?  We would like to use this as well.  If that can't be done, another useful feature would be to show the text that is cut off in a little tooltip after you hover the cell that contains too much text to be viewed at one time.

    Thanks,
    Brandon
  6. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 21 Mar 2008 Link to this post

    Hi Brandon,

    Thank you for this question.

    Yes, I confirm that the row auto-sizing feature will be introduced in our upcoming release Q1 2008. We will also consider implementing automatic tooltips as you suggested.

    Let me know, if you have other questions.

    Sincerely yours,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Bob
    Bob avatar
    2 posts
    Member since:
    Aug 2007

    Posted 03 May 2008 Link to this post

    How does one accomplish the automatic row sizing with multiline and auto-wrapped text in the Q1 2008 release?  I do not see anything obvious on either the RadGridView or GridViewTextBoxColumn.

    Thanks.
  8. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 07 May 2008 Link to this post

    Hi Bob,

    Thank you for writing.

    You should set the AutoSizeRows property of RadGridView to true in order to turn on the automatic row sizing. To enable column wrapping, set the WrapText property of GridViewColumn to true.

    Consider the following code sample:

    this.radGridView1.AutoSizeRows = true
    this.radGridView1.Columns["Description"].WrapText = true
     

    I hope this helps. Please let us know whether that lets you achive the desired functionality. Do not hesitate to write me, if you have other questions.

    Greetings,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. Niloofar
    Niloofar  avatar
    24 posts
    Member since:
    Jan 2015

    Posted 25 Mar 2015 Link to this post

    Hi, 
    I have changed rows height but after changing height, the height of the editor which is inside cell is not changed as shown in the attached file. is there any way to fit the editor in the cell after changing the row height?

    cheers
  10. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 30 Mar 2015 Link to this post

    Hello Niloofar,

    Thank you for writing.

    It is necessary to set the RadTextBoxEditor.Multiline property to true in order to stretch the editor and fill the entire row's height:
    public Form1()
    {
        InitializeComponent();
        this.radGridView1.AutoSizeRows = true;
        this.radGridView1.Columns["Description"].WrapText = true;
        this.radGridView1.CellEditorInitialized += radGridView1_CellEditorInitialized;
    }
     
    private void radGridView1_CellEditorInitialized(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
    {
        RadTextBoxEditor tbEditor = e.ActiveEditor as  RadTextBoxEditor;
        if (tbEditor != null)
        {
            tbEditor.Multiline = true;
        }
    }

    I hope this information helps. Should you have further questions, I would be glad to help.
     
    Regards,
    Dess
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  11. Niloofar
    Niloofar  avatar
    24 posts
    Member since:
    Jan 2015

    Posted 30 Mar 2015 in reply to Dess Link to this post

    Thank you for the solution, it works fine!

    Cheers,
Back to Top
UI for WinForms is Visual Studio 2017 Ready