Tech Off Thread

2 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

How to assign database/source of ListView programmatically in WPF?

Back to Forum: Tech Off
  • User profile image
    cssavinashi

    I tried some sample coding from the net. It uses the XMLDataProvider

        <XmlDataProvider x:Key="MyData" XPath="/Info">

                    <x:XData>

                                <Info xmlns="">

                                         <Song Name="Love at first sight" Time="4:04" Artist="kylie" Level="3" Disk="Disk-1" />

                                         <Song Name="At Night" Time="4:31" Artist="Shake Down" Level="4" Disk="Disk-1" />

                                         <Song Name="Believe" Time="3:54" Artist="Cher" Level="5" Disk="Disk-2" />

                               <Song Name="Don't call me baby" Time="3:25" Artist="Madison Avenue" Level="5" Disk="Disk-2" />

                               <Song Name="It's in your eyes" Time="4:32" Artist="Kylie" Level="5" Disk="Disk-1" />

                               <Song Name="Rise up" Time="4:12" Artist="Sunkids" Level="5" Disk="Disk-1" />

                                </Info>

                   </x:XData>

                       </XmlDataProvider>

    But instead of the XMLDataProvider can i use different datasource as DataTable or DataSet which is created programmatically? If it is possible how can i do it?

    If it is not possble and it is only we have to XMLDataProvider then can we add the values to the <Song> list(i.e can we add new rows and columns to the existing XMLDataProvider programmatically during runtime?

     

  • User profile image
    footballism

        Actually, you can use ObjectDataProvider, it implements the observer for you, and surely it can wrap the ADO.NET data objects aka DataSet, DataTable etc.


    Sheva

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.