Connecting Tech Pros Worldwide Help | Site Map

Dataset management

Newbie
 
Join Date: Jul 2009
Location: Milan, Italy
Posts: 1
#1: Jul 13 '09
Ciao,
I'm a bit disappointed with my incapacity to deal with this, there must be a simple way but I can't find it.

I'm making it simple:
I have a typed dataset with two columns.
I bound the two columns on a windows form with a combobox and a textbox
I have a button on my form which is performing an addnew on the dataset.

I'm managing the columnchanging event on the dataset to obtain this:

whenever column A value is changed using the combobox column B is updated.

Seems easy, but what happens is that the textbox on the form is not refreshed.

Below you can find the code of the columnchanging event:

Expand|Select|Wrap|Line Numbers
  1.     Private Sub TestataDataTable_ColumnChanging(ByVal sender As System.Object, ByVal e As System.Data.DataColumnChangeEventArgs) Handles Me.ColumnChanging
  2.       If (e.Column.ColumnName = Me.IDDocumentoColumn.ColumnName) Then
  3.         'Add user code here
  4.       End If
  5.  
  6.       If (e.Column.ColumnName = Me.TipoDocumentoColumn.ColumnName) Then
  7.         If e.Row.HasVersion(DataRowVersion.Current) Or e.Row.HasVersion(DataRowVersion.Proposed) Then
  8.           If e.ProposedValue <> e.Row.Item(e.Column, DataRowVersion.Proposed) Then
  9.             If e.ProposedValue <> "0" Then
  10.               e.Row.Item("NumeroDocumento") = DocMethods.GetNewDocNumber(e.ProposedValue, e.Row.Item("DataDocumento"))
  11.             End If
  12.           End If
  13.         Else
  14.           If e.ProposedValue <> "0" Then
  15.             MsgBox("pluto")
  16.           End If
  17.         End If
  18.       End If
  19.  
  20.     End Sub
  21.  
Why I am no able o refresh the textbox?

Thanks in advance,
Pino
Reply