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:
dd.set_currentValue(rowid,
true);
dd._elements[
"Input"].value = rowName;
"Input"].focus();
dd.closeDropDown();
}
args.set_cancel(
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?
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
Hi Maya,
The sample you referenced only sets one property in the webdropdown, which is the display property.
I have a multiple column databound webdatagrid template in a webdropdown. When the use selects an item in the webdatagrid, I want to display one of the values ("Name"), which is working; and set the 'value' of the webdropdown to another ("Recnum"), which I am not sure is working correctly. The code that I am using for this was in my original post.
When the user clicks a button on the page, I need to access the value property of the webdropdown, which should be the ("Recnum"), so that I can use it as a reference for something else. It is this server-side code that is not working.
Basically, I want to take two of the values/text columns from the webdatagrid, and use them for the 'selecteditem' value and text properties in the wegdropdown, so that I can access them later in server-side code.
I hope this makes things a little clearer.