in windows application how to get the get the current status of the check box?
Printable View
in windows application how to get the get the current status of the check box?
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.
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]
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.