poulate combobox from textbox

Posted by Krishnamanohar under C# on 11/6/2012 | Points: 10 | Views : 948 | Status : [Member] | Replies : 3
hi All,
I have a textbox in that user allowed to enter below 5 and i have a combobox in the datagrid and combox also values 1to 5 .
my requirement is when ever i enter 2 in textbox, combobox in datagrid should be populated with 2
Pls help me urgent
regards
Krish




Responses

Posted by: Vuyiswamb on: 11/6/2012 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
Is this a web or win app?


Thank you for posting at Dotnetfunda
[Administrator]

Krishnamanohar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Krishnamanohar on: 11/7/2012 [Member] Starter | Points: 25

Up
0
Down
In windows application

Krishnamanohar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naraayanan on: 11/7/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
try this code..

   DataGridViewComboBoxColumn column = (DataGridViewComboBoxColumn)dataGridView1.Columns["Number"];

if (textBox1.Text == "2")
{
column.Items.Clear();
column.Selected = false;
column.Items.Add("2").ToString();
dataGridView1.Rows[0].Cells["Number"].Value = "2";


}


Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/

Krishnamanohar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response