473,699 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing the dropdown list subset on a DataGridView combobox column at runtime

3 New Member
i have a same problem too Changing the dropdown list subset on a DataGridView combobox column at runtime. I am using WPF C# VS 2010. i hv an example some like this:
//#######
Reference,
Link: http://www.codeproject .com/Articles/245787/Changing-the-dropdown-list-subset-on-a-DataGridVie
//#######

Table_main structure:
|autoid||parent _id||datatable# ||mapTable* |
|0 ||1 ||Finance ||departement|
|1 ||2 ||Computer ||Accessories|

Table_departeme nt structure
|autoid||Financ e ||Accounting||C ollection |
|0 ||1 ||1200 ||22 |
|1 ||2 ||12 ||12 |

Table_Accessori es structure
|autoid||Comput er ||Printer ||Scanner |
|0 ||1 ||1500 ||62 |
|1 ||2 ||14 ||77 |

*) MapTable are name of Table in other database.
#) datatable are column name of Table in "MapTable"
Jul 24 '13 #1
1 2054

Sign in to post your reply or Sign up for a free account.

Similar topics

3
3797
by: Dmitry Korolyov [MVP] | last post by:
Is that possible? In other words, I want a dropdown list (and other list-type controls) which appears in edit more of a templated column to be populated with data at the run time. An attempt to do so results in non-existing object error. (Object reference not set to an instance of an object). -- Dmitry Korolyov MVP: Windows Server - Active Directory
2
9642
by: Greg | last post by:
I've populated all the cells in a combo box column with values from 1 - 50 using the following code: foreach (DataGridViewRow row in uxTabSummary.Rows) { DataGridViewComboBoxCell cell = (DataGridViewComboBoxCell) row.Cells; for (int i = 1; i < 51; i++) { cell.Items.Add(i);
3
94256
by: sklett | last post by:
I'm changing from a DataGrid to a DataGridView and have run across a problem. The items that are bound to the DataGrid have an int Property that represents a primary key of a lookup table in my database. For example: table JobTypes 1 | Manager 2 | Controller 3 | Supervisor table Employee
0
1081
by: polaris431 | last post by:
I would like to have a combobox control that when clicked, displays a DataGridView in-place of the normal dropdown list. I want it to be a DataGridView with editing capabilities. The DataGridView would be bound to a database. Microsoft Access has had this capability for years. I've scrounged the Internet including the CodeProject but can't find any free controls or source code. Does anyone know where I can find something like this? If not,...
1
2811
by: Terry Olsen | last post by:
I have a Datagridview that is bound to a DataTable. So there are no column templates to modify at design time. Is there a way I can convert a certain column (if it exists) to a ComboBoxColumn at runtime after the Datagridview is bound? *** Sent via Developersdex http://www.developersdex.com ***
1
1710
by: Bhavanimikkilineni | last post by:
H, At this moment my problem is how to make suplier combobox has different list in every row. I want suplier lists that related with a certain product instead of providing all the supliers. Let say "product A" only has "Suplier B", "Suplier D" and "Suplier E", "Product B" only has "Suplier A", "Suplier C", and "Product C" only has "Suplier B", "Suplier D". I can provide store procedure for this, but I don't know how to put this different...
0
1476
by: Chris Bray | last post by:
I have a data grid view which works very well in almost all respects. However, I have a problem that arises when I allow the addition of items to the grid on the fly. I do this by intercepting the OnEditingControlShowing handler and setting the DropDownStyle to ComobBoxStyle.DropDown: protected override void OnEditingControlShowing(DataGridViewEditingControlShowingEventArgs e) { cb = e.Control as ComboBox; ...
0
1692
by: priyamtheone | last post by:
There's an editable datagridview populated from a table say tblItems. Among the columns of the datagridview there's a combobox column named 'Category'. This column is populated by the respective 'Category' column of tblItems. Now in the 'Category' column of the datagridview I want to set the value of a certain cell to Null programmatically. Suppose when I press keyboard Delete button over the cell or some other button on the form, the value of...
1
1993
by: Hardy123 | last post by:
Hi, I am having a combobox column in a datagridview named "dgcProfessor" which contains the list of professors names. i am filling that column with a datatable Now that datatable have more than 10000 records in it so now when i want to select a professor from that list I click on the dropdown arrow of the combobox column but the dropdown list takes some time to display the list of professors on the screen, so it is not displaying in...
0
2847
by: visweswaran2830 | last post by:
Hi, I am having datagridview in that I have datagridview combobox column and noraml textfield. I want to know that how can I load selected value in that combox box when I am loading all entered details in data grid view.
0
8628
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
9199
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
9054
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
8943
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
8899
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...
1
6550
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
4637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3075
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2016
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.