Question: I was wondering if it is possible to repopulate a dynamic `dropdown`(specifically the `option` of a `select`) after form validation fails which is generated by another `dropdown` at `on change event`.

My jQuery is working good on populating dynamic `option` of a `select` as well as at `server-side` when fetching the data, my only problem is when the form is submitted and validation fails, so basically the dynamic `select` `option/s` will reset.

Can somebody help me with this issue?

Answer: 
below ur class

make public int id;

//adding button

```
 DataGridViewButtonColumn col = new DataGridViewButtonColumn();
    col.UseColumnTextForButtonValue = True;
    col.Text = "ADD";
    col.Name = "Btn_add";
    DataGridView1.Columns.Add(col);

```

//pass id values here to do functions..

```
private void Btn_add_Click(object sender, EventArgs e)
    {

   }

```

//this gets selected index of selected row value

private void DataGridView1\_SelectionChanged(object sender, EventArgs e)
 {

```
     int id =  DataGridView1.SelectedRows(0).Cells(0).Value;

```

}
In Datagrid please bind OfferId in buy button. When press button then automatically gives id onclick event.