Skip to content

Infragistics Community Forum / Desktop / Ultimate UI for Windows Forms / Multiple DataSources to an ultragrid

Multiple DataSources to an ultragrid

New Discussion
Skankhunt P
Skankhunt P asked on Nov 18, 2016 7:03 AM

Hi,

Is it possible to have more than one datasource for an ultragrid where each datasource controls a set of rows and columns of the Grid.

For Example. first 10 columns are populated by Datasource1 and second half of the Grid is populated by data from DataSource2.

Or is it possible to embed Data/Columns from other Datasource into a Grid. If I have to insert 10 columns of data from Datasource2  between columns 2 and 3 of Datasource1 to which ultragrid was bound to, so that I can control the whole row(Data from Datasource1 and Datasource2) as a single row in the Grid and move them up and down, apply filters etc..

If so, a sample would be great.

Thanks,

Sign In to post a reply

Replies

  • 0
    Milko Venkov
    Milko Venkov answered on Nov 16, 2016 2:17 PM

    Hello Skankhunt,

    UltraGrid may have only one data source at a given time. So you cannot set different data sources at the same time.

    What you can do is add unbound columns to your grid and populate them with the data from your second data source. Follow the next link to our online documentation where is shown how to add unbound columns – “Adding Unbound Columns to WinGrid”.

    To populate data in the added columns you may use InitializeRow event.

    Please let me know if you have any further questions on this matter.

    • 0
      Skankhunt P
      Skankhunt P answered on Nov 18, 2016 12:13 AM

      Let me tell you what are we trying to do.

      We have some data populated in a grid using Datasource1. we want to compare this data to a DataSource2, meaning just check if all the data in Datasource1 and Datasource2 are identical or flag any differences. If any differences we need to disposition them by row by row  collectively in both the grids.

      for eg: if a row with Values 1,2,3,4 in Grid 1 and the same row in Grid 2 is having 1,2,5,4. Then we need to disposition this row as fixed or Good. How do we disposition this collectively as both rows belong to different grids. Does Infragistics has any support for what am I trying to do or any better control is available.

      So, I populated the Data in Grid1 and for Source 2 with which we want to compare I am not sure if using a different grid is easier or adding and using unbound columns as you suggested is better. Since we want to disposition the items for differences if any on a row basis, which is the preferred way of going in terms of implementation and maintainability.

      • 0
        Milko Venkov
        Milko Venkov answered on Nov 18, 2016 7:03 AM

        Hi Skankhnut,

        If you need to compare two data sources, you will need to loop through every row and examine the values of each cells in both data sources and trap differences yourself. There's nothing built-in to the grid that could perform this kind of operation for you.

        Another option would be to search through the data source rows, rather than the grid, but it's essentially the same thing. The DataSource might be a bit more efficient, though.

        Please let me know if any additional questions arise.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Skankhunt P
Favorites
0
Replies
3
Created On
Nov 18, 2016
Last Post
9 years, 10 months ago

Suggested Discussions

Tags

Created by

Created on

Nov 18, 2016 7:03 AM

Last activity on

Feb 24, 2026 9:44 PM