首页 新闻 会员 周边 捐助

如何将list<T> GetXinXiList(int departmentID) 绑定到treeview和分页DataGrid

0
悬赏园豆:20 [已关闭问题] 关闭于 2015-05-04 10:44

图示

MainWindow:

namespace WpfApplication3
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
           InitializeComponent();
        }

        问题:
        如何将list<T> GetXinXiList(int departmentID) 的返回值 绑定到treeview和分页DataGrid?
        
public StuResult Result { get; set; } private Department studentDao = new Department(); public void Query(int size, int pageIndex) { Result.Total = studentDao.TotalCount; Result.Students = studentDao.XinXiLists.Skip((pageIndex - 1) * size).Take(size).ToList(); } private void PagingDataGrid_PagingChanged(object sender, CustomControlLibrary.PagingChangedEventArgs args) { Query(args.PageSize, args.PageIndex); } } }

 

XMAL:

    <Grid>
        ......

如何将list<T> GetXinXiList(int departmentID) 的返回值 绑定到treeview和分页DataGrid ? <!--<lib:PagingDataGrid Grid.Column="2" AutoGenerateColumns="False" HorizontalGridLinesBrush="DarkGray" VerticalGridLinesBrush="DarkGray" ItemsSource="{Binding Result.Students,ElementName=self}" Total="{Binding Result.Total,ElementName=self}" PagingChanged="PagingDataGrid_PagingChanged" >--> <lib:PagingDataGrid Grid.Column="2" AutoGenerateColumns="False" HorizontalGridLinesBrush="DarkGray" VerticalGridLinesBrush="DarkGray" ItemsSource="{Binding ElementName='tree', Path=SelectedItem.XinXiLists}" Total="{Binding ElementName='tree', Path=SelectedItem.TotalCount}" > <lib:PagingDataGrid.Columns> <DataGridTextColumn Header="日期" Binding="{Binding ReceiveDate}"/> <DataGridTextColumn Header="摘要" Binding="{Binding Summary}"/> <DataGridTextColumn Header="分数" Binding="{Binding Score}" /> <DataGridTextColumn Header="备注" Binding="{Binding Reamrks}" /> </lib:PagingDataGrid.Columns> </lib:PagingDataGrid> </Grid> </Window>
Sam_Li的主页 Sam_Li | 初学一级 | 园豆:196
提问于:2015-04-23 16:44
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册