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

Populating GridView with several data types

1 Answer 95 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Avi
Top achievements
Rank 1
Avi asked on 31 Oct 2011, 10:23 AM
Hi,

We are developing a new GUI to our system, which is built on top of a legacy code. In details, we write our User Control as a COM (CCW) object that contains the RadGridView and is then placed in the old GUI. The GridView should act mostly in read only mode. Since the communication between the old system and the new system is through the COM interface - it led us to choose the XML populating method to populate our grid. We've sent the XML as a string to the user control. It worked perfectly when we needed only text to be shown in the grid.

Now, we need to be able to show several types of data and several sub-controls in the grid cells (i.e.: GridViewComboBoxColumn, GridViewCheckBoxColumn, GridViewDecimalColumn, GridViewDateTimeColumn, GridViewImageColumn). The way it works now is:
(a) Loading the XML into a source DataTable, using ReadXml
(b) Building a new target DataTable with the needed data types
(c) Adding the right data columns to the Grid
(d) Iterating through the source DataTable and copying each cell to the target DataTable
(e) Assigning the target DataTable to the grid as its Data Source.

As expected - this process led to performance issues...

So, we would like to know if our solution is correct? Is there another way to populate the grid under our limitations?
(Even if we bypass the process of building the XML in the legacy system, and accessing the DB directly, we still need to iterate through all the cells and copying them)

Thanks,

Boaz

1 Answer, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 02 Nov 2011, 02:48 PM
Hello Avi,

To improve the performance of your application you can load the data from XML in DataTable and bind to RadGridView control directly and copy the data to additional DataTable. Another solution is to serialize data to some binary stream and then load to IBindingList<> collection and bind this collection to RadGridView control.

I hope this information is useful. Let me know if you need further assistance.

Regards,
Julian Benkov
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Tags
GridView
Asked by
Avi
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Share this question
or