Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

DataGridViewComboBoxColumn not accepting input through keyboard

$
0
0

I am facing issue with providing input to DataGridViewComboBoxColumn through keyboard. If a value is selected from the drop drop list of the Combo Box Column, then it is retained and the underlying DataTable's column's value is updated. However, if I enter the Tab key, the focus moves to the next cell, and the displayed value in the combo box is not retained. If the Enter key is pressed, the cell validation procedure kicks in and says that the column can't be left blank (The column is tied to a non-null column in the database).

I have used the following code to create the column:

DataGridViewComboBoxColumn column = newDataGridViewComboBoxColumn();
column.DataPropertyName = "UoMID";
column.DataSource = unitsTable;
column.DisplayMember = "UnitName";
column.ValueMember = "ID";
column.ValueType = SqlDbType.Int.GetType();
column.Name = "UoMID";
column.HeaderText = "Measurement Unit";
column.DisplayStyleForCurrentCellOnly = true;


I have also recorded a video and posted it on YouTube to demonstrate the problem. The video named is ApplicationScreenCapture. The forum software won't allow me to post the link to the video.

I would be grateful if someone could provide me with the solution to this problem.

Thanks,

Dinesh


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>