473,788 Members | 2,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 "databindin gs"? For example, in pseudo-code:

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

Form_Load(...)
myDataSet = AnotherClass.Ge tDataSet(primar yKey);

// All databindings are set in the designer

myDataSetBindin gSource.DataSou rce = myDataSet; // Example

I'd be willing to describe the schema in "myDataSetBindi ngSource" 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 1600
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 "databindin gs"? For example, in pseudo-code:

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

Form_Load(...)
myDataSet = AnotherClass.Ge tDataSet(primar yKey);

// All databindings are set in the designer

myDataSetBindin gSource.DataSou rce = myDataSet; // Example

I'd be willing to describe the schema in "myDataSetBindi ngSource" 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
3684
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 convert the bool value to some meaningful text. i.e. Binding b = new
3
2280
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 record from the DB for editing I also want to allow the designer to use the same technique. At the moment I am still using a DataList for the single row, but this seems like the wrong thing to do. How should I be doing it?
0
1453
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 Binding window of the DataBindings dialog. I then found this site (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxurfDataBindingsDialogBox.asp) which says: The tree view displays these objects: the Page object; any...
2
1720
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 anyone help with the required syntax? if i do TExtbox1.text = x.firstname it works ok, but I want to edit the textbox setting the value of x.firstname.
13
5347
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 would like to do (of course) is set the DataBindings. Something clearly is wrong with the approach I use, because I can't set the Properties in the Designer, the DataSource-Property appears like 'ReadOnly', there is no "dropdown" with the list from...
2
1763
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 Access database in my program. -- I am a Noob! Thanks for the Help :)
8
2186
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 answered... In 1.1 we always did our own myDataAdapter.fills and we liked that control for lots of good reasons. Now the new DataSource (or is it a TableAdapter:Dataset) automatically fills the Gridview. How can we control that fill? In a...
11
1816
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 adapter.update it gives me 0 records updated! I am not getting any exceptions. Below is the complete code. Someone please help me out. using System; using System.Drawing; using System.Collections; using System.ComponentModel;
5
1745
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 Manager() { public Employee EmployeeInfo }
0
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10364
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10172
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.