Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
175
GroupByMode and GroupBy row description.
posted

Hi.

I have a datasource that contains a DateTime column. In the grid this column has its Style set to 'DateTime' but its GroupByMode property set to 'Date'. When I group by this column the values are grouped by date but the time is still shown in the group by rows row description.

Is this the expected behavior?

In the screen shots below it makes it look like the 2nd row has a time of 13:45 when its actually 14:45.

UltraGridGroupByMode.zip
Parents
  • 469350
    Verified Answer
    Offline posted

    Hi,

    I don't think this is the expected behavior. It seems like an oversight to me.

    I'm going to forward this thread over to Infragistics Developer support and ask them to create a case for you and write this up as a bug for developer review.

    In the mean time, it's very easy to work around it like so:


        Private Sub UltraGrid1_InitializeGroupByRow(sender As System.Object, e As Infragistics.Win.UltraWinGrid.InitializeGroupByRowEventArgs) Handles UltraGrid1.InitializeGroupByRow
            Dim dateValue As DateTime = e.Row.Value
            Dim mask As String
            Dim childRowCount As Integer = e.Row.Rows.Count
            If childRowCount = 1 Then
                mask = "{0}: {1} ({2} item)"
            Else
                mask = "{0}: {1} ({2} items)"
            End If
            e.Row.Description = String.Format(mask, e.Row.Column.Header.Caption, dateValue.ToString("d"), childRowCount)
        End Sub

Reply Children