Hi,
I have a RadGrid that I'm binding to a datatable, no problems there. The datatable contains any number of columns that store a custom object which has some basic properties (text, link, etc.).
By overriding the ToString() method on the custom object, I can get the RadGrid to auto generate GridBoundColumns for each object, which is great, but what I really need is a HyperLink column, or possibly a template column that will allow me to bind to more than just the ToString() method of my objects.
So the question is, are any of the following possible?
1) Get AutoGenerateColumns to give me hyperlink columns with the appropriate properties assigned to DataTextField and DataNavigateURLField.
2) Use a template column to extract the values from the objects inside the bound data rows?
3) Create the columns dynamically in code-behind, and somehow bind the properties to the appropriate properties on my object?
4) Any other way of doing this?
I've got around a similar problem in the past by using reflection on a custom collection to expose members of a collection as properties that can be bound to a grid, but I'd really like to avoid doing something that complicated in this instance because it seems like there must be a simpler way to achiever it. Hopefully there is and I just haven't come across it yet!
Thanks,
Mathew
I have a RadGrid that I'm binding to a datatable, no problems there. The datatable contains any number of columns that store a custom object which has some basic properties (text, link, etc.).
By overriding the ToString() method on the custom object, I can get the RadGrid to auto generate GridBoundColumns for each object, which is great, but what I really need is a HyperLink column, or possibly a template column that will allow me to bind to more than just the ToString() method of my objects.
So the question is, are any of the following possible?
1) Get AutoGenerateColumns to give me hyperlink columns with the appropriate properties assigned to DataTextField and DataNavigateURLField.
2) Use a template column to extract the values from the objects inside the bound data rows?
3) Create the columns dynamically in code-behind, and somehow bind the properties to the appropriate properties on my object?
4) Any other way of doing this?
I've got around a similar problem in the past by using reflection on a custom collection to expose members of a collection as properties that can be bound to a grid, but I'd really like to avoid doing something that complicated in this instance because it seems like there must be a simpler way to achiever it. Hopefully there is and I just haven't come across it yet!
Thanks,
Mathew