Hi,
I am trying to figure out the best approach for this
simple scenario.
I have one C# Windows application Form that consumes few
web services for all data related function.
In this form I do have few fields bind to the dataset
DS , return from the WEB service.
One data grid with the same dataset DS bind to it.
This is working great, when I move in the grid the bind
field are updated, I can insert, update, delete from the
grid ok, I can also move to first, last next ,previous
using the databinding context with out any issue.
I also have one treeview where you can drill down and
select a specific item GUID which return the primary key
for the dataset.
Using the find command of the dataset, I can retrieve the
row, but as you know it does not return the index inside
the dataset that can be use with the
BindingContext.position.
So my question is HOW can I position my grid to this
specific GUID row, and how can I refresh the field
already bind to the dataset DS to reflect the same row.
Some one say to use the view instead, and bind it to the
grid and the fields, and then use the find of the view
which return the index.
So I try to use the same Dataset DS, and create the view
from it with the following command,
parent.myDVexpense = new DataView
(parent.myDSexpense.Tables["Expense"],"","ID",
DataViewRowState.CurrentRows);
parent.dgExpense.SetDataBinding
(parent.myDVexpense,"Expense");
From the debugger I can see that the view does exist with
12 rows, but for some obscure reason so far, it does not
bind to the datagrid dgExpense which is formatted for
this dataset DS already, so all columns should be the
same.
I always receive the error "Cannot create a child list
for field Expense".
Question :
1- Does any one have an idea of WHY this append?
2- Is this solution of using the view instead of the
dataset is the best approach? Personally I will have
prefer to stick with the dataset and just find a way to
position my self in the grid using the information return
from the row of the find command from the dataset and
also to re-bind all the field to the same row.
Any idea will be appreciated,
Carl,