none
DomainDataSource Data vs DataView

    Question

  • Hello,

     

    Has anyone worked out the difference between DomainDataSource's Data and DataView Properties? They appear to produce the same results when I use each? Are there any times when I should use one or the other?

     

    thanks!

    Thursday, February 09, 2012 3:44 AM

Answers

  • Hi philteare,

    You are right, the value of DomainDataSource.Data and DomainDataSource.DataView are same.

    But the difference is that the type of DomainDataSource.Data is returned as IEnumerable while DataView is DomainDataSourceView.

    If you try to get access the properties of DomainDataSourceView, it will be more convience to use DomainDataSource.DataView.

    But you can also cast DomainDataSource.Data to DomainDataSourceView and then access its properties.

    e.g.

            private void dds_LoadedData(object sender, LoadedDataEventArgs e)
            {
                int n = dds.DataView.Count;
                int i = (dds.Data as DomainDataSourceView).Count;
            }

    All in all, there are not much differences between these two only the defined type is different.

     

    Best Regards,

    Thursday, February 16, 2012 1:41 AM

All replies

  • Hi philteare,

    You are right, the value of DomainDataSource.Data and DomainDataSource.DataView are same.

    But the difference is that the type of DomainDataSource.Data is returned as IEnumerable while DataView is DomainDataSourceView.

    If you try to get access the properties of DomainDataSourceView, it will be more convience to use DomainDataSource.DataView.

    But you can also cast DomainDataSource.Data to DomainDataSourceView and then access its properties.

    e.g.

            private void dds_LoadedData(object sender, LoadedDataEventArgs e)
            {
                int n = dds.DataView.Count;
                int i = (dds.Data as DomainDataSourceView).Count;
            }

    All in all, there are not much differences between these two only the defined type is different.

     

    Best Regards,

    Thursday, February 16, 2012 1:41 AM
  • Thankyou, that's a very helpful explination.

     

    thanks,

     

    Phil.

    Thursday, February 16, 2012 3:40 AM