473,898 Members | 4,077 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

binding datacolumn to another datacolumn in a datagrid

i have a datatable 'Users' with two columns:

i have a datagrid with two columns that I want to bind with the
'Authors' table:

'FriendlyName' : ComboBox column populated from another datatable with
two columns (DisplayMember = 'Name' which holds a FriendlyName and
ValueMember = 'ID' which holds a UserName)

'UserName' : TextBox column to be populated (readonly) from the 'ID'
(ValueMember') of the currently selected 'FriendlyName'
(DisplayedMembe r)

The idea is that when you select a friendly name from the ComboBox, the
'Author' table then holds that name in 'FriendlyName' and the
corresponding 'UserName'.

I have the combobox column working and both column in the grid that are
binding, but how do I bind the 'ValueMember' of the current combobox to
the second column which is also bound to the 'UserName' column of the
original 'Authors' table?

Nov 23 '05 #1
0 1019

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

Similar topics

by: Dalibor Kusic | last post by:
The DataTable contains, for example, only one column of lets say Person class. Person class has three fields, and a constructor that takes a single string and parses it over those three fields. Now, how do I modify the Person class (which interfaces to implement) so I can bind my DataTable to a DataGrid and then add, modify and delete records through it?
by: brian | last post by:
Can you bind a datarelation to a datagrid? I posted my code below. I built a datarelation with "Users" as parent and "Computer" as child to create a table called "Info" in dataset "ds". I bind my datagrid to the datarelation table "Info" but the datagrid shows up empty. I debugged the "Info" table and it shows no records. The purpose of this is that I need the child table to
by: epigram | last post by:
Well, conceptually this is what I want to do. I was hoping to use an ArrayList to build a (dynamic) array of string arrays, and then bind the ArrayList object to a DataGrid. I can do that, but it doesn't give me the results that I wanted. Is there a way to successfully do this? I even tried to bind a multidimensional array (string ) to a DataGrid, but an exception is thrown with the message "Array was not a one-dimensional array". I'm...
by: Demetri | last post by:
Someone posted the following back in June and I am now doing the same thing. I'll just paste what was asked and see if anyone can give us an answer: --------------------------------------------------------------------------------- I have a custom collection of objects, each of which includes a child object called MyUserOpener. In declarative binding, I can bind this property to a label in a template control with the following syntax: ...
by: ¿ Mahesh Kumar | last post by:
- I have created a datatable as mydatatable and pointed that table to gridview...AM I CORRECT below.. --------------------------------- DataTable myDatatable=new DataTable("ParentTable"); DataColumn myDataColumn=new DataColumn();
by: mark | last post by:
What I have is three forms. Form one with buttons 1, 2 and 3; and forms 2 and 3 with datagrids. Button 1 populates arrays a(i,j) and b(i,j) with values. Button 2 creates a datatable containing the a(i,j) array then adds that table to a dataset which is in turn bound to a datagrid in an instance of form 2 called matrixa. Button 3 creates a datatable containing the b(i,j) array then adds that table to a dataset which is in turn bound to...
by: bordsby | last post by:
Situation: I am using an OleDbDataAdapter to fill a DataSet's DataTable with data from an Access database. The DataSet's DataTable is bound to a DataGrid. After the OleDbDataAdapter.Fill method is called, the DataGrid displays the column headings as the column names output from the Access SQL query. I would like to change some of the styles for certain columns in the DataGrid, so I first need to set the DataGridColumnStyle.MappingName...
by: =?Utf-8?B?cGpzaW1vbg==?= | last post by:
I get the following error: Unhandled Exception, Log_Id does not belong to table Queue .... when I execute the following code ("dgQueue" is my datagrid control): Dim dtQueue As DataTable = gclsDataLayer.GetQueue() dgQueue.DataSource = Nothing dgQueue.SetDataBinding(dtQueue, "") dgQueue.Refresh()
by: RobertTheProgrammer | last post by:
Hi folks, I've got another problem. Basically, I'm trying to use a nested GridView, however the nexted GridView displays no values (even though in debug I'm getting valid values into my DataSet. It's probably a binding issue somewhere, but I'm not sure where. Here's the ASP (slightly edited to remove verbosity): <asp:GridView ID="GridViewMain" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" ...
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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...
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,...
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...
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...
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...
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...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.