BetFitColumns and BestFit Not Working in ChildGrivdViewTemplates

12 posts, 0 answers
  1. Tom Chien
    Tom Chien avatar
    125 posts
    Member since:
    Jun 2009

    Posted 21 Oct 2009 Link to this post

    Calling BetFitColumns (or BestFit on each Column) is not working in ChildGrivdViewTemplates.  It just sets all Column Widths to some default width (i.e. 50).  I'm binding to a DataSet filled by a SqlDataAdapter.

    2009Q2 (2009.2.9.729), VS 2005 (v8.0.50727.762 SP.050727-7600), .Net2 (2.0.50727), XP SP3, Core2Duo 2.99GHZ with 3GB.
  2. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 23 Oct 2009 Link to this post

    Hi Tom,

    Yes this is a known issue. We will try to address it in the upcoming release. Thank you for reporting it.

    All the best,
    Jack
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Tom Chien
    Tom Chien avatar
    125 posts
    Member since:
    Jun 2009

    Posted 06 Nov 2009 Link to this post

    Thanks, I verified the this has been fixed in Q3 2009 (for the most part*).

    *However, I have a Column that's bound to a SQL Server NText Column via a DataSet fillied by a SqlDataAdapter.  It contains multiple, CR+LF - delimited text lines.  RadGridView shows it with not only too narrow of a Column Width but also too short of a Row Height.

    Telerik WinForms 2009Q3 (2009.3.9.1103), VB, VS 2005 (v8.0.50727.762 SP.050727-7600), .Net 2.0 (2.0.50727), XP SP3, 3GB, 2.99GHZ, Core2Duo.

    P.S. I liked how you copied my misspelling into your Release Notes.  I'm honored. ;)
  5. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 09 Nov 2009 Link to this post

    Hi Tom Chien,

    The column width in RadGridView is fixed and can be changed manually by changing the Width property or by using BestFit method of GridViewColumn. The row height is fixed too unless you set AutoSizeRows to true. However, you should set Multiline property of GridViewTextBoxColumn to true if you want to edit cells containing multiple rows of text. Set also WrapText to true to enable text wrapping. I hope this helps.

    All the best,
    Jack
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Tom Chien
    Tom Chien avatar
    125 posts
    Member since:
    Jun 2009

    Posted 09 Nov 2009 Link to this post

    "RadGridView.AutoSizeRows  = True" helps a lot.

    However:

    1. It removes all the Row Height padding that's there (when using the default Font and Row Height) when it's False, so everything looks really scrunched.  Is there like a AutoSizeRow Pad Height Property or Event I could handle to adjust the Row Height after it's been Auto-Sized?

    2. It still cuts off part of the last line on multi-line Rows.  It's like it thinks it needs less Row Height than is needed to display all lines.  When I manually adjust the Row Height at run-time via the u.i., it removes the ellipsis ("...") from the end of the previous line when the last line is only about half visible.  This is with / without WrapText and / or Multiline set to True.  BTW, I had to CType (Master/Child)GridViewTemplate to a GridViewTextBoxColumn to access Multiline.

  7. Tom Chien
    Tom Chien avatar
    125 posts
    Member since:
    Jun 2009

    Posted 09 Nov 2009 Link to this post

    Correction to #2: I meant to say: "BTW, I had to CType (Master/Child)GridViewTemplate.Columns(x) to a GridViewTextBoxColumn to access Multiline.".
  8. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 12 Nov 2009 Link to this post

    Hi Tom Chien,

    Regarding your questions:

    1. Yes, you should handle ViewCellFormatting and set the desired padding. For example:

    Private Sub radGridView1_ViewCellFormatting(ByVal sender As Object, ByVal e As CellFormattingEventArgs)
        e.CellElement.Padding = New Padding(5)
    End Sub

    2. We found that in some cases row height is not calculated correctly when loading the form. The issue will be addressed in our upcoming service pack. However, it is possible that you are facing a different issue. Please describe your case in detail and if possible send us a sample application that reproduces it (in a new support ticket). This will ensure that the issue will be addressed.

    You should cast the column, because the Multiline property is specific for GridViewTextBoxColumn. The Columns collection contains GridViewDataColumn objects.

    Should you have further questions, please write us back.

     
    Kind regards,
    Jack
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  9. Tom Chien
    Tom Chien avatar
    125 posts
    Member since:
    Jun 2009

    Posted 16 Nov 2009 Link to this post

    1. Wellll, that worked to increase the post-auto-sized Row Height .  However, depending on the amount of padding, it cuts off part to all of the my SummaryRowsTop or SummaryRowsTop.
  10. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 18 Nov 2009 Link to this post

    Hi Tom, yes we know about this issue. It will be addressed in our upcoming service pack. You can work around it by using a custom summary row element. Please consider the code snippet below:

    Private Sub radGridView1_CreateRow(ByVal sender As Object, ByVal e As GridViewCreateRowEventArgs)
        If e.RowType Is GetType(GridSummaryRowElement) Then
            e.RowType = GetType(CustomSummaryRow)
        End If
    End Sub
     
    Public Class CustomSummaryRow
        Inherits GridSummaryRowElement
        Protected Overloads Overrides Function MeasureOverride(ByVal availableSize As SizeF) As SizeF
            Return New SizeF(0, 30)
        End Function
    End Class

    Sincerely yours,
    Jack
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  11. Miljenko
    Miljenko avatar
    4 posts
    Member since:
    Oct 2007

    Posted 29 Sep 2010 Link to this post

    Hi Telerik

    I Have the same problems with BwatFIt property
    corelate with

    =========================================
    2. We found that in some cases row height is not calculated correctly when loading the form. The issue will be addressed in our upcoming service pack
    =========================================

    but we don`t have account support any more. what we can do to get this BUG corresction

    Thanks
  12. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 29 Sep 2010 Link to this post

    Hello Mijenko,

    If they acknowledged that there is an issue with this, and it will be fixed in the upcoming releases there is not much you can do, maybe just use a workaround until then, but rest assured that if it's a known bug it will be fixed, but sadly not instantly...

    Best Regards,
    Emanuel Varga
  13. Nikolay
    Admin
    Nikolay avatar
    1804 posts

    Posted 04 Oct 2010 Link to this post

    Emanuel is correct, and this is one of the reasons to offer support packages. However, since we acknowledge that this is an issue on our end, please open a new support ticket from the account of the purchase holder. This will allow us to discuss the possible upgrade options.

    Greetings,
    Nikolay
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready