Results 1 to 2 of 2

Thread: [RESOLVED] win Forms -DataGrid Reset Current Cell to 0 on Checkbox changed

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2010
    Posts
    92

    Resolved [RESOLVED] win Forms -DataGrid Reset Current Cell to 0 on Checkbox changed



    basically i m looking for if i click on my checkbox ,it should reset my datagrid column lastseqno to 0.

    is it possible

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Feb 2010
    Posts
    92

    Re: win Forms -DataGrid Reset Current Cell to 0 on Checkbox changed

    vb Code:
    1. foreach (DataGridViewRow dgv in dGVNewSeries.Rows)
    2.                     {
    3.                         dgv.Cells["LASTSEQNO"].Value = 0;
    4.  
    5.                     }
    6. //Second Method
    7.                     for (int i = 0; i <= dGVNewSeries.Rows.Count - 1; i++)
    8.                     {
    9.                         if (dGVNewSeries.Rows[i].Cells["LASTSEQNO"].Value.ToString().Length != 0)
    10.                         {
    11.                             dGVNewSeries.Rows[i].Cells["LASTSEQNO"].Value = 0;
    12.                         }
    13.                     }
    14.  
    15.  If Chkboxl.Checked = True Then
    16.         For Each dr As DataGridViewRow In YourDataGridView.Rows
    17.           dr.Cells("lastseqno").Value = 0
    18.         Next
    19.       End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width