This is a migrated thread and some comments may be shown as answers.

BetFitColumns and BestFit Not Working in ChildGrivdViewTemplates

11 Answers 216 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tom Chien
Top achievements
Rank 1
Tom Chien asked on 21 Oct 2009, 11:39 AM
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.

11 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 23 Oct 2009, 08:35 AM
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.
0
Tom Chien
Top achievements
Rank 1
answered on 07 Nov 2009, 12:49 AM
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. ;)
0
Jack
Telerik team
answered on 09 Nov 2009, 03:42 PM
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.
0
Tom Chien
Top achievements
Rank 1
answered on 09 Nov 2009, 06:47 PM
"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.

0
Tom Chien
Top achievements
Rank 1
answered on 09 Nov 2009, 06:54 PM
Correction to #2: I meant to say: "BTW, I had to CType (Master/Child)GridViewTemplate.Columns(x) to a GridViewTextBoxColumn to access Multiline.".
0
Jack
Telerik team
answered on 12 Nov 2009, 03:33 PM
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.
0
Tom Chien
Top achievements
Rank 1
answered on 16 Nov 2009, 08:29 PM
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.
0
Jack
Telerik team
answered on 18 Nov 2009, 01:38 PM
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.
0
Miljenko
Top achievements
Rank 1
answered on 29 Sep 2010, 10:51 AM
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
0
Emanuel Varga
Top achievements
Rank 1
answered on 29 Sep 2010, 02:21 PM
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
0
Nikolay
Telerik team
answered on 04 Oct 2010, 09:26 AM
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
Tags
GridView
Asked by
Tom Chien
Top achievements
Rank 1
Answers by
Jack
Telerik team
Tom Chien
Top achievements
Rank 1
Miljenko
Top achievements
Rank 1
Emanuel Varga
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or