Custom Datagridstyle

  • Thread starter Thread starter Lespaul36
  • Start date Start date
L

Lespaul36

I have made a datagridstyle that works with mysql. So far things are OK,
but it won't seem to save changes made even if I use the
SetColumnValueAtRow. Is there more to it.
Thanks
 
Hi,

It should not make a difference what type of datasource your
datagrid is bound to. Please post some code.

Ken
 
here is the code in the inherited DataGridColumnStyle that is used to set
the value

Public Function SetValue(ByVal DataSource As CurrencyManager, ByVal RowNum
As Integer, ByVal Value As Boolean) As Boolean

Try
Me.SetColumnValueAtRow(DataSource, RowNum, CInt(Value))
Return True

Catch ex As Exception
Return False
End Try

End Function



I am using a textbox so it would be something like

Private Sub chkBox_CheckedChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles chkBox.CheckedChanged
If Not mDataGridColumn Is Nothing Then
mDataGridColumn.SetValue(Me.mCurMan, Me.RowNum,
CInt(chkBox.Checked))
End If
End Sub
 
Found the problem..when trying to use cbool(intNum) it was giving a 0 or -1
which didn't work well with what I was doing..do I had to check the values
and change them to 0 or 1 instead.
 
Back
Top