代码改变世界

DataGridBoolColumn 使用方法

2007-05-04 13:45  澜心  阅读(532)  评论(0编辑  收藏  举报
private void frmMyForm_Dates_Load(object sender, System.EventArgs e)
    
{
        
// other Loading event code .

        
// This is what the VS.NET designer does:
        dataGridBoolColumn1.TrueValue = "True";
        dataGridBoolColumn1.FalseValue 
= "False";
        
// The preceding causes a problem because the DataSet Column used with this 
        
// column is of type System.Boolean and NOT System.String.

        
// So, change it to something like the following to fix the problem:
        dataGridBoolColumn1.TrueValue = true;
        dataGridBoolColumn1.FalseValue 
= false;
    }


原文地址 http://www.dotnetfun.com/articles/winforms/DataGridBoolColumnValueProblem.aspx

Email:campolake@gmail.com