Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Dataview Value
 

Dataview Value

Hi, I have a form that use a dataview derived from a dataset.

The dataview populates a combobox to allow for row selection and is databound to a textbox called cost which displys the cost of the selected item.

Is there a way that I can assign the value of the cost item from the selected row in the dataview to a variable such as decCost ?

Probably obvious but my mind has gone blank
MigrationUser 1  Thursday, November 11, 2004 1:25 PM
Deccost = dv.item(x).item("ColumnName")

or for the current one you could do

decost = ctype(me.bindingcontext(datasource,"tablename").current,datarowview).item("ColumnName")

Note if you are using a dataview as a datasource to bind with then you would only have the datasource and not the second parameter as above.

Hope this helps
MigrationUser 1  Saturday, November 13, 2004 12:44 AM
Perfect, that's just what I needed

Thanks
MigrationUser 1  Monday, November 15, 2004 3:06 AM

You can use google to search for other answers

Custom Search

More Threads

• Datagridview::copy row including hidden column to another datagridview
• Is it possible for two forms to reference the same instance of a dataset?
• how to use arrow keys in a cell of a grid to move curser in text of the cell?
• DataGridViewComboBoxColumn binding to an Object
• "Provider cannot be found" error for Jet ODBC, Server 2003 R2 x64
• Update a DataTable asynchronously
• DataGridViewCheckBoxColumn / Value of Checkbox in current datarowview?
• restrict Cell Navigation to certain column
• Listbox in a gridview/detailsview update
• Handling Exceptions