Unplanned
Last Updated: 19 Jun 2019 09:46 by ADMIN
Dimitri
Created on: 18 Jun 2019 12:42
Category: GridView
Type: Bug Report
1
Autosize exclude filter row and header row

In my gridview need support of different heights of rows. I solved it with the autosize property.

But now I have a side action that the header row and filter row also react to the autosize property.

Attached you can see this behaviour...

Here my code:

Grid.MasterView.TableFilteringRow.MinHeight = 40
Grid.AutoSizeRows = True

Is there a chance to separate data rows from filter and header row?

 

Regards,

Dimitri

Attached Files:
3 comments
ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 19 Jun 2019 09:46
Hello, Dimitri,

I was able to replicate the undesired behavior on my end. 

The MasterView.TableHeaderRow.MinHeight is respected even though the AutoSizeRows property is set to true. However, for the TableFilteringRow its MinHeight is not respected and the height is reset to the auto-sized height when the editor is initialized. It seems odd.

I have logged it in our feedback portal by making this thread public. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.

Currently, the possible solution that I can suggest is to specify the minimum height of the filter row element in the ViewCellFormatting event: 

Private Sub RadGridView1_ViewRowFormatting(sender As Object, e As Telerik.WinControls.UI.RowFormattingEventArgs) _
Handles RadGridView1.ViewRowFormatting
    If TypeOf e.RowElement.RowInfo Is GridViewFilteringRowInfo Or TypeOf e.RowElement.RowInfo Is GridViewTableHeaderRowInfo Then
        e.RowElement.RowInfo.MinHeight = 40
        e.RowElement.MinSize = New Size(0, 40)
    End If
End Sub

  
I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Attached Files:
Dimitri
Posted on: 19 Jun 2019 06:36

Hello Dess,

thank you for your answer, but unfortunately your code doesn't work.

Here is my code:

Public Class Form1
    Public Sub New()
        InitializeComponent()
        Grid.MasterView.TableFilteringRow.MinHeight = 40
        Grid.AutoSizeRows = True
    End Sub

    Private Sub Grid_ViewRowFormatting(sender As Object, e As Telerik.WinControls.UI.RowFormattingEventArgs) Handles Grid.ViewRowFormatting
        If TypeOf e.RowElement.RowInfo Is GridViewFilteringRowInfo Or TypeOf e.RowElement.RowInfo Is GridViewTableHeaderRowInfo Then
            e.RowElement.RowInfo.MinHeight = 40
        End If
    End Sub

End Class

Attached I recorded the issue...

Regards,

Dimitri

Attached Files:
ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 19 Jun 2019 05:52
Hello, Dimitri,
           
Indeed, setting the AutoSizeRows property to true will affect not only the data rows, but the system rows as well. However, you can specify the minimum height for the header or filtering row by using the ViewRowFormatting event as it is demonstrated below:

Sub New()
    InitializeComponent()
    Me.RadGridView1.AutoSizeRows = True
    Me.RadGridView1.EnableFiltering = True
End Sub
 
Private Sub RadGridView1_ViewRowFormatting(sender As Object, e As Telerik.WinControls.UI.RowFormattingEventArgs) _
Handles RadGridView1.ViewRowFormatting
    If TypeOf e.RowElement.RowInfo Is GridViewFilteringRowInfo Or TypeOf e.RowElement.RowInfo Is GridViewTableHeaderRowInfo Then
        e.RowElement.RowInfo.MinHeight = 40
    End If
End Sub

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.