|
|
@@ -117,14 +117,18 @@ namespace System.Web.UI.WebControls {
|
|
|
if (dataType == typeof(bool)) {
|
|
|
CheckBox box = (CheckBox) cell.Controls [0];
|
|
|
object val = GetValue (cell.BindingContainer);
|
|
|
- if (val != null) {
|
|
|
+ if (val != null && val != DBNull.Value)
|
|
|
box.Checked = (bool)val;
|
|
|
- if (!box.Visible)
|
|
|
- box.Visible = true;
|
|
|
- }
|
|
|
else
|
|
|
- box.Visible = false;
|
|
|
- } else
|
|
|
+ if (string.IsNullOrEmpty (DataField)) {
|
|
|
+ box.Visible = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!box.Visible)
|
|
|
+ box.Visible = true;
|
|
|
+ }
|
|
|
+ else
|
|
|
base.OnDataBindField (sender, e);
|
|
|
}
|
|
|
|