Porting from DevExpress to Telerik

4 posts, 0 answers
  1. New
    New avatar
    8 posts
    Member since:
    Nov 2012

    Posted 17 Jan 2013 Link to this post

    Dear Telerik,

    I have a license for both DevExpress and Telerik (license check required?). Currently, I would like to port a DevExpress DataGrid (WinForm) to Telerik RadGridView (WPF). The .NET framework I am using is 3.5 and I am not allowed to upgrade it to 4.5, unfortunately, so I am stuck with an older version of Telerik.

    Since I am still in the process of working up a solution, the list of problems I have may change (increase) over time, but so far these are the two main issues I've encountered so far:

    1. Row selection

    I cannot get RadGridView to return the row indices of the selected rows. It appears later version has a SelectedRows property but my version only has SelectedCells and SelectedItems. The cell info objects, interestingly, only has information on column and not row.

    2. Multithreading

    The DevExpress DataGrid I am porting appears to have code that involve multithreading handling. I did a brief Google search and the way to port things like "InvokeRequired" did not seem immediately obvious. Is there like a FAQ for this topic?

    Thanks for now.
  2. Hristo
    Hristo avatar
    408 posts

    Posted 21 Jan 2013 Link to this post


    1. Row selection: It is not recommended to work with visual elements in a virtualized control (no matter if it is RadGridView, DataGrid, etc.). The thing is that each element is recycled and reused on scrolling.
    What you should do in this case is to work with SelectedItems collection of the grid.

    2. Multithreading: We do not provide such in RadGridView. I'm afraid that it's up to you to implement your business logic in such a way that it executes on a separate thread, but fires all the necessary notifications on the UI thread.

    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. New
    New avatar
    8 posts
    Member since:
    Nov 2012

    Posted 21 Jan 2013 Link to this post

    Thanks for the reply.

    1. I will check again to see if I can easily get the Row from SelectedItems

    2. Okay

    There's another couple of question that popped up:

    3. I am using DataTable as an ItemsSource. Currently, I am handling my validation at the Data layer by adding an OnRowChanging() hander to the DataTable which, upon failed validation, rejects the changes. However, what I have trouble is with funneling the error messages to the RadGridView so that it gets displayed. Is there a standard way of doing things like this?

    4. As noted in #3, I am using DataTable as the ItemsSource. Currently, I have a refresh button control that will resynch the DataTable with some other data source. In this case, the DataTable appears to synch properly with that data source but it appears to have trouble synching with the RadGridView.

    When the DataTable is initialized and updated using this following code:

    //// dt is my DataTable ////
    dt.BeginInit();  // Do I even need this?

    dt.TableName = model.Table.Table.Name;
    /////// add Columns
    dt.BeginLoadData(); // Do I even need this?
    /////// Add rows
    radgridview.ItemsSource = null;
    radgridview.ItemsSource = dt.DefaultView;

    When DataTable is initiated, it's fine. But when I click refresh and this is run again, all the rows disappear. The columns are updated fine but the rows are not. And I can tell from the debugger that the rows are actually added to the DataTable. What's interesting is that when I insert a row, it also instantly disappears even though it is actually added to DataTable properly. 

    Now let's say, I remove the dt.Reset() operation and, instead, do dt.Columns.Clear() and dt.Clear(), then I get another issue - where the columns now do not update properly but the rows are showing fine.
  4. New
    New avatar
    8 posts
    Member since:
    Nov 2012

    Posted 22 Jan 2013 Link to this post

    On #4, it appears that changing from dt.Reset() to dt.Columns.Clear() and dt.Rows.Clear() fixes the issue. However, using dt.Clear() does not. The solution does not seem very intuitive considering how all 3 approaches should work by definition.
Back to Top