我用WPF的DataGrid控件绑定到我的Collection<对象名>集合,但是DataGrid的Head显示的是英文,我就用手动加了几列,但是怎么把数据帮定到列呢

解决方案 »

  1.   

    <DataGridTextColumn Header="编号" Binding="{Binding ID}" />
      

  2.   

    我直接绑定ID就可以了吗?请问这个ID是什么?
      

  3.   

    或者我不绑定数据,而是用手动写代码的方式一行一行的给DataGrid赋值呢
      

  4.   

    我怎么设置后台的datasource呢?
      

  5.   

    grid.ItemsSource = datatable
      

  6.   

    dataGrid1.ItemsSource = Customer.GetSampleCustomerList();
      

  7.   

    public List<Customer> GetSampleCustomerList()
    {
    ……
    }
      

  8.   

    我现在绑定一张表,但是这张表中的id是和另外一张表关联的,我想绑定的时候不想显示id而是显示id在另一张表中关联的name,我又如何绑定呢?
      

  9.   

    给实体中加属性。根据ID查出NAME 赋给实体。然后获得实体集合
      

  10.   

    看看这里有没有你需要哒,个人收集的DATAGRID资料大全,满意的话,给个分吧
    DataGrid的EditCommandColumn怎么使用图片作为按钮
    Asp.net的DataGrid怎么纵向显示数据
    Asp.net的DataGrid中怎么用联合主键的DataKeys定位记录
    Asp.net的DataGrid为什么取不到值
    Asp.net的DataGrid在PostBack后怎么定位记录
    Asp.net怎么触发DataGrid模板列中控件的事件
    怎么在绑定后动态改变DataGrid中的内容
    Asp.net中DataGrid利用DataRelation显示主从表信息
    ASP.NET中DataGrid和DataList控件用法比较
    Asp.net创建跨多列以及多行表头的DataGrid
    Asp.net为DataGrid整行添加服务器事件代码
    更多Asp.net DataGrid
      

  11.   

    怎样将DataGrid中的数据保存到xml文件中呢?
      

  12.   

    datatab 的列数不定,列名也不确定,怎么办???