Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Dropdownlist selectedvalue when set to another value ignored

$
0
0
I have a telerik control called a "RadComboBox". It is essentially just a ASP.DropDownList. (BTW I have changed this to a normal asp dropdownlist and I have the same result.)

There is a button onclick event that creates a new value, and then it takes the return guid from created value, and sets the selectedvalue to it.

My code looks correct, all things should be working, but as I step through the code, I noticed that the selectedvalue won't change. Example ddl.selectedvalue is (123). new.value = (abc). ddl.selectedvalue = new.value should be abc, but ddl.selectedvalue remains 123.

protected void CreateNewOrder_Click(object sender, EventArgs e)
        {
            
            Guid newOrderGuid = OE.CreateNewOrder(_consultantID, CreateNewOrderAddTextBox.Text.ToString());
            try
            {
                JJPro.Web.Page curPage = (JJPro.Web.Page)this.Page;
                curPage.CurrentOrderGuid = newOrderGuid.ToString();

            }
            catch { }
            _initOrderGUID = newOrderGuid.ToString();
            OEOrderSelectDDL_Init(OEDropDownList, true);

            try
            {

                JJPro.Web.Page curPage = (JJPro.Web.Page)this.Page;
                OEDropDownList.SelectedValue = null;
                OEDropDownList.SelectedValue = curPage.CurrentOrderGuid;

            }
            catch (Exception ex)
            {
                string x = ex.Message;

            }

         
        }


This being the line that is giving me the problem.
OEDropDownList.SelectedValue = curPage.CurrentOrderGuid;


While debugging, I see that the value will not set to
curPage.CurrentOrderGuid;
.

No errors reported back on the catch.

Had a second pair of eyes from a senior developer take a look at it earlier, and he was just as clueless as I am.

Any insight would be appreciated.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>