473,406 Members | 2,371 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.

how to create a tag in datagrid column

i have a datagrid in my form that has a combobox in it. the actual
data of a combobox is a number because this is a foreign key from
another table. i can create tag successfully in combobox located in
form but not inside the datagrid.

this is the sample combobox that i have created that has no problem
With cboProgram
.DataSource = DsStudentCourse1
.DisplayMember = "Program.ProgramTitle"
.ValueMember = "Program.ProgramID"
.DataBindings.Add("Tag",
DsStudentCourse1.Tables("Students"), "ProgramID")
.DataBindings.Add(New Binding("SelectedValue", _
DsStudentCourse1, "Students.ProgramID"))
End With

and call this tag using this code w/ out problem

Dim intProgramID As Integer = cboProgram.Tag.ToString

here's my problem. i try this w/ no luck

Dim grdColStyle6 As New DataGridComboBoxColumn()

With grdColStyle6
.MappingName = "MajorID" 'must be from the grid
table...
.HeaderText = "Major"
.Width = 120
.ColumnComboBox.DataSource =
DsStudentCourse1.Tables("Major").DefaultView 'dv;
.ColumnComboBox.DataBindings.Add("Tag",
DsStudentCourse1.Tables("Major"), "MajorID")
.ColumnComboBox.DisplayMember = "MajorID"
.ColumnComboBox.ValueMember = "MajorID"

grdTableStyle1.PreferredRowHeight =
..ColumnComboBox.Height + 2
End With

i have put the variable grdColStyle6 outside this procedure so that i
can call it from other procedure...

here's my sample code that does not work after calling the tag.

Dim intMajorID As Integer = grdColStyle6.ColumnComboBox.Tag

i would be very glad for any help you can give.
Nov 20 '05 #1
0 921

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

Similar topics

5
by: Jean Carlo | last post by:
Hello guys I`m developing a windows form that contain one Datagrid. In this datagrid I insert a checkBox Column. I need to get all rows where checkbox is checked by user. How do I get this...
3
by: PeterZ | last post by:
Hi, In a running C# app with a datagrid control I select all rows in the dataGrid using CTRL-A, I then paste into some other app like notepad or Word but the column headings get left off. Is...
3
by: ruca | last post by:
Hi, I have two different questions to ask: QUESTION 1: Can I create dinamically a column in a datagrid? How? I have a datagrid that must have 5 columns, but in some very special cases I have...
0
by: optimizeit | last post by:
What I am attempting to do is import an Excel Workbook and display the worksheets in a datagrid dynamically. I am very close to getting this to work. I have to this point successfully imported a...
1
by: Shapper | last post by:
Hello, How to create a Template Column with an Image in a datagrid from my VB code? Thanks, Miguel
10
by: JohnR | last post by:
I have a datatable as the datasource to a datagrid. The datagrid has a datagridtablestyle defined. I use the datagridtablestyle to change the order of the columns (so they can be different than...
1
by: Dale Williams | last post by:
Everyone: Using C#, I'm trying to create a datagrid on a winform programatically. I placed the datagrid and the form and named it CHGrid. Here's the code I'm using: // Get and bind the data....
10
by: Corey B | last post by:
I have a data grid that has three columns: First Name, Middle Name, and Last Name. The grid has a list of people with a blank row at the bottom of the grid (in the footer) that allows the user to...
0
by: dotnet dude | last post by:
I am creating a DataGrid control (ASP.NET 1.) with few bound columns and one template column in which i want to display CheckBox. So for each row in datagrid some databound fields and a checkbox...
2
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
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...
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
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...
0
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,...
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.