• WPF ListView 数据绑定



    <ListView Height="264" HorizontalAlignment="Left" Margin="28,84,0,0" Name="listView1" VerticalAlignment="Top" Width="526" >

                <ListView.View>

                    <GridView x:Name="gridView1">

                        <GridViewColumn Header="UserId" DisplayMemberBinding="{Binding Path=UserId}"></GridViewColumn>

                        <GridViewColumn Header="UserName" DisplayMemberBinding="{Binding Path=UserName}"></GridViewColumn>

                        <GridViewColumn Header="MobilePhone" DisplayMemberBinding="{Binding Path=MobilePhone}"></GridViewColumn>

                        <GridViewColumn Header="Address" DisplayMemberBinding="{Binding Path=Address}"></GridViewColumn>

                    </GridView>

                </ListView.View>

            </ListView>

     private void cbUserCategory_SelectionChanged_1(object sender, SelectionChangedEventArgs e)

            {

                UserRole_dc userRole = (UserRole_dc)this.cbUserCategory.SelectedItem;

                if (userRole != null)

                {

                    UserInfo_dcCollection collection = service.GetUserByRoleId(userRole.Id);

                    if (collection != null && collection.Count > 0)

                    {

                        this.listView1.ItemsSource = collection;

                    }

                }

            }

  • 相关阅读:
    XXX is not in the sudoers file
    git错误“无法推送一些引用到xxx"的解决方法
    mysql开启远程访问
    ubuntu 在启动器中启动webstorm和phpstorm
    ubuntu nginx卸载和安装
    基于grunt构建的前端集成开发环境
    fullPage.js
    常见的HTTP状态码
    JS随机数
    CSS3简单的动画
  • 原文地址:https://www.cnblogs.com/quietwalk/p/2258291.html
Copyright © 2020-2023  润新知