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

2 posts, 0 answers
  1. Justin
    Justin avatar
    1 posts
    Member since:
    Oct 2013

    Posted 05 Oct 2013 Link to this post

    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


  2. George
    Admin
    George avatar
    500 posts

    Posted 09 Oct 2013 Link to this post

    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 >>
Back to Top