Click here to Skip to main content
15,915,328 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a dropdownlist and textbox in the datagridview. How I assign a value into a textbox on SelectedIndexChanged of a dropdownlist? please help.
Posted

Dear Dawit,

Apply a for loop on the datagridview pn the selected index changed of the drop down and then set the text box value like this:-

for(int i=0,i<dgv.rows.count;i++)>
{
  if(e.RowIndex==i)
  {
      dgv.Rows[i]["TextBoxID"].Text=[value you want to set]
  }
}


Mark this as your answer if it helps you out.

Thanks

Varun Sareen
 
Share this answer
 
Comments
Dawit Ab 26-Dec-11 6:40am    
Thank you for your response. But I want to assign a value for a current row textbox.
Varun Sareen 27-Dec-11 1:18am    
Dear Dawit,

I think the above code will give you the current row textbox only.

Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900