Results 1 to 4 of 4

Thread: [1.0/1.1]

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Location
    Andhra
    Posts
    2

    [1.0/1.1]

    in windows application how to get the get the current status of the check box?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [1.0/1.1]

    If you only care about checked or not then use the Checked property. This will return True or False and that will be what you want in the vast majority of circumstances.

    If the ThreeState property is set to True, or if you set the CheckState property to Indeterminate in code, then you should use the CheckState property. That will return Checked, Unchecked or Indeterminate. An example of when that is appropriate is when the control is bound to a database field that accepts null values.

    Please provide a meaningful title for your threads in future. Version AND description.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Location
    Andhra
    Posts
    2

    Re: [1.0/1.1] how to get Datagrid boolean column's current state?

    Thanks...i could able to get the state but not the current state of the of the boolean column in the datagrid. Im getting only the previous state. i tried with Datatable_column Changing property. below code.

    Using datagrid -
    dgrdEventOfficeDays[dgrdEventOfficeDays.CurrentCell.RowNumber,column]

    Using Datatable - dataTable.Rows[currentRowNumber][Column]

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [1.0/1.1]

    That changes the question quite a bit from your original post. Please post all the relevant information so time isn't wasted on invalid assumptions.

    The ColumnChanging event is raised when a field value in the column is changing, so the field still contains the old value. If you want the new value you would get it from the e.ProposedValue property, or usually handle the ColumnChanged event instead, which is raised after the field value has changed.

    As for the grid, checking or unchecking a box doesn't update the cell value until it's validated, which occurs when you leave the cell.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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