1.为什么DatagridBoolColumn列我绑定之后,默认都是选中的,这个怎么控制它根椐的我数据值来显示是否选中?
2.双击之后,可以将它改为不选。但只要我一点其它行,它又变成选中的,到底怎回事?怎么解决?请指教,谢谢~

解决方案 »

  1.   

    this.BoolColumn.FalseValue = "false";
    this.BoolColumn.HeaderText = "是否显示";
    this.BoolColumn.MappingName = "isShow";
    this.BoolColumn.NullValue = "true";
    this.BoolColumn.TrueValue = "true";
    this.BoolColumn.Width = 75;
      

  2.   

    给里段代码参考下吧,呵呵DataGridColumnStyle boolCol = new DataGridBoolColumn();
    boolCol.MappingName = "Current";
    boolCol.HeaderText = "IsCurrent Customer";
    boolCol.Width = 150;
    ts1.GridColumnStyles.Add(boolCol);DataTable tCust = new DataTable("Customers");

    // Create one column, and add it to the first table.

    DataColumn cCurrent = new DataColumn("Current", typeof(bool)); tCust.Columns.Add(cCurrent); // Add the tables to the DataSet.
    myDataSet.Tables.Add(tCust);myDataGrid.SetDataBinding(myDataSet, "Customers");
      

  3.   

    谢谢,我知道怎回事了。代码没问题,主要是DataColumn cCurrent = new DataColumn("Current", typeof(bool));
    我字段是从数据库取的,类型不是BOOL我晕~~还有这种错误
    谢谢各位了。