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

Columns show grid title instead of value on filtering/sorting

1 Answer 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Armin
Top achievements
Rank 1
Armin asked on 31 Jan 2014, 07:30 PM
I am using RadGrid in a user control  within an asp page to display a collection of records (15 columns) depending on the type of request needed (3 different types).

In Page_Load(), I assign the type of collection for binding the grid and immediately after, define the columns that it should have as GridBoundColumns (i.e. boundColumn.DataField = "Column 1" ; boundColumn.HeaderText = "Header 1" ; RadGrid1.MasterTableView.Columns.Add(boundColumn) ...)

In the RadGrid1_ItemDataBound(...), I do some processing on some columns (i.e. format date to short string) and add some controls (i.e. textbox) to certain columns (for capturing notes next to what's displayed).

When I post back and refresh the page, it's all fine.
When I filter by a column or click to go to the next page, all columns show the string representation of the grid column data class (i.e. Wireless_Equipment_Support_System.Telecommunication.TypeOneDataObject)

Any suggestions why this is happening?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 03 Feb 2014, 03:58 AM
Hi Armin,

For advanced features such as Filtering, Sorting, Paging etc RadGrid must be bound using declarative data sources or through the NeedDataSource event. When using declarative data sources or the NeedDataSource event, RadGrid can automatically accommodate the appropriate database operations without the need for you explicitly handle any sorting, paging, filtering, and so on. Please make changes and see if it helps, else provide your full code snippet.

Thanks,
Princy
Tags
Grid
Asked by
Armin
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or