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

How to save a column that has expression in radgridview to datasource

1 Answer 78 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 05 Oct 2013, 10:18 AM
Hello, 

I have a problem with saving a column in a radgridview with an expression to the datasource. Im not really sure how to do this or if I actually did this right, I have a column that computes the difference in number of days from another column. Since the whole column is created using the expression editor I was wondering if there was a way to save this back to the datasource without having to go through manually copying each item in the radgridview into the datatable. 

I populate my RadGridView using a custom dataTable as a dataSource. And also the column with the expression is dynamic based on a datepicker so its like saying that how many days difference is it if I put in this day or 5 days later. That's why the expression recomputes everytime and thats why I use the RadGridView.Columns["<Column here>"].Expression property. My only problem is that the datasource is not being updated whenever I do this. So please help, and thank you greatly :D


1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 09 Oct 2013, 02:22 PM
Hi Justin,

Thank you for writing.

This is a very custom scenario and it is expected that the data source will not update automatically. You will need to implement your own custom solution. For example you can save the expression in the following format:
ColumnName - Expression

Then when needed you can parse this data and set the expression to the appropriate column.

I hope this helps.

Regards,
George
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Justin
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or