selected row to text box

98 views Asked by At

I try to select the row from grid and show it in text box to make update and delete to the row.

I have tried this code with DataGrid. It worked, but when I use it in infragistics webdatagrid it gives me null

protected void WebDataGrid1_SelectedIndexChanged(object sender, DataGridViewCellEventArgs e)
{
   txtCode.Text = WebDataGrid1.Rows[e.RowIndex].Items[1].Value.ToString();
}

There is no error massage but data does not show in text box.

1

There are 1 answers

0
Naresh Chocha On

try this

   protected void WebDataGrid1_SelectedIndexChanged(object sender,DataGridViewCellEventArgs e)
   {
       txtCode.Text = WebDataGrid1.Rows[e.RowIndex].call[1].Value.ToString();
   }