selected value of second dropdown after clicked on 1st dropdown value is refreshed on add new row in gridview in asp.net

108 views Asked by At

Hi Friends i am facing a problem in my gridview in asp.net. when add new row then dropdown value of 1st row refreshed(only those dropdown which are populated OnSelectedIndexChanged of other dropdown). can anyone please suggest how to overcome this problem.

Thanks in advance.

2

There are 2 answers

2
G.Anıl Yalçın On

Your add new row method probably posts back the page. You may need to avoid that in the method properties and add rows asynchornously.

7
senthilkumar2185 On
protected void Page_Load(object as s, EventArgs e)
{
    if (!Ispostback)<br/>
    {
    //here dropdown bind();
    dropdown.SelectedIndex=0; //Set 0 or -1
    }
}