views:

192

answers:

2

i want to overide value in datagridviewcell. I have Dropdownlist.when i select the dropdown item. textbox value should overide in datagridview cell. any suggestion.

//this particular code .pulls the vatrate from access database
dvgproductlist.Rows[i].Cells[11].Value = dt.Rows[i]["VATRate"].ToString(); 

thanks in advance.

A: 

From DataGridViewCell.Value property, try refreshing the cell to fit the new value by adding this loc;

dvgproductlist.Rows[i].DataGridView.AutoResizeColumn(11, DataGridViewAutoSizeColumnMode.DisplayedCells);
KMan
A: 

I think you have tofind your control and then set a value for it like

   int EditIndex = e.NewEditIndex;
   ((TextBox)grdList.Rows[grdList.EditIndex].FindControl("textBox1")).Text = "Nasser Hadjloo";
Nasser Hadjloo