Solved

Datagridview error when i try to add rows to the grid: Exception :  System.FormatException.......

Posted on 2009-03-31
11
726 Views
Last Modified: 2012-05-06
hi iam getting this annoing error message saying that System.FormatException : Formatted value of the cell has a wrong type.....

i have another case or a grid in my application an it works fine there......!!
Can anyone see what i have done wrong in the code or what i can change so it will work as i want it to work...?!
if (ShowAllClients)
            {
                    DsOperatorAccess.ClientRow[] myClientRows = Adra.AMEngine.AmEngine.Instance.GetClients(myOper);
                    myRelationRows = AmEngine.Instance.GetClientRelations(myOper);
                    foreach (DsOperatorAccess.ClientRow cliRow in myClientRows)
                    {
                        myOper.CurrentClient_ID = cliRow.Client_ID;
                        
                        //treeViewReconciliations.Nodes.Add(cliRow.Client_ID.ToString(), cliRow.ClientName.ToString());
                        object[] argsClient = { false, null, null, cliRow.Client_ID.ToString(), 0, cliRow.ClientName.ToString(), "Client" };
                        dgvReconciliations.Rows.Add(argsClient); GETTING ERROR ON THIS LINE!!!!!!!
                        
                       
                    }
 
                    dgvReconciliations.Columns[0].Visible = true;
            }

Open in new window

0
Comment
Question by:Adnan
  • 7
  • 4
11 Comments
 
LVL 6

Expert Comment

by:Cebik
ID: 24027640
I think that you have different colums types added.
0
 

Author Comment

by:Adnan
ID: 24027734
hmm oki, sorry but i dident understand what you are mneaning, do u know how i can fix the columns type?
0
 
LVL 6

Expert Comment

by:Cebik
ID: 24027775
you can add or change columns and colums properties (also types) in the designer or Programmatically
Programmatically: http://www.cambiaresearch.com/c4/0d5ffa9f-3e92-461d-b864-e0c5fb7ed918/Adding-Columns-to-DataGrid-Programmatically.aspx
in the designer click on the datagrid then on the triangle (right upper corner) and choose edit columns..
0
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
LVL 6

Expert Comment

by:Cebik
ID: 24027787
or give us your datagridview code from: #region Windows Form Designer generated code

formaname.Designer.cs section: Windows Form Designer generated code
like:


// 
// dataGridView1
// 
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Location = new System.Drawing.Point(53, 32);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.Size = new System.Drawing.Size(240, 150);
this.dataGridView1.TabIndex = 0;

Open in new window

0
 

Author Comment

by:Adnan
ID: 24027818
oki, i have 2 grids in my form, and if user click on toottip meny item to expand the grid will the first grid hide in background and the other will show upp. i made function wich are generated code for the second grid....
private void MakeRecShow()
        {
            this.reconAutomaticShowHide1 = new Adra.AMDesk.ReconAutomaticShowHide();
            // 
            // reconAutomaticShowHide1
            // 
            this.reconAutomaticShowHide1.BackColor = System.Drawing.Color.Transparent;
            this.pnlReconAutomatic.AutoScroll = true;
            this.pnlReconAutomatic.AutoScrollMinSize = new System.Drawing.Size(710, 412);
            this.reconAutomaticShowHide1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.reconAutomaticShowHide1.Location = new System.Drawing.Point(710, 412);
            this.reconAutomaticShowHide1.Name = "reconAutomaticShowHide1";
            this.reconAutomaticShowHide1.Operator = myOper;
            this.reconAutomaticShowHide1.Size = new System.Drawing.Size(710, 412);
            this.reconAutomaticShowHide1.TabIndex = 28;
            this.reconAutomaticShowHide1.Visible = false;
            this.reconAutomaticShowHide1.SendToBack();
 
            this.Controls.Add(this.reconAutomaticShowHide1);
        }

Open in new window

0
 
LVL 6

Expert Comment

by:Cebik
ID: 24027876
so the second datagridview dont have any colums added ?
add columns before you start to fill it..
try add this befor your procedure..
just for the test..

dgvReconciliations.Rows.Clear();
            dgvReconciliations.Columns.Clear();
            for (int i = 1; i < 9; i++)
                dgvReconciliations.Columns.Add(i.ToString(), "Col" + i.ToString());

Open in new window

0
 
LVL 6

Expert Comment

by:Cebik
ID: 24027898
i wanted to see datagridview initializers not form..
something like this... (dgvReconciliations - yor datagridview name)

// 
// dgvReconciliations
// 
this.dgvReconciliations.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvReconciliations.Location = new System.Drawing.Point(53, 32);
this.dgvReconciliations.Name = "dataGridView1";
this.dgvReconciliations.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.Column1,
            this.Column2});

Open in new window

0
 

Author Comment

by:Adnan
ID: 24027918
oki..i hope this is the correct one u want to see....?!
   private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ReconAutomaticShowHide));
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
            this.pnlReconAutomatocShowHide = new System.Windows.Forms.Panel();
            this.label1 = new System.Windows.Forms.Label();
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.txtNoReconciled = new System.Windows.Forms.Label();
            this.lblNoOpenItemsTxt = new System.Windows.Forms.Label();
            this.lblNoReconciledtxt = new System.Windows.Forms.Label();
            this.txtBoxNoOpenItems = new System.Windows.Forms.Label();
            this.btnAbort = new System.Windows.Forms.Button();
            this.btnRecon = new System.Windows.Forms.Button();
            this.chkBoxAllRelations = new System.Windows.Forms.CheckBox();
            this.chkBoxSelectAllShowHide = new System.Windows.Forms.CheckBox();
            this.dgvReconciliationsShowHide = new System.Windows.Forms.DataGridView();
            this.ClientSelected = new Adra.AMDesk.ReconAutomatic.DataGridViewDisableCheckBoxColumn();
            this.RelationSelected = new Adra.AMDesk.ReconAutomatic.DataGridViewDisableCheckBoxColumn();
            this.ReconSelected = new Adra.AMDesk.ReconAutomatic.DataGridViewDisableCheckBoxColumn();
            this.ClientId = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.RelationId = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.ReconName = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.ReconType = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.ProgressImage = new System.Windows.Forms.DataGridViewImageColumn();
            this.Status = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.PercentDone = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.imageList1 = new System.Windows.Forms.ImageList(this.components);
            this.dataGridViewDisableCheckBoxColumn1 = new Adra.AMDesk.ReconAutomatic.DataGridViewDisableCheckBoxColumn();
            this.dataGridViewDisableCheckBoxColumn2 = new Adra.AMDesk.ReconAutomatic.DataGridViewDisableCheckBoxColumn();
            this.dataGridViewDisableCheckBoxColumn3 = new Adra.AMDesk.ReconAutomatic.DataGridViewDisableCheckBoxColumn();
            this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.dataGridViewImageColumn1 = new System.Windows.Forms.DataGridViewImageColumn();
            this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.pnlReconAutomatocShowHide.SuspendLayout();
            this.tableLayoutPanel1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.dgvReconciliationsShowHide)).BeginInit();
            this.SuspendLayout();
            // 
            // pnlReconAutomatocShowHide
            // 
            this.pnlReconAutomatocShowHide.AutoScroll = true;
            this.pnlReconAutomatocShowHide.AutoScrollMinSize = new System.Drawing.Size(0, 410);
            this.pnlReconAutomatocShowHide.Controls.Add(this.label1);
            this.pnlReconAutomatocShowHide.Controls.Add(this.tableLayoutPanel1);
            this.pnlReconAutomatocShowHide.Controls.Add(this.btnAbort);
            this.pnlReconAutomatocShowHide.Controls.Add(this.btnRecon);
            this.pnlReconAutomatocShowHide.Controls.Add(this.chkBoxAllRelations);
            this.pnlReconAutomatocShowHide.Controls.Add(this.chkBoxSelectAllShowHide);
            this.pnlReconAutomatocShowHide.Controls.Add(this.dgvReconciliationsShowHide);
            this.pnlReconAutomatocShowHide.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pnlReconAutomatocShowHide.Location = new System.Drawing.Point(0, 0);
            this.pnlReconAutomatocShowHide.Name = "pnlReconAutomatocShowHide";
            this.pnlReconAutomatocShowHide.Size = new System.Drawing.Size(710, 412);
            this.pnlReconAutomatocShowHide.TabIndex = 28;
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(163, 21);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(67, 13);
            this.label1.TabIndex = 40;
            this.label1.Text = "Show / Hide";
            // 
            // tableLayoutPanel1
            // 
            this.tableLayoutPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
            this.tableLayoutPanel1.ColumnCount = 2;
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel1.Controls.Add(this.txtNoReconciled, 1, 1);
            this.tableLayoutPanel1.Controls.Add(this.lblNoOpenItemsTxt, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.lblNoReconciledtxt, 0, 1);
            this.tableLayoutPanel1.Controls.Add(this.txtBoxNoOpenItems, 1, 0);
            this.tableLayoutPanel1.Location = new System.Drawing.Point(489, 346);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 2;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
            this.tableLayoutPanel1.Size = new System.Drawing.Size(200, 56);
            this.tableLayoutPanel1.TabIndex = 39;
            // 
            // txtNoReconciled
            // 
            this.txtNoReconciled.Anchor = System.Windows.Forms.AnchorStyles.Right;
            this.txtNoReconciled.AutoSize = true;
            this.txtNoReconciled.Location = new System.Drawing.Point(184, 35);
            this.txtNoReconciled.Name = "txtNoReconciled";
            this.txtNoReconciled.Size = new System.Drawing.Size(13, 13);
            this.txtNoReconciled.TabIndex = 28;
            this.txtNoReconciled.Text = "0";
            // 
            // lblNoOpenItemsTxt
            // 
            this.lblNoOpenItemsTxt.Anchor = System.Windows.Forms.AnchorStyles.Left;
            this.lblNoOpenItemsTxt.AutoSize = true;
            this.lblNoOpenItemsTxt.Location = new System.Drawing.Point(3, 7);
            this.lblNoOpenItemsTxt.Name = "lblNoOpenItemsTxt";
            this.lblNoOpenItemsTxt.Size = new System.Drawing.Size(64, 13);
            this.lblNoOpenItemsTxt.TabIndex = 26;
            this.lblNoOpenItemsTxt.Text = "*Antall åpne";
            // 
            // lblNoReconciledtxt
            // 
            this.lblNoReconciledtxt.Anchor = System.Windows.Forms.AnchorStyles.Left;
            this.lblNoReconciledtxt.AutoSize = true;
            this.lblNoReconciledtxt.Location = new System.Drawing.Point(3, 35);
            this.lblNoReconciledtxt.Name = "lblNoReconciledtxt";
            this.lblNoReconciledtxt.Size = new System.Drawing.Size(83, 13);
            this.lblNoReconciledtxt.TabIndex = 24;
            this.lblNoReconciledtxt.Text = "*Antall avstemte";
            // 
            // txtBoxNoOpenItems
            // 
            this.txtBoxNoOpenItems.Anchor = System.Windows.Forms.AnchorStyles.Right;
            this.txtBoxNoOpenItems.AutoSize = true;
            this.txtBoxNoOpenItems.Location = new System.Drawing.Point(184, 7);
            this.txtBoxNoOpenItems.Name = "txtBoxNoOpenItems";
            this.txtBoxNoOpenItems.Size = new System.Drawing.Size(13, 13);
            this.txtBoxNoOpenItems.TabIndex = 27;
            this.txtBoxNoOpenItems.Text = "0";
            // 
            // btnAbort
            // 
            this.btnAbort.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.btnAbort.BackColor = System.Drawing.Color.Transparent;
            this.btnAbort.Location = new System.Drawing.Point(110, 352);
            this.btnAbort.Name = "btnAbort";
            this.btnAbort.Size = new System.Drawing.Size(89, 23);
            this.btnAbort.TabIndex = 38;
            this.btnAbort.Text = "*Stop";
            this.btnAbort.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
            this.btnAbort.UseVisualStyleBackColor = false;
            // 
            // btnRecon
            // 
            this.btnRecon.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            this.btnRecon.BackColor = System.Drawing.Color.Transparent;
            this.btnRecon.Location = new System.Drawing.Point(15, 352);
            this.btnRecon.Name = "btnRecon";
            this.btnRecon.Size = new System.Drawing.Size(89, 23);
            this.btnRecon.TabIndex = 37;
            this.btnRecon.Text = "*Avstem";
            this.btnRecon.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
            this.btnRecon.UseVisualStyleBackColor = false;
            // 
            // chkBoxAllRelations
            // 
            this.chkBoxAllRelations.AutoSize = true;
            this.chkBoxAllRelations.Location = new System.Drawing.Point(409, 21);
            this.chkBoxAllRelations.Name = "chkBoxAllRelations";
            this.chkBoxAllRelations.Size = new System.Drawing.Size(175, 17);
            this.chkBoxAllRelations.TabIndex = 36;
            this.chkBoxAllRelations.Text = "Avstem alle tilgjengelige klienter";
            this.chkBoxAllRelations.UseVisualStyleBackColor = true;
            this.chkBoxAllRelations.Visible = false;
            // 
            // chkBoxSelectAllShowHide
            // 
            this.chkBoxSelectAllShowHide.AutoSize = true;
            this.chkBoxSelectAllShowHide.Checked = true;
            this.chkBoxSelectAllShowHide.CheckState = System.Windows.Forms.CheckState.Checked;
            this.chkBoxSelectAllShowHide.Location = new System.Drawing.Point(15, 21);
            this.chkBoxSelectAllShowHide.Name = "chkBoxSelectAllShowHide";
            this.chkBoxSelectAllShowHide.Size = new System.Drawing.Size(73, 17);
            this.chkBoxSelectAllShowHide.TabIndex = 35;
            this.chkBoxSelectAllShowHide.Text = "*Merk alle";
            this.chkBoxSelectAllShowHide.UseVisualStyleBackColor = true;
            // 
            // dgvReconciliationsShowHide
            // 
            this.dgvReconciliationsShowHide.AllowUserToAddRows = false;
            this.dgvReconciliationsShowHide.AllowUserToDeleteRows = false;
            this.dgvReconciliationsShowHide.AllowUserToResizeRows = false;
            this.dgvReconciliationsShowHide.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                        | System.Windows.Forms.AnchorStyles.Left)
                        | System.Windows.Forms.AnchorStyles.Right)));
            this.dgvReconciliationsShowHide.BackgroundColor = System.Drawing.Color.White;
            this.dgvReconciliationsShowHide.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.dgvReconciliationsShowHide.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dgvReconciliationsShowHide.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.ClientSelected,
            this.RelationSelected,
            this.ReconSelected,
            this.ClientId,
            this.RelationId,
            this.ReconName,
            this.ReconType,
            this.ProgressImage,
            this.Status,
            this.PercentDone});
            this.dgvReconciliationsShowHide.Location = new System.Drawing.Point(15, 44);
            this.dgvReconciliationsShowHide.Name = "dgvReconciliationsShowHide";
            this.dgvReconciliationsShowHide.RowHeadersVisible = false;
            this.dgvReconciliationsShowHide.Size = new System.Drawing.Size(674, 302);
            this.dgvReconciliationsShowHide.TabIndex = 33;
            // 
            // ClientSelected
            // 
            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
            dataGridViewCellStyle1.NullValue = false;
            this.ClientSelected.DefaultCellStyle = dataGridViewCellStyle1;
            this.ClientSelected.HeaderText = global::Adra.AMDesk.Strings.getengagementbakckup;
            this.ClientSelected.Name = "ClientSelected";
            this.ClientSelected.ThreeState = true;
            this.ClientSelected.Width = 25;
            // 
            // RelationSelected
            // 
            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
            dataGridViewCellStyle2.NullValue = false;
            this.RelationSelected.DefaultCellStyle = dataGridViewCellStyle2;
            this.RelationSelected.HeaderText = global::Adra.AMDesk.Strings.getengagementbakckup;
            this.RelationSelected.Name = "RelationSelected";
            this.RelationSelected.ThreeState = true;
            this.RelationSelected.Width = 25;
            // 
            // ReconSelected
            // 
            dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
            dataGridViewCellStyle3.NullValue = false;
            this.ReconSelected.DefaultCellStyle = dataGridViewCellStyle3;
            this.ReconSelected.HeaderText = global::Adra.AMDesk.Strings.getengagementbakckup;
            this.ReconSelected.Name = "ReconSelected";
            this.ReconSelected.Resizable = System.Windows.Forms.DataGridViewTriState.True;
            this.ReconSelected.ThreeState = true;
            this.ReconSelected.Width = 25;
            // 
            // ClientId
            // 
            this.ClientId.HeaderText = "ClientId";
            this.ClientId.Name = "ClientId";
            this.ClientId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            this.ClientId.Visible = false;
            // 
            // RelationId
            // 
            this.RelationId.HeaderText = "RelationId";
            this.RelationId.Name = "RelationId";
            this.RelationId.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            this.RelationId.Visible = false;
            // 
            // ReconName
            // 
            this.ReconName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
            this.ReconName.HeaderText = "*Name";
            this.ReconName.Name = "ReconName";
            this.ReconName.ReadOnly = true;
            this.ReconName.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            this.ReconName.Width = 45;
            // 
            // ReconType
            // 
            this.ReconType.HeaderText = "Type";
            this.ReconType.Name = "ReconType";
            this.ReconType.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            this.ReconType.Visible = false;
            // 
            // ProgressImage
            // 
            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
            this.ProgressImage.DefaultCellStyle = dataGridViewCellStyle4;
            this.ProgressImage.HeaderText = global::Adra.AMDesk.Strings.getengagementbakckup;
            this.ProgressImage.Image = global::Adra.AMDesk.Images.blank16x16;
            this.ProgressImage.Name = "ProgressImage";
            this.ProgressImage.ReadOnly = true;
            this.ProgressImage.Resizable = System.Windows.Forms.DataGridViewTriState.True;
            this.ProgressImage.Width = 20;
            // 
            // Status
            // 
            this.Status.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
            this.Status.HeaderText = "*Status";
            this.Status.Name = "Status";
            this.Status.ReadOnly = true;
            this.Status.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            // 
            // PercentDone
            // 
            this.PercentDone.HeaderText = global::Adra.AMDesk.Strings.getengagementbakckup;
            this.PercentDone.Name = "PercentDone";
            this.PercentDone.ReadOnly = true;
            this.PercentDone.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            this.PercentDone.Width = 70;
            // 
            // imageList1
            // 
            this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
            this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
            this.imageList1.Images.SetKeyName(0, "Emty.jpg");
            this.imageList1.Images.SetKeyName(1, "Done.jpg");
            this.imageList1.Images.SetKeyName(2, "Play.jpg");
            // 
            // dataGridViewDisableCheckBoxColumn1
            // 
            dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
            dataGridViewCellStyle5.NullValue = false;
            this.dataGridViewDisableCheckBoxColumn1.DefaultCellStyle = dataGridViewCellStyle5;
            this.dataGridViewDisableCheckBoxColumn1.HeaderText = global::Adra.AMDesk.Strings.getengagementbakckup;
            this.dataGridViewDisableCheckBoxColumn1.Name = "dataGridViewDisableCheckBoxColumn1";
            this.dataGridViewDisableCheckBoxColumn1.ThreeState = true;
            this.dataGridViewDisableCheckBoxColumn1.Width = 25;
            // 
            // dataGridViewDisableCheckBoxColumn2
            // 
            dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
            dataGridViewCellStyle6.NullValue = false;
            this.dataGridViewDisableCheckBoxColumn2.DefaultCellStyle = dataGridViewCellStyle6;
            this.dataGridViewDisableCheckBoxColumn2.HeaderText = global::Adra.AMDesk.Strings.getengagementbakckup;
            this.dataGridViewDisableCheckBoxColumn2.Name = "dataGridViewDisableCheckBoxColumn2";
            this.dataGridViewDisableCheckBoxColumn2.ThreeState = true;
            this.dataGridViewDisableCheckBoxColumn2.Width = 25;
            // 
            // dataGridViewDisableCheckBoxColumn3
            // 
            dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
            dataGridViewCellStyle7.NullValue = false;
            this.dataGridViewDisableCheckBoxColumn3.DefaultCellStyle = dataGridViewCellStyle7;
            this.dataGridViewDisableCheckBoxColumn3.HeaderText = global::Adra.AMDesk.Strings.getengagementbakckup;
            this.dataGridViewDisableCheckBoxColumn3.Name = "dataGridViewDisableCheckBoxColumn3";
            this.dataGridViewDisableCheckBoxColumn3.Resizable = System.Windows.Forms.DataGridViewTriState.True;
            this.dataGridViewDisableCheckBoxColumn3.ThreeState = true;
            this.dataGridViewDisableCheckBoxColumn3.Width = 25;
            // 
            // dataGridViewTextBoxColumn1
            // 
            this.dataGridViewTextBoxColumn1.HeaderText = "ClientId";
            this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
            this.dataGridViewTextBoxColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            this.dataGridViewTextBoxColumn1.Visible = false;
            // 
            // dataGridViewTextBoxColumn2
            // 
            this.dataGridViewTextBoxColumn2.HeaderText = "RelationId";
            this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
            this.dataGridViewTextBoxColumn2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            this.dataGridViewTextBoxColumn2.Visible = false;
            // 
            // dataGridViewTextBoxColumn3
            // 
            this.dataGridViewTextBoxColumn3.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
            this.dataGridViewTextBoxColumn3.HeaderText = "*Name";
            this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
            this.dataGridViewTextBoxColumn3.ReadOnly = true;
            this.dataGridViewTextBoxColumn3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            // 
            // dataGridViewTextBoxColumn4
            // 
            this.dataGridViewTextBoxColumn4.HeaderText = "Type";
            this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
            this.dataGridViewTextBoxColumn4.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            this.dataGridViewTextBoxColumn4.Visible = false;
            // 
            // dataGridViewImageColumn1
            // 
            dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
            this.dataGridViewImageColumn1.DefaultCellStyle = dataGridViewCellStyle8;
            this.dataGridViewImageColumn1.HeaderText = global::Adra.AMDesk.Strings.getengagementbakckup;
            this.dataGridViewImageColumn1.Image = global::Adra.AMDesk.Images.blank16x16;
            this.dataGridViewImageColumn1.Name = "dataGridViewImageColumn1";
            this.dataGridViewImageColumn1.ReadOnly = true;
            this.dataGridViewImageColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.True;
            this.dataGridViewImageColumn1.Width = 20;
            // 
            // dataGridViewTextBoxColumn5
            // 
            this.dataGridViewTextBoxColumn5.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
            this.dataGridViewTextBoxColumn5.HeaderText = "*Status";
            this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
            this.dataGridViewTextBoxColumn5.ReadOnly = true;
            this.dataGridViewTextBoxColumn5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            // 
            // dataGridViewTextBoxColumn6
            // 
            this.dataGridViewTextBoxColumn6.HeaderText = global::Adra.AMDesk.Strings.getengagementbakckup;
            this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
            this.dataGridViewTextBoxColumn6.ReadOnly = true;
            this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
            this.dataGridViewTextBoxColumn6.Width = 70;
            // 
            // ReconAutomaticShowHide
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.Color.White;
            this.Controls.Add(this.pnlReconAutomatocShowHide);
            this.Name = "ReconAutomaticShowHide";
            this.Size = new System.Drawing.Size(710, 412);
            this.pnlReconAutomatocShowHide.ResumeLayout(false);
            this.pnlReconAutomatocShowHide.PerformLayout();
            this.tableLayoutPanel1.ResumeLayout(false);
            this.tableLayoutPanel1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.dgvReconciliationsShowHide)).EndInit();
            this.ResumeLayout(false);
 
        }

Open in new window

0
 
LVL 6

Expert Comment

by:Cebik
ID: 24028006
yes..
first of all..
first 3 columns are CheckBox.. so maybe can't accept null value...
try first or example row in second line

object[] argsClient = { false, false, false, cliRow.Client_ID.ToString(), 0, cliRow.ClientName.ToString(), "Client" };
           
object[] argsClient = { false, false, false, "Client ID", "Relation ID", "Recon Name", "ReconType", null, "status", "progress"};            

Open in new window

0
 

Author Comment

by:Adnan
ID: 24028035
Thanks Cebik..... Second line resolve the problem.......!
0
 
LVL 6

Accepted Solution

by:
Cebik earned 500 total points
ID: 24028066
so it should be something like this:

cliRow? i don't know whats this..
so here can be cliRow.clientname.value.tostring() ?


object[] argsClient = { false, false, false, cliRow.Client_ID.ToString(), "0", cliRow.ClientName.ToString(), "Client", null, "status", "progress"}; 

Open in new window

0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

821 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