Connecting Tech Pros Worldwide Forums | Help | Site Map

why DataGridBoolColumn seems read only

Ryan Liu
Guest
 
Posts: n/a
#1: Mar 7 '06

Hi,

I have a strange problem, should be very simple, take me days I couldn't
finger out.
Really appreciate if you can help me fine the problem.

I am trying to use DataGridBoolColumn, but I just can not check/unckeck the
checkbox with this column.

I can edit other DataGridTextBoxColumn in the same grid. So it is not read
only.

It can load data from db, so the mapping is right.



DataGridBoolColumn stopUseColumnStyle = new DataGridBoolColumn();
stopUseColumnStyle.AllowNull = false;
stopUseColumnStyle.MappingName = "stop_use";
stopUseColumnStyle.HeaderText= "STOP USE";
stopUseColumnStyle.ReadOnly = false;
stopUseColumnStyle.Width = 75;
stopUseColumnStyle.FalseValue = false;
stopUseColumnStyle.TrueValue = true;
myGridStyle.GridColumnStyles.Add(stopUseColumnStyl e);

DataColumn dcStopUse = new DataColumn("stop_use", typeof(bool));
dcStopUse.AllowDBNull = false;
dcStopUse.DefaultValue = false;
dt.Columns.Add(dcStopUse);


string selectSql = "select id, name, description, stop_use from skill" ;

MySqlConnection myDbcon = (MySqlConnection)conn;
MySqlDataAdapter myDA = new MySqlDataAdapter(selectSql,myDbcon );
myDA .Fill( dt);

I had similar code elsewhere for other db tables, works just fine.

I compared and compared, just can not find the difference and the problem.

Thanks a lot!
Ryan Liu



Closed Thread