Dataview AddNew

JimmyFo

Member
Joined
Aug 15, 2005
Messages
13
Programming Experience
1-3
Hi guys, I can't figure out how to add values to a new dataview row.

The dataview already has data in it, in the form that the first column is integers and the second strings. When I add the new row, I can successfully add the integer value, but the string value remains null:

VB.NET:
[SIZE=2]dvTopicList.AddNew.Row.Item(0) = -1
[/SIZE]

How can I figure out which row in the view it is, and how can I add a new value to item(1)? Creating the row does not return an int value which I can refer to for an item.

Thanks,
James
 
Bah, this doesn't work either = ideas?

VB.NET:
'dvTopicList.AddNew.Row.Item(0) = -1
[/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] test [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#0000ff]CType[/COLOR][/SIZE][SIZE=2](dvTopicList.AddNew(), [/SIZE][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][SIZE=2])
dvTopicList.Item(test).Row.Item(0) = -1
dvTopicList.Item(test).Row.Item(1) = [/SIZE][SIZE=2][COLOR=#800000]" Select All Topics"
 
What's a DataView? I've heard of the grid controls DataGridView and DataGrid but never DataView.

Typically with components such as this, they are a view of a data container. You dont add data to the view, you add it to the data container. If an analogy would help, suppose you have a CCTV camera looking at a scene of an office and you wanted the image to show a pen on the desk. Instead of going to the hassle of drawing the pen onto the image, you would just put a pen on the desk.
 
Back
Top