I have a webcombo on my Asp.net page which is bound to a data table.
Then when I try to set the selected index of the webcombo I get an “Object reference not set to an instance of an object.” error.
I double checked that the value is present in the data table.
The thing is that it does not throw the error when the AutoGenerateColumns attribute is set to true. As soon as the AutoGenerateColumns is set to false I receive this error.
Thanks
That was it. Thanks Peter.
make sure you set the seletedindex in the webcombo's databound event not in the page load.you have to wait for data to be present in the combo before you can search and set the index.