troubleshooting Question

C# -- Checkbox STATE -- still fails ?

Avatar of finance_teacher
finance_teacher asked on
.NET ProgrammingC#
5 Comments2 Solutions297 ViewsLast Modified:
Changing below
  ["IsDesigner"] != null
        to
  ["IsDesigner"].State == unchecked
causes Syntax error, '(' expected

How can I fix ?
-------------------------------------------
        private void designerMaintenanceBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < designerMaintenanceDataGridView.Rows.Count; i++)
            {
                // if ID null & designer checked
                if (designerMaintenanceDataGridView.Rows[i].Cells["ID1"].Value.Equals(System.DBNull.Value)
                    && designerMaintenanceDataGridView.Rows[i].Cells["IsDesigner"].State == unchecked)
                {
                    MessageBox.Show("will be Added");
                    //gmL_ROITEMTableAdapter.AddRomID(iGML_ROMSTR_ID, RoID);
                }

                // if ID NOT null & designer unchecked
                else if (designerMaintenanceDataGridView.Rows[i].Cells["ID1"].Value.ToString().Length > 0
                         && designerMaintenanceDataGridView.Rows[i].Cells["IsDesigner"] == null)
                {
                    MessageBox.Show("will be Deleted");
                    //gmL_ROITEMTableAdapter.DeleteRomID(iGML_ROMSTR_ID, RoID);
                }
                else
                {
                    MessageBox.Show("No Add or Delete Happens");
                }
            }
        }
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 2 Answers and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros