[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

"string was not recognized as a valid boolean"  datagrid checkbox

Posted on 2004-10-20
5
Medium Priority
?
1,489 Views
Last Modified: 2008-01-09
Hello,

I have a checkbox in my databound datagrid.  however, when attempting to change the checkmark, I get the following error:

string was not recognized as a valid boolean.

anyone here know how to resolve this issue?

thanks in advance.
0
Comment
Question by:brdrok
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
gillgates earned 300 total points
ID: 12361429
are you saying...


if object.Check = "true"
{}  

if so, say

if object.Check = true
{}


Same with false, "true" is a string, true is boolean.

if that is not the issue post some code.
0
 
LVL 3

Assisted Solution

by:aacool
aacool earned 75 total points
ID: 12361498
Actually, that code should be

if(object.Check == true)
{
//...
}
0
 
LVL 3

Expert Comment

by:gillgates
ID: 12361514
Thats right, but my point is "true" is a string... I was just doing some vb6 earlier today and confused myself.
0
 
LVL 7

Author Comment

by:brdrok
ID: 12362276
Hello

thanks for the answers.  the answer pointed me in the right direction....

my original code was

//creating column
System.Windows.Forms.DataGridBoolColumn dbc = new DataGridBoolColumn();
dbc.TrueValue = "Yes";  //-----> changed it to dbc.TrueValue = true;
dbc.FalseValue = "No";  //-----> changed it to dbc.FalseValue = false'
tableStyle.GridColumnStyles.Add(dbc);
tableStyle.GridColumnStyles[1].HeaderText = "Scaled?";
tableStyle.GridColumnStyles[1].MappingName = myDataSet.Tables[0].Columns["Scaled"].ColumnName;


0
 
LVL 7

Author Comment

by:brdrok
ID: 12362308
i split the points 100:25....hope you guys think it's fair.

thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question