Home All Groups Group Topic Archive Search About
Author
22 May 2006 3:43 AM
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

Author
22 May 2006 10:56 AM
Ken Tucker [MVP]
Hi,

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

Ken
----------------------
Show quoteHide quote
"Lespaul36" <lespau***@none.net> wrote in message
news:etKkSHVfGHA.1792@TK2MSFTNGP03.phx.gbl...
>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
>
Author
23 May 2006 1:12 AM
Lespaul36
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

Show quoteHide quote
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:e$7E05YfGHA.1260@TK2MSFTNGP05.phx.gbl...
> Hi,
>
>        It should not make a difference what type of datasource your
> datagrid is bound to.  Please post some code.
>
> Ken
> ----------------------
> "Lespaul36" <lespau***@none.net> wrote in message
> news:etKkSHVfGHA.1792@TK2MSFTNGP03.phx.gbl...
>>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
>>
>
>
Author
24 May 2006 1:51 AM
Ken Tucker [MVP]
Hi,

        You should be setting the value in commit and when the textbox loses
focus.  Here is an example

http://www.vb-tips.com/default.aspx?ID=e51432cb-e517-4bae-bc26-7320e41e6d05

Ken
-----------------
Show quoteHide quote
"Lespaul36" <lespau***@none.net> wrote in message
news:%2390swXgfGHA.356@TK2MSFTNGP02.phx.gbl...
> 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
>
> "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
> news:e$7E05YfGHA.1260@TK2MSFTNGP05.phx.gbl...
>> Hi,
>>
>>        It should not make a difference what type of datasource your
>> datagrid is bound to.  Please post some code.
>>
>> Ken
>> ----------------------
>> "Lespaul36" <lespau***@none.net> wrote in message
>> news:etKkSHVfGHA.1792@TK2MSFTNGP03.phx.gbl...
>>>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
>>>
>>
>>
>
>
Author
24 May 2006 6:13 AM
Lespaul36
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.

Show quoteHide quote
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uP88NStfGHA.4900@TK2MSFTNGP02.phx.gbl...
> Hi,
>
>        You should be setting the value in commit and when the textbox
> loses focus.  Here is an example
>
> http://www.vb-tips.com/default.aspx?ID=e51432cb-e517-4bae-bc26-7320e41e6d05
>
> Ken
> -----------------
> "Lespaul36" <lespau***@none.net> wrote in message
> news:%2390swXgfGHA.356@TK2MSFTNGP02.phx.gbl...
>> 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
>>
>> "Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
>> news:e$7E05YfGHA.1260@TK2MSFTNGP05.phx.gbl...
>>> Hi,
>>>
>>>        It should not make a difference what type of datasource your
>>> datagrid is bound to.  Please post some code.
>>>
>>> Ken
>>> ----------------------
>>> "Lespaul36" <lespau***@none.net> wrote in message
>>> news:etKkSHVfGHA.1792@TK2MSFTNGP03.phx.gbl...
>>>>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
>>>>
>>>
>>>
>>
>>
>
>