473,406 Members | 2,954 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,406 software developers and data experts.

DataBinding objects in the Designer/GUI

dev
Hi everyone, Is there a way to bind a control (TextBox) to an untyped
public DataSet on a WinForm and have its columns appear in the designer
under "databindings"? For example, in pseudo-code:

public DataSet myDataSet = null; // could be exposed as a property
(...)

Form_Load(...)
myDataSet = AnotherClass.GetDataSet(primaryKey);

// All databindings are set in the designer

myDataSetBindingSource.DataSource = myDataSet; // Example

I'd be willing to describe the schema in "myDataSetBindingSource" or in
a drag-and-drop DataSet, etc, but I think setting the bindings in code
isn't the way it's done- I'm not stuck on using the GUI ;), just want a
standard to follow. Also, when I bind to an object or typed dataset,
where the schema is already exposed, everything works great. Thanks for
any suggestions!

Jul 25 '06 #1
1 1587
de*@fwcjua.com wrote:
Hi everyone, Is there a way to bind a control (TextBox) to an untyped
public DataSet on a WinForm and have its columns appear in the
designer under "databindings"? For example, in pseudo-code:

public DataSet myDataSet = null; // could be exposed as a property
(...)

Form_Load(...)
myDataSet = AnotherClass.GetDataSet(primaryKey);

// All databindings are set in the designer

myDataSetBindingSource.DataSource = myDataSet; // Example

I'd be willing to describe the schema in "myDataSetBindingSource" or
in a drag-and-drop DataSet, etc, but I think setting the bindings in
code isn't the way it's done- I'm not stuck on using the GUI ;), just
want a standard to follow. Also, when I bind to an object or typed
dataset, where the schema is already exposed, everything works great.
Thanks for any suggestions!
THe designer has to know type information at design time, so it has
to know what columns the tables in the dataset have to give you the
ability to set the textbox' binding to one of these columns. As the
dataset's columns aren't known at design time in the construction
you're working with, you won't get the info at design time and have to
setup the bindings in code.

There's nothing wrong with setting up the bindings in code however.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Jul 26 '06 #2

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

Similar topics

15
by: Tim Jarvis | last post by:
Hi, I have an object that I am binding to a text box, this object exposes a boolean field, and I have implemented a format event handler and a parse event handler for the binding object, where I...
3
by: Peter Morris [Droopy Eyes Software] | last post by:
Hi all When I bind to multiple records I use a DataList. This allows the web-designer to add code like <%#DataBinder.Eval(Container.DataItem, "Name")%> Whenever I want to retrieve a single...
0
by: Ian | last post by:
I have sub-classed the Page class in order to provide some base properties and methods that every page on my site will need access to. I would like to have these things show up in the Simple...
2
by: Colin Robinson | last post by:
Help please I have an example class called Person with 2 public properties Firstname and Lastname, I cant create a textbox on an asp.net form bound to the Person.Firstname property Can...
13
by: Michael Maes | last post by:
Hi, I have a UserControl containing some controls of which one is a ComboBox. All the InternalControls are Private and some are allowed to be accessed through Public Methods. One of the things I...
2
by: Shane | last post by:
When I click on the DataBinding in the properties window a list of options open up called Advanced,Tag and Text. I would like to know what Tag and Text are set to? I hope to Bind a text box to a...
8
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
11
by: =?Utf-8?B?R29rdWw=?= | last post by:
I am struck up with a problem and want anyone here to help me out. I am a beginner in .NET trying to learng DataBinding concepts. I have binded 4 text boxes with a dataset but when I say...
5
by: Patrick | last post by:
I've been struggling with a while. Could someone please help me out? I need to bind a property (wich is an custom object) to a combobox that contains a list of the same objects. ex: class...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
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.