|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Custom DatagridstyleI 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 ---------------------- 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 > 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 >> > > 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 >>> >> >> > > 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 >>>> >>> >>> >> >> > >
Resetting the value of a System.Web.UI.HtmlControls.HtmlInputFile
Order of events, databinding, and UserControls Ayuda contra unos programadores de Linux y PHP que me quieren dañar un negocio Printing second time fails Transparent Form surface Really puzzled (or maybe just totally confused) about VB.NET and ADO.NET AppStartup "Cancel" leaves splash form loaded Stepping through datagridview rows in code Determining whether the current item is the last one from inside ItemDataBound Setup question |
|||||||||||||||||||||||