473,395 Members | 1,680 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,395 software developers and data experts.

Setting Datagridview combobox column value to null.

88 64KB
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 the cell becomes Null. Datagridview.keydown event isn't working as when the cell is selected the focus is actually on the editingcontrol of the cell and not the datagridview. Also the combobox editingcontrol doesn't have any 'SelectedIndex' property that can be set to -1. Any idea plz? Regards.
Jun 12 '10 #1
0 1672

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

Similar topics

2
by: Fred | last post by:
Hi, I am having a problem setting a combobox value in code on form load using comboBox.SelectedValue method. The code below when debugging show the combobox equal to an undefined value. The...
0
by: Bob | last post by:
Its often necessary to allow the user to remove a selection from a combox. In my case, most are bound to lookup tables. I suppose I could, in each lookup table create an empty record and have in...
4
by: Matt | last post by:
I have been searching all over the web for a way to sort a DataGridView based on the actual text being shown in a ComboBox column as opposed to the underlying value (an ID in this case). Can anyone...
2
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 =...
3
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...
1
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...
1
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...
0
by: priyamtheone | last post by:
I'm trying to make a datagridview column to act like a datetimepicker column (C#.Net 2005). These are the behaviours that the dgv should have: 1) Initially all the cells of the dtp column should be...
3
by: Motawee | last post by:
i am making a windows form application that contains a datagridview that is filled with employees names the program is for the attendance absence holidays of employees in the company so i...
0
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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...

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.