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

Dynamic grouping on columns with null values

0 Answers 80 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 14 Feb 2017, 12:11 PM

when creating groups dynamically to a grid with template columns, the application is throwing an unhandled exception error if the groupbe by column holds null values.  If the underlying data source is modified to replace null values with "" then the grid functions fine.  The way its to behave the columns to be grouped by can change so I need a way to handle nulls in the application code.  Does anyone have a solution for this?

 

 

                Dim ex As New GridGroupByExpression()
                For Each dRow As DataRow In objDS.Tables(2).Rows
                    Dim field1 As New GridGroupByField()
                    field1.FieldName = dRow("Column_Name")
                    field1.HeaderText = dRow("display_name")
                    field1.SortOrder = dRow("Sort_Order")
                    ex.GroupByFields.Add(field1)
                    ex.SelectFields.Add(field1)

                Next

                EditGrid.MasterTableView.GroupByExpressions.Add(ex)

 

No answers yet. Maybe you can help?

Tags
Grid
Asked by
John
Top achievements
Rank 1
Share this question
or