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

Dynamically Created Columns For Custom Properties

1 Answer 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 2
Kevin asked on 05 Jan 2012, 06:26 PM

 

We are binding a RadGrid DataSource to a list of objects that contain standard properties and a list of custom properties.

e.g.

Name
JobTitle
Contact
List<string> CustomProperties { customPropertyItem1, customPropertyItem2 ... n}

The custom properties are stored in our db such that one property has many propertyItems, so the column headings would look like this -

Name | Job Title | Contact | Custom Property 1 | Custom Property 2 ... n

What is the best way of binding to these custom properties?

Can we mix declarative code (columns for the standard properties) with programmatic code (columns created dynamically for the custom properties) ?

All properties including custom properties need to be groupable, sortable and filterable.

thanks

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 Jan 2012, 05:55 AM
Hello Kevin,

RadGrid does not support mixing declarative grid columns with grid columns added dynamically at runtime. You should either create all the columns in the grid programmatically, or else define them all in the ASPX file. Check the following help documentation for creating the entire grid programmatically.
Programmatic Creation

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