I am dynamically building a grid control on the PAGE_LOAD event. Column headers and data are all bound on the fly, nothing is static. I am using the the Filter Icons and have set AllowMultiColumnSorting = "TRUE".
I am able to sort only by one column. When I try to enter data into a second field to sort by a second field, my first sort value goes away. What is needed to keep these sort values?
Here is some code to help you understand how my grid is built.
All help is greatly appreciated!
I am able to sort only by one column. When I try to enter data into a second field to sort by a second field, my first sort value goes away. What is needed to keep these sort values?
Here is some code to help you understand how my grid is built.
All help is greatly appreciated!
Dim RadGrid1 As RadGrid = New RadGridRadGrid1.ID = "RadGrid1"RadGrid1.Width = Unit.Percentage(100)RadGrid1.PageSize = 5RadGrid1.AllowPaging = TrueRadGrid1.AllowSorting = TrueRadGrid1.AllowFilteringByColumn = TrueRadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumericRadGrid1.PagerStyle.Position = GridPagerPosition.TopAndBottomRadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.TopAndBottomRadGrid1.MasterTableView.CommandItemStyle.BackColor = Color.LightGrayRadGrid1.MasterTableView.CommandItemStyle.ForeColor = Color.BlackRadGrid1.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = FalseRadGrid1.MasterTableView.CommandItemSettings.ShowExportToPdfButton = TrueRadGrid1.MasterTableView.CommandItemSettings.ShowExportToExcelButton = TrueRadGrid1.MasterTableView.AllowFilteringByColumn = TrueRadGrid1.ExportSettings.ExportOnlyData = TrueRadGrid1.AutoGenerateColumns = FalseRadGrid1.Skin = "MetroTouch"RadGrid1.BorderStyle = BorderStyle.NoneRadGrid1.MasterTableView.HeaderStyle.ForeColor = Color.WhiteRadGrid1.MasterTableView.EnableColumnsViewState = FalseRadGrid1.MasterTableView.PageSize = 15RadGrid1.MasterTableView.EditMode = GridEditMode.InPlaceRadGrid1.MasterTableView.AllowMultiColumnSorting = TrueDim tblStopData As DataTable = New DataTable Dim cmd As SqlCommand = New SqlCommand("SP_STORED_PROC", conn) cmd.CommandType = CommandType.StoredProcedure Dim adapter As New SqlDataAdapter(cmd) adapter.SelectCommand.CommandTimeout = 300 adapter.Fill(tblStopData) Dim name(tblStopData.Columns.Count) As String Dim i As Integer = 0 For Each column As DataColumn In tblStopData.Columns Dim boundColumn As GridBoundColumn = New GridBoundColumn RadGrid1.MasterTableView.Columns.Add(boundColumn) boundColumn.DataField = column.ColumnName boundColumn.HeaderText = column.ColumnName 'boundColumn.AndCurrentFilterFunction = GridKnownFunction.Contains boundColumn.ShowFilterIcon = True Next RadGrid1.DataSource = tblStopData RadGrid1.Rebind()