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
720
Accessing Webdropdown Value and Text ServerSide
posted

I am using a WebDropDown with a WebDataGrid template.  I have 3 columns in the grid ("Recnum", "Name" and "Details")

When an item in the WebDataGrid is selected, the WebDropDown displays the "Name", and I 'think' I am setting the Value to "Recnum" using the following Code:

 

 

 

 

 

 

 

 

 

 

 

function rowSelChange(sender, args) {

 

 

 

   var dd = $find('<%= webDropDown1.ClientID %>');

 

 

 

   var rowid = args.getSelectedRows().getItem(0).get_cell(0).get_text();

 

 

 

   var rowName = args.getSelectedRows().getItem(0).get_cell(1).get_text();

   dd.set_currentValue(rowid,

 

true);

   dd._elements[

 

"Input"].value = rowName;

   dd._elements[

 

"Input"].focus();

   dd.closeDropDown();

}

 

 

 

function cancelDDSel(sender, args) {

   args.set_cancel(

 

true);

}

However, when I try to access the values in my code behind, the SelectedItem properties, SelectedValue, etc., are all empty or nothing:

Dim

 

 

 myRecnum As Guid = New Guid(webDropDown1.SelectedValue())

While I want the user to see the "Name", I need to use the "Recnum" value.  How do I access this?

Parents
  • 29417
    Offline posted

    Hello lorettac242 ,

     

    Thank you for posting in our forum.

    The currentValue  represents only the value that will be displayed. It’s the value in the input box of the dropdown control so changing it would not affect the  server side as explained in our online documentation:

    http://help.infragistics.com/NetAdvantage/ASPNET/2011.1/CLR4.0/?page=WebDropDown~Infragistics.Web.UI.WebDropDown~currentValue.html

     

    Since I’m not sure of what your particular scenario is and what kind of end result you’re expecting it would be very helpful if you could elaborate on that. If you have a reference free sample that you could provide it would also be very helpful so that I can better understand your scenario and help you in batter manner.

     

    Thank you for your cooperation regarding this. I’m looking forward to your reply.

     

     

    Best Regards,

    Maya Kirova

    Developer Support Engineer

    Infragistics, Inc.

    http://es.infragistics.com/support

     

Reply Children