<telerik:RadTabStrip ID="tsPropertyGroups" runat="server" Skin="Outlook" EnableTheming="false"
MultiPageID="mpPropertyGroups" Orientation="VerticalLeft" SelectedIndex="0"
>
<Tabs>
<telerik:RadTab Text="Settings" PageViewID="pvSettings" />
<telerik:RadTab Text="Sections" PageViewID="pvSections" />
<telerik:RadTab Text="Columns" PageViewID="pvColumns" />
</Tabs></telerik:RadTabStrip>...<telerik:RadMultiPage runat="server" ID="mpPropertyGroups" SelectedIndex="0">
| protected void RadGridHistory_ItemDataBound(object sender, GridItemEventArgs e) |
| { |
| if (e.Item is GridDataItem) |
| { |
| GridDataItem item = (GridDataItem)e.Item; |
| string key = item.KeyValues; |
| int id = ParseIdFromKeyValueString(key); |
| if (id == Convert.ToInt32(Request["id"].ToString())) |
| { |
| // change appearance. like bold text of the GridBoundColumns |
| } |
| } |
| } |
| ... |
| <add assembly="Telerik.Web.UI, Version=2009.2.826.35, Culture=neutral, PublicKeyToken=121FAE78165BA3D4"/> |
| </assemblies> |
| </compilation> |
| <add assembly="Telerik.Web.UI, Version=2009.2.826.35, Culture=neutral, PublicKeyToken=121FAE78165BA3D4"/> |

OnSelectedIndexChanged event. I have an ajaxmanager on the page. If you select an item in the first control and press tab the focus goes somewhere off the form. If you select an item in the first list and press shift-tab the focus works correctly. Or if you put a non-post back control between the two combo boxes the focus works correctly.
I don't think using the OnClientSelectedIndexChanging event is an option because the selecting values from these drop downs drive other UI options.
Any ideas?
Thanks,
Rob
Hi,
I have encountered an issue after downloading internal build of ASP.NET AJAX UI Controls version 2009.2.824, and it still exists in release version 2009.2.826.35. I have a control with two related comboBoxes both of which use webservices to get items. When the page is loaded both comboBoxes get populated as expected, but when I change selected item in the first one OnClientSelectedIndexChange gets called where I call requestItems on the other comboBox, but WebService method does not execute.
| <div class="border"></div> |
| <div style="clear:both; overflow:hidden; margin:2px"> |
| <div style="float:left; width:170px">Wybierz przedstawiciela:</div> |
| <div style="float:left; width:400px"> |
| <telerik:RadComboBox ID="_rcbBokers" runat="server" OnClientLoad="OnBrokersLoad" |
| LoadingMessage="WczytujÄ™..." NoWrap="true" Skin="Default" AllowCustomText="false" |
| OnClientSelectedIndexChanged="OnBrokerChanged" OnClientItemsRequesting="OnBrokersRequesting" |
| OnClientItemsRequested="OnBrokersRequested"> |
| <WebServiceSettings Method="GetBrokers" Path="WebServices/WarehousesService.asmx" /> |
| </telerik:RadComboBox> |
| </div> |
| </div> |
| <div class="border"></div> |
| <div style="clear:both; overflow:hidden; margin:2px"> |
| <div style="float:left; width:170px">Wybierz magazyn:</div> |
| <div style="float:left; width:400px"> |
| <telerik:RadComboBox ID="_rcbWarehouses" runat="server" OnClientItemsRequesting="OnWarehousesRequesting" |
| LoadingMessage="WczytujÄ™..." NoWrap="true" Skin="Default" AllowCustomText="false" OnClientItemsRequested="OnWarehousesRequested"> |
| <WebServiceSettings Method="GetWarehouses" Path="~/WebServices/WarehousesService.asmx" /> |
| </telerik:RadComboBox> |
| </div> |
| </div> |
here is my code behind:
| public partial class WarehousePicker : UserControl |
| { |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| if (IsPostBack) return; |
| if (Session["warehouseId"] != null) |
| { |
| ViewState["warehouseId"] = Session["warehouseId"]; |
| ViewState["brokerId"] = Session["brokerId"]; |
| } |
| else |
| { |
| ViewState["warehouseId"] = -1; |
| ViewState["brokerId"] = -1; |
| } |
| if (!Page.ClientScript.IsClientScriptBlockRegistered(typeof(WarehousePicker), "warehousPickerScript")) |
| Page.ClientScript.RegisterClientScriptBlock(typeof(WarehousePicker), "warehousePickerScript", |
| string.Format( |
| Properties.Settings.Default.WarehousePickerScript, |
| ViewState["brokerId"], _rcbWarehouses.ClientID, |
| _rcbBokers.ClientID, ViewState["warehouseId"])); |
| Session["warehouseId"] = null; |
| Session["brokerId"] = null; |
| } |
| } |
here is javascript I have in Settings.Default.WarehousePickerScript
| <script type="text/javascript"> |
| //<![CDATA[ |
| function OnBrokersLoad(combo, eventArgs) {{ |
| combo.requestItems("", false); |
| }} |
| function OnBrokersRequesting(combo, eventArgs) {{ |
| var brokerId = '{0}'; |
| var context = eventArgs.get_context(); |
| context["BrokerID"] = brokerId; |
| }} |
| function OnBrokersRequested(combo, eventArgs) {{ |
| var item = combo.findItemByValue('{0}'); |
| if (!item && combo.get_items().get_count() > 0) {{ |
| item = combo.get_items().getItem(0); |
| }} |
| if (item) {{ |
| combo.set_text(item.get_text()); |
| item.select(); |
| }} |
| var warehouseCombo = $find('{1}'); |
| warehouseCombo.requestItems(combo.get_value(), false); |
| }} |
| function OnBrokerChanged(combo, eventArgs) {{ |
| var warehousesCombo = $find('{1}'); |
| var item = eventArgs.get_item(); |
| warehousesCombo.requestItems(item.get_value(), false); |
| }} |
| function OnWarehousesRequesting(combo, eventArgs) {{ |
| var brokersCombo = $find('{2}'); |
| var warehouseId = '{3}'; |
| var context = eventArgs.get_context(); |
| context["BrokerID"] = brokersCombo.get_value(); |
| }} |
| function OnWarehousesRequested(combo, eventArgs) {{ |
| var item = combo.findItemByValue('{3}'); |
| if (!item && combo.get_items().get_count() > 0) {{ |
| item = combo.get_items().getItem(0); |
| }} |
| if (item) {{ |
| combo.set_text(item.get_text()); |
| item.select(); |
| }} |
| }} |
| //]]> |
| </script> |
and here is my WebService code:
| [WebService(Namespace = "http://tempuri.org/")] |
| [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] |
| [GenerateScriptType(typeof(BrokerItem))] |
| [GenerateScriptType(typeof(WarehouseItem))] |
| [GenerateScriptType(typeof(SelectionMode))] |
| [ToolboxItem(false)] |
| [ScriptService] |
| public class WarehousesService : WebService |
| { |
| [WebMethod(EnableSession = true)] |
| public RadComboBoxData GetBrokers(RadComboBoxContext context) |
| { |
| var userId = ((User)HttpContext.Current.Session["user"]).ID; |
| var brokerText = context["BrokerID"].ToString(); |
| int brokerId; |
| var data = new RadComboBoxData(); |
| int.TryParse(brokerText, out brokerId); |
| data.Items = (from broker in Entities.Instance.GetBrokers(userId, ActiveType.Active, ActiveType.Active, Premission.Preview | Premission.Central) |
| select new RadComboBoxItemData { Text = broker.Name, Value = broker.ID.ToString() }).ToArray(); |
| data.EndOfItems = true; |
| data.NumberOfItems = data.Items.Length; |
| var item = (from itemData in data.Items where itemData.Value == brokerText select itemData).FirstOrDefault(); |
| if (item != null) |
| { |
| data.Text = item.Text; |
| data.Value = item.Value; |
| } |
| else if (string.IsNullOrEmpty(context.Text) && data.Items.Length > 0) |
| { |
| data.Text = data.Items[0].Text; |
| data.Value = data.Items[0].Value; |
| } |
| return data; |
| } |
| [WebMethod(EnableSession = true)] |
| public RadComboBoxData GetWarehouses(RadComboBoxContext context) |
| { |
| var brokerText = context["BrokerID"].ToString(); |
| var userId = ((User)HttpContext.Current.Session["user"]).ID; |
| int brokerId; |
| int.TryParse(brokerText, out brokerId); |
| var data = new RadComboBoxData |
| { |
| EndOfItems = true, |
| Items = (from warehouse in Entities.Instance.GetUserWarehouses(brokerId, userId, ActiveType.Active, Premission.Edit) |
| where warehouse.ID != 1 |
| select |
| new RadComboBoxItemData { Text = warehouse.Name, Value = warehouse.ID.ToString() }). |
| ToArray() |
| }; |
| data.NumberOfItems = data.Items.Length; |
| return data; |
| } |
| } |
I'm using visual studio 2008, .net framework 3.5 and Telerik Controls for ASP.NET AJAX v. 2009.02.826.35, and this code was working fine with v. 2009.02.701.35
Thanks in advance
regards
Paweł Aszklar