5.25 How do I determine whether a checkbox in my datagrid is checked or not?    If the column is a boolean column, you can just cast the object returned by the indexer to a bool and use it.    if((bool)dataGridTopics[row, column])    MessageBox.Show("I am true");    else    MessageBox.Show("I am false");    来 源 http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q831q

解决方案 »

  1.   

    this.ds.tables["tablename"].rows["boolColumn"].tostring()="True"或者
    "False";datagriboolcolumnstyes 列
    可以通过.truevalue,falsevalue 属性
    制定当他为"True"或者"False"时的数值
      

  2.   

    好像bool型字段有三种状态,灰色代表无操作,还有选中与没选中,怎么判断是否是灰色的状态呢 ?
      

  3.   

    与DataGrid绑定的数据对象基类中设定
    比如一个bool属性
    public bool Check
    {
       get
       {
            return m_bCheck;
       }
    }
    没有set属性,所以在DataGrid中是灰色的状态,m_bCheck为false当然是没选中状态,为true是选中状态