DataGridViewCheckBox

DataGridViewCheckBox

am 05.12.2007 19:53:47 von Ratnakar Pedagani

Hi,

I have a datagridview in which i have a DataGridViewCheckBoxColumn. I
want to know which event should i use so that whenever i check the
checkbox, it should immediately notify me saying that this particular
row, this checkbox has been checked. I tried cellvalueChanged event,
but it fires only once it loses the focus from that row. Any
suggestions or help is highly appreciated.

Thanks,
Ratnakar.

Re: DataGridViewCheckBox

am 06.12.2007 01:24:12 von Jay Parzych

i use the CellContentClick event and then look at the e.ColumnIndex
after checking that the e.RowIndex is > -1

here is the start of code to look at it:

If (e.RowIndex > -1) Then

Select Case e.ColumnIndex

Case Enums.FaxGrid.Ignore

ignoreBefore =
CType(faxGrid.CurrentRow.Cells(Enums.FaxGrid.Ignore).Value.T oString,
Boolean)

faxGrid.EndEdit()

ignoreAfter =
CType(faxGrid.CurrentRow.Cells(Enums.FaxGrid.Ignore).Value.T oString,
Boolean)

If ignoreAfter <> ignoreBefore Then

Ratnakar Pedagani wrote:
> Hi,
>
> I have a datagridview in which i have a DataGridViewCheckBoxColumn. I
> want to know which event should i use so that whenever i check the
> checkbox, it should immediately notify me saying that this particular
> row, this checkbox has been checked. I tried cellvalueChanged event,
> but it fires only once it loses the focus from that row. Any
> suggestions or help is highly appreciated.
>
> Thanks,
> Ratnakar.

Re: DataGridViewCheckBox

am 06.12.2007 18:45:42 von Ratnakar Pedagani

On Dec 5, 4:24 pm, jay parzych wrote:
> i use the CellContentClick event and then look at the e.ColumnIndex
> after checking that the e.RowIndex is > -1
>
> here is the start of code to look at it:
>
> If (e.RowIndex > -1) Then
>
> Select Case e.ColumnIndex
>
> Case Enums.FaxGrid.Ignore
>
> ignoreBefore =
> CType(faxGrid.CurrentRow.Cells(Enums.FaxGrid.Ignore).Value.T oString,
> Boolean)
>
> faxGrid.EndEdit()
>
> ignoreAfter =
> CType(faxGrid.CurrentRow.Cells(Enums.FaxGrid.Ignore).Value.T oString,
> Boolean)
>
> If ignoreAfter <> ignoreBefore Then
>
>
>
> Ratnakar Pedagani wrote:
> > Hi,
>
> > I have a datagridview in which i have a DataGridViewCheckBoxColumn. I
> > want to know which event should i use so that whenever i check the
> > checkbox, it should immediately notify me saying that this particular
> > row, this checkbox has been checked. I tried cellvalueChanged event,
> > but it fires only once it loses the focus from that row. Any
> > suggestions or help is highly appreciated.
>
> > Thanks,
> > Ratnakar.- Hide quoted text -
>
> - Show quoted text -

Jay,

Thanks a lot, it Works !!!!