Tim
Tim

Reputation: 8921

How to add column objects and cell editors programmatically to Winforms Telerik RadGridView

I want to create the columns and cell editors for a WinForms Telerik RadGridView programmatically (i.e. not by pointing the grid at a DataSet object).

I'd like to create the columns, assign them each a field name, create the cell editors and attach them to their respective columns, and then assign a DataTable as the grid's datasource and have the grid use the field names to extract the values from the DefaultView of the DataTable and populate the columns..

A brief example would be helpful. The grid will contain many time values (not datetime, but Time(0) in SQL Server 2012). It is like a bus schedule application where the date does not matter. I just need to track time-of-day, which maps to a System.TimeSpan structure. So if the example used a TimePicker as the cell editor that would be great.

Upvotes: 0

Views: 1929

Answers (1)

Tim
Tim

Reputation: 8921

Found it! MasterTemplate was the key: http://www.telerik.com/help/winforms/gridview-columns-generating-columns.html

Upvotes: 0

Related Questions