MSDN > 論壇首頁 > Windows Presentation Foundation (WPF) > Auto Update of a ListView from a DataSet
發問發問
 

問題Auto Update of a ListView from a DataSet

  • 2008年6月9日 下午 03:41Roy in Acworth 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    This is part WPF and part DataSet question.  I want to be able to use the built-in 'notification' of a change in a DataSet to update the bound ListView.  It is not working, and I think I know why, but I don't really know enough to fix it.

    My DataSet has several table that are a one-to-one mapping of the data tables in the SQL database.  The data table that is bound to my ListView is populated though a Relation that effectively filters the results based on a previous selection.  (The initialation code for the from that contains the ListView calls GetChildRows using the relation to populate the table.)

    If after I add a row to my DataSet and then call GetChildRows again, then I see the new row.

    It appears that the auto update notification does not force a call through GetChildRows, which I guess is not a surprise.

    What I need to know is how to do the equivalent of the Relation in such a way that auto update notification to the ListView will work.

    Thanks

所有回覆