is it possible using a datarow as a binding datasource? (C#)

  • Thread starter =?iso-8859-1?q?f=E9rnas_-_Brasil?=
  • Start date
?

=?iso-8859-1?q?f=E9rnas_-_Brasil?=

Hello all,

I have a datarow that doesn't belongs to any datatable... this
dataRows was created this way:

DataRow dro = new DataRow();

then, I made a binding between some textboxes of the form and
datacolumns of this datarow...

I made the bindings on the form's load... when the form load's and
there is some value in the datarow, the binding works fine and the
textbox assumes the value of the datacolumn specified... The problem
is that when, after the form's load, I change the values of this
dataRow, the textbox doesn't refresh....

I tried using the "datarow".AcceptChanges(), but it returns a erros
telling me that the datarow isn't in a datatable (and it really
isn't).

is there anyway to make it works??

thanks
 
P

Peter Foot [MVP]

Create a new DataTable/DataSet and create the row in that, it shouldn't
affect the way you work with the specific row e.g.

myTable.Rows[0].Columns[x]

And DataTable give you IListSource (hence IList) support.

Peter
 
?

=?iso-8859-1?q?f=E9rnas_-_Brasil?=

Create a new DataTable/DataSet and create the row in that, it shouldn't
affect the way you work with the specific row e.g.

myTable.Rows[0].Columns[x]

And DataTable give you IListSource (hence IList) support.

Peter

--
Peter Foot
Device Application Development MVPwww.peterfoot.net|www.inthehand.com



Hello all,
I have a datarow that doesn't belongs to any datatable... this
dataRows was created this way:
DataRow dro = new DataRow();
then, I made a binding between some textboxes of the form and
datacolumns of this datarow...
I made the bindings on the form's load... when the form load's and
there is some value in the datarow, the binding works fine and the
textbox assumes the value of the datacolumn specified... The problem
is that when, after the form's load, I change the values of this
dataRow, the textbox doesn't refresh....
I tried using the "datarow".AcceptChanges(), but it returns a erros
telling me that the datarow isn't in a datatable (and it really
isn't).
is there anyway to make it works??
thanks- Ocultar texto entre aspas -

- Mostrar texto entre aspas -

Thanks man.... good ideia!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top