473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Best approach for databindind and bindingcontext

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,

Nov 15 '05 #1
0 1266

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Patrick | last post by:
I'm working on a contact management application, and need a hand with one aspect... Here's what I want to create: ------------------------------------ A form split into two parts. There is a...
1
by: D. Yates | last post by:
Hi, I retrieved the employee table from the Pubs database into a single dataset called, dataSet12. I dropped two textbox controls and a datagrid control onto the same form and bound the...
0
by: Nathan Carroll | last post by:
Attempting to eliminate flicker showing (form) and hiding seems to have no effect as I have it below. if I move the lines: Me.Show() Me.ShowInTaskbar = True f.Close() to the end of the...
1
by: Edwin | last post by:
Hi, I created a dataform with the data form wizard which created some textboxes and 1 checkbox. When I add a row (see section "Add Row" for code) the newly added is not accessible. A label...
4
by: T.Jackson | last post by:
Hi guys, I want to display the data of a table in a datagrid in one form, & enable the user to edit the details of a particular record in another form. I want the following features, 1....
12
by: Aaron Smith | last post by:
What is the best way to handle data in a multiple user environment? We have forms that will allow users to add edit and delete data from a table on SQL server. The data could be edited on multiple...
18
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For...
6
by: MeowCow | last post by:
I have created a UserControl that encapsulates a third party data grid. My goal was to create my own DataSource and DataMember properties that forward the binding to the third party grid, then use...
3
by: frostbb | last post by:
Greetings, We're starting to transition our legacy C# apps from earlier versions to VS2008 versions. Many of our apps allow the user to select a row from a DataGrid into a 'Data Edit' area...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.