Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1965
Help!!!!!webdropdown qith itemtemplate not saving on buttonclick-SelectedItem null
posted

Ok,

Here's my problem. I have been trying to get a wdd with a wdg as itemtemplate to save the selecteditem on buttonclick.We are trying to upgrade to 11.2 and so we are still on 11.1

I have a multicolumn wdg and everything works fine if i select something else (other than the current one) from wdd and click 'Save', but if i just want to 'save' the already existing selecteditem, i cant!!!!!!!!!because selecteditem is null.

 

So say i have

1 Mike       A

2 Angel     A+

3 Sam       B

 

On page load, Angel shows up. If i just hit 'save' the selecteditem is null. but if i selecte Mike/Sam it does save..why is this???

           

if (mygrid.Behaviors.Selection.SelectedRows.Count > 0)// errors out here with count returning 0 when no selection change occurs and save is clicked

            {           

foreach (GridRecord selectedRow in mygrid.Behaviors.Selection.SelectedRows)    

                {

                    selectedItemValue =Convert.ToInt32(selectedRow.Items.GetValue(0));

                }

            }

Please help!

this is urgent and using infragistics is not helping much in this case

  • 37874
    posted

    Hi dev_here,

    It has been some time since you posted, but in case you still need assistance I will be glad to help.

    The value displayed in the dropdown on page load does not indicate item selection. That means that if the user does not select an item from the dropdown, SelectedItem property will be null. If you want to have initially selected item, try setting the SelectedItem property before the page loads.

    Let me know if this helps.