Hi,
I am using WebDropDown in my application. Today i upgraded my infragistics version with new release(v 10.1.20101.1011). After this i can not set 'CurrentValue' for WebDropDown. In my older version i was using this same coding and it worked fine.
<ig:WebDropDown DisplayMode="DropDownList" DropDownAnimationType="Bounce" ID="uwlog" Height="23px" Width="65px" AutoPostBack="true" OnValueChanged="uwlog_MenuItemClicked" ToolTip="Log Info" CurrentValue="Log Info" DropDownContainerWidth="105px" EnableDropDownAsChild="false" DropDownContainerHeight="0px" DropDownContainerMaxHeight="150px" runat="server" Style="margin: 0px 0px 1px 20px; z-index: 9000;" StyleSetName="Office2007Blue">
<Items>
<ig:DropDownItem Text="Application Log" ToolTip="Application Log" >
</ig:DropDownItem>
<ig:DropDownItem Text="Error Log" ToolTip="Error Log" >
</Items>
<AutoPostBackFlags SelectionChanged="On" />
<ClientEvents />
</ig:WebDropDown>
- Here i have set CurrentValue as "Log Info" but in front it is taking the first list item as currentValue(ie;"Application Log").
Can anyone suggest a solution for me?
-Thank you.
No. The display mode is set to Dropdown. I create the controls in the code behind.
As I have already mentioned, this is related to the DisplayMode being set to DropDownList. Is your equal to DropDownList?
Thanks,
Angel
Actually, that's not what's happening. In the previous version I could, in code, set the CurrentValue to a value and when the control renders, the value would stay. In the 10.0.... version, you can't do that. You have to set the value using the PreRender function, which causes a problem. So I create my multiple dropdown controls on the fly, add a Prerender function to them on the fly, then I set values for each of them. That's a headache, but I worked it out. When I created the control, I set a generic Prerender function, then when I wanted to populate the drop down values, I set the ToolTip value to that value, and in the Prerender function set the CurrentValue to the Tooltip value then set the tooltip value to somethingl else. Thanks anyway.
protected void comboPrerender(object sender, EventArgs e)
{
//get the control
Infragistics.Web.UI.ListControls.
WebDropDown wd = sender as Infragistics.Web.UI.ListControls.WebDropDown;
if (wd.SelectedItemIndex == -1) // the value was not in the SelectedItems List.
//set the current value to the tooltip value
wd.CurrentValue = wd.ToolTip;
//set the tooltip value to blank.
wd.ToolTip =
"";
}
As i have specified in my previous post, when the DisplayMode=DropDownList, the DropDown control is behaving as the Microsoft DropDownList control, meaning that the current value must always match an item's text. You can still achieve the same functionality (not allowing free text entry) , and being able to set any current value, by just setting the DisplayMode to "DropDown" (default), and then cancelling the ValueChanging event all the time.
Hope it helps,
I have the same issue. I have the latest release 10.2.20102.1009 and the CurrentValue does not work. It's very fustrating. I did downgrade to the previous version 9 and it worked and I was going to leave it at that. But I wanted to take advantage of the Documents feature for some reporting I was working on. Please give me a work around.