Hi,
my code is:
myDataTBL.Columns.Add("checked",System.Type.GetTyp e("System.Boolean"));
DataGridBoolColumn cs1 = new DataGridBoolColumn();
cs1.NullValue=false;
cs1.TrueValue=true;
cs1.FalseValue=false;
cs1.MappingName="checked";
cs1.ReadOnly=false;
dataGrid1.TableStyles[0].GridColumnStyles.Add(cs1);
what i get is always a gray checkbox. When i click it, it becomes checked,
and another click turns it into grey, and then unchecked act...
I want:
a. default value is uncheked
b. only to states - checked/unchecked (no gray)
what should i do... please help.. 4 6664
Ubi,
First, you should change the following line:
myDataTBL.Columns.Add("checked",System.Type.GetTyp e("System.Boolean"));
To:
myDataTBL.Columns.Add("checked", typeof(bool));
Then, on the DataGridBoolColumn that you create (cs), set the AllowNull
property to false.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Ubi" <Ub*@discussions.microsoft.com> wrote in message
news:46**********************************@microsof t.com... Hi, my code is:
myDataTBL.Columns.Add("checked",System.Type.GetTyp e("System.Boolean")); DataGridBoolColumn cs1 = new DataGridBoolColumn(); cs1.NullValue=false; cs1.TrueValue=true; cs1.FalseValue=false; cs1.MappingName="checked"; cs1.ReadOnly=false; dataGrid1.TableStyles[0].GridColumnStyles.Add(cs1);
what i get is always a gray checkbox. When i click it, it becomes checked, and another click turns it into grey, and then unchecked act... I want: a. default value is uncheked b. only to states - checked/unchecked (no gray)
what should i do... please help..
Ubi,
First, you should change the following line:
myDataTBL.Columns.Add("checked",System.Type.GetTyp e("System.Boolean"));
To:
myDataTBL.Columns.Add("checked", typeof(bool));
Then, on the DataGridBoolColumn that you create (cs), set the AllowNull
property to false.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Ubi" <Ub*@discussions.microsoft.com> wrote in message
news:46**********************************@microsof t.com... Hi, my code is:
myDataTBL.Columns.Add("checked",System.Type.GetTyp e("System.Boolean")); DataGridBoolColumn cs1 = new DataGridBoolColumn(); cs1.NullValue=false; cs1.TrueValue=true; cs1.FalseValue=false; cs1.MappingName="checked"; cs1.ReadOnly=false; dataGrid1.TableStyles[0].GridColumnStyles.Add(cs1);
what i get is always a gray checkbox. When i click it, it becomes checked, and another click turns it into grey, and then unchecked act... I want: a. default value is uncheked b. only to states - checked/unchecked (no gray)
what should i do... please help..
This is working, except the starting value is grey.
after i click it the first time i don't get gray check anymore...
but how can i change the starting value to unchecked?
"Nicholas Paldino [.NET/C# MVP]" wrote: Ubi,
First, you should change the following line:
myDataTBL.Columns.Add("checked",System.Type.GetTyp e("System.Boolean"));
To:
myDataTBL.Columns.Add("checked", typeof(bool));
Then, on the DataGridBoolColumn that you create (cs), set the AllowNull property to false.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Ubi" <Ub*@discussions.microsoft.com> wrote in message news:46**********************************@microsof t.com... Hi, my code is:
myDataTBL.Columns.Add("checked",System.Type.GetTyp e("System.Boolean")); DataGridBoolColumn cs1 = new DataGridBoolColumn(); cs1.NullValue=false; cs1.TrueValue=true; cs1.FalseValue=false; cs1.MappingName="checked"; cs1.ReadOnly=false; dataGrid1.TableStyles[0].GridColumnStyles.Add(cs1);
what i get is always a gray checkbox. When i click it, it becomes checked, and another click turns it into grey, and then unchecked act... I want: a. default value is uncheked b. only to states - checked/unchecked (no gray)
what should i do... please help..
You have to set the value to false. Basically True = checked, False =
unchecked, Null = 3rd State/Gray
"Ubi" <Ub*@discussions.microsoft.com> wrote in message
news:45**********************************@microsof t.com... This is working, except the starting value is grey. after i click it the first time i don't get gray check anymore... but how can i change the starting value to unchecked?
"Nicholas Paldino [.NET/C# MVP]" wrote:
Ubi,
First, you should change the following line:
myDataTBL.Columns.Add("checked",System.Type.GetTyp e("System.Boolean"));
To:
myDataTBL.Columns.Add("checked", typeof(bool));
Then, on the DataGridBoolColumn that you create (cs), set the
AllowNull property to false.
Hope this helps.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Ubi" <Ub*@discussions.microsoft.com> wrote in message news:46**********************************@microsof t.com... Hi, my code is:
myDataTBL.Columns.Add("checked",System.Type.GetTyp e("System.Boolean")); DataGridBoolColumn cs1 = new DataGridBoolColumn(); cs1.NullValue=false; cs1.TrueValue=true; cs1.FalseValue=false; cs1.MappingName="checked"; cs1.ReadOnly=false; dataGrid1.TableStyles[0].GridColumnStyles.Add(cs1);
what i get is always a gray checkbox. When i click it, it becomes
checked, and another click turns it into grey, and then unchecked act... I want: a. default value is uncheked b. only to states - checked/unchecked (no gray)
what should i do... please help.. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Erald Kulk |
last post by:
I have a problem with a datagridboolcolumn that drives me almost
crazy.
I have a sql server table with several columns of which one is a
column called ok which is a bit with default value 0. In...
|
by: PeterZ |
last post by:
Hi,
In the past I've successfully databound a conventional Winforms checkbox to
a number column in an Oracle table, where 1 represents true and 0 represents
false. The checkbox would be ticked...
|
by: Ubi |
last post by:
Hi,
my code is:
myDataTBL.Columns.Add("checked",System.Type.GetType("System.Boolean"));
DataGridBoolColumn cs1 = new DataGridBoolColumn();
cs1.NullValue=false;
cs1.TrueValue=true;...
|
by: James Goodman |
last post by:
I have a number of bool columns within a datagrid, but they dont work as
expected.
The underlying table is Access 2000. The datatype for the underlying fields
is Yes/No.
I am attempting to...
|
by: Edward Koucherian |
last post by:
I'm getting the incorrect display value on my DataGrid column.
The field is numeric (1) in the SQL database table
The Code is
txtCol = New DataGridBoolColumn
txtCol.MappingName = "MyCol"...
|
by: nate axtell |
last post by:
I'm trying to create a custom DataGridBoolColumn. I inherit
DataGridColumnStyle and create a public CheckBox variable. This columnType
will be mapped to a dataTable boolean column. What are the...
|
by: B.J. Raiford |
last post by:
I have a DataGrid on a form in my application that is bound to an xml file
and I have set the table style to contain a few columns with one editable
one, a DataGridBoolColumn.
I set...
|
by: Ryan Liu |
last post by:
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...
|
by: Brett Romero |
last post by:
I've created a DataGrid DataGridBoolColumn column in a tablestyle and
mapped it correctly to a datatable. Problem is the column is always
grayed and I can't uncheck it. I have the...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |