Mapping Table to Grid

L

Levon Levonian

Hi All,

I have a datatable with following items:
ID | City
23 | London
29 | Paris
45 | Roma

it is binded to a grid. Grid rows' ids are 0, 1, and 2, as well as table's
rows are 0, 1, and 2. When I sort a table or a grid, how can I access a
record whose ID=23. I need a simple mechanism to allow me to access an
underlying row in a table by supplying it the value from any column in the
table (like ID or City).

Thank you
 
L

Levon Levonian

Hello Sahil,

thank you for your help, however I have a problem with the Select() method.
I do like this:

Dim drTasks() As DataRow

drTasks = g_dsTasks.Tables("TasksToDo").Select("ID=14")

and when I view drTasks array in the Watch window, I can see that there is a
rowID property, which is exactly what I need!!! As I understand this rowID
value is the ID or the row in the table on which I did the Select().
However, when I write a statement:

Dim id As Integer = drTasks(0).rowID

then VS warns me that there is no such property as rowID. How can it be so?
in the Watch window it is there! Tell me please how to access that rowID
property, and I will be very happy.

Thank you
 

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