Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
121 views

Load on demand does not populate drop down list with list items when using IE8.  It works properly in FF and it has worked in previous versions of IE.  I’ve downloaded the latest builds with the same results.

Is there a fix for this?

<!---- RAD CARRIER COMBOBOX ----->
<telerik:RadComboBox ID="radCarrierID" runat="server"  EmptyMessage='<%# GetResourceValue("Txt:PleaseSelect", "VFB")%>' ShowToggleImage="True" ShowMoreResultsBox="true"
        EnableLoadOnDemand="True" OnItemDataBound="radCarrier_ItemDataBound"
        DropDownWidth="423px" Width="260px" OnClientFocus="ClearCarrierOnFocus" OnClientBlur="OnCarrierBlur" OnClientSelectedIndexChanged="HandleEndChangingCarrier" Skin="Outlook" OnItemsRequested="radCarrierID_ItemsRequested" EnableVirtualScrolling="true">
        <HeaderTemplate>
            <table style="text-align: left">
                <tr>
                    <td style="width: 225px;">
                        Carrier
                    </td>
                    <td style="width: 125px;">
                        City
                    </td>
                    <td style="width: 25px;">
                        St
                    </td>
                </tr>
            </table>
        </HeaderTemplate>
        <ItemTemplate>
            <table style="text-align: left">
                <tr>
                    <td style="width: 225px;">
                        <%# DataBinder.Eval(Container.DataItem, "Name") %>
                    </td>
                    <td style="width: 125px;">
                        <%# DataBinder.Eval(Container.DataItem, "City") %>
                    </td>
                    <td style="width: 25px;">
                        <%# DataBinder.Eval(Container.DataItem, "St") %>
                    </td>
                </tr>
            </table>
        </ItemTemplate>                   
</telerik:RadComboBox>

      protected void radCarrierID_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
      {
        try
        {
          // create in memory datatable
          DataTable tblName = new DataTable();
          tblName.Columns.Add("NameID");
          tblName.Columns.Add("Name");
          tblName.Columns.Add("City");
          tblName.Columns.Add("St");
          e.Message = "No Matches";

          if (e.Text != "")
          {
            WhereClause wc = new WhereClause();
            OrderBy orderBy = new OrderBy(false, true);
            orderBy.Add(CarrierTable.Carrier_Lookup_Name, OrderByItem.OrderDir.Asc);
            string strFilter = "Carrier_Lookup_Name like '" + e.Text.Replace("'", "''") + "%'";
            SqlFilter objFilter = new SqlFilter(strFilter);
            wc.AddFilter(objFilter, CompoundFilter.CompoundingOperators.And_Operator);
            int intTotalCount = CarrierTable.GetRecordCount(wc);
            int itemOffset = e.NumberOfItems;
            int intPage = itemOffset / ItemsPerRequest;
            int endOffset = Math.Min(itemOffset + ItemsPerRequest, intTotalCount);
            e.EndOfItems = endOffset == intTotalCount;
            if (itemOffset <= intTotalCount)
            {
              foreach (CarrierRecord itemValue in CarrierTable.GetRecords(wc, orderBy, intPage, ItemsPerRequest))
              {
                tblName.Rows.Add(new string[] { itemValue.Carrier_ID.ToString(), itemValue.Carrier_Lookup_Name.ToString(), itemValue.Carrier_CitySpecified ? itemValue.Carrier_City.ToString() : "", itemValue.Carrier_StateSpecified ? CarrierTable.Carrier_State.Format(itemValue.Carrier_State.ToString()) : "" });
              }
            }
            e.Message = String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset, intTotalCount);
          }
          // radShipperID.DataTextField = "Name;City;St";
          radCarrierID.DataValueField = "NameID";
          radCarrierID.DataSource = tblName;
          radCarrierID.DataBind();
        }
        catch (Exception ex)
        { e.Message = "Error: " + ex.Message; }
      }

Phil

Simon
Telerik team
 answered on 16 Jul 2010
2 answers
154 views
I have a radwindow on a Masterpage that I reference from the Web User Control pages of Web Forms that use the Masterpage (Masterpage -> WebForm.aspx -> WebUserControl.ascx + Codebehind.cs). On the page I have a context menu that is triggered by right-clicking on a div. One of the options of the context menu sets the navigateurl of the radwindow then makes it visible. The first time I make the radwindow appear everything is perfect (see attached: window works.png), however after closing the radwindow and doing an ajax postback on the page if I open the radwindow again, its look is totally broken (see attached: broken window.png). I have put in some code blocks that will hopefully help a bit. If there are any questions please ask!

This is the web control:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ContentMenu.ascx.cs" Inherits="CMSControls_ContentMenu" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy" runat="server">
  <AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="RadContextMenuMenu">
      <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="RadContextMenuMenu" />
        <telerik:AjaxUpdatedControl ControlID="RadWindowMaster" />
        <telerik:AjaxUpdatedControl ControlID="LabelDebug" />
        <telerik:AjaxUpdatedControl ControlID="divMenu" LoadingPanelID="radAjaxLoadingPanel" />
      </UpdatedControls>
    </telerik:AjaxSetting>
  </AjaxSettings>
</telerik:RadAjaxManagerProxy>
<asp:PlaceHolder ID="PlaceHolderAdmin" runat="server" />
<div id="divMenu">
  <asp:Literal ID="LiteralEmptyMenu" runat="server" />
  <asp:PlaceHolder ID="PlaceHolderRadMenuCMS" runat="server" />
</div>
<asp:Label ID="LabelDebug" runat="server" Text=""  />
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
  <script type="text/javascript">
      <asp:Literal ID="LiteralOnClientClose" runat="server" />
  </script>
 
</telerik:RadCodeBlock>

web control code behind, contextmenu item click function.
protected void RadContextMenuMenu_ItemClick(object sender, Telerik.Web.UI.RadMenuEventArgs e)
{
    if (IsAdmin)
    {
        LabelDebug.Text += "RadContextMenuCMS_ItemClick " + e.Item.Text + "<br>";
        MasterPage myMaster = Page.Master;
        RadContextMenu RadContextMenuMenu =  (RadContextMenu)Shuware.ShuwareCommon.Web.FindControlByID(PlaceHolderAdmin.Controls, "RadContextMenuMenu");
        RadWindow RadWindowMaster = (RadWindow)myMaster.FindControl("RadWindowMaster"); //Create a new RadWindow object and assign it the ID of the RadWindow hidden on the page
 
        switch (e.Item.Text)
        {
            case "Edit":
                RadWindowMaster.NavigateUrl = "~/contentmenueditor.aspx?id=" + Server.UrlEncode(MenuID.ToString());
                RadWindowMaster.OnClientClose = "OnClientclose" + "_" + this.ID;
                RadWindowMaster.AutoSize = false;
                RadWindowMaster.Visible = true;
                RadWindowMaster.Height = Unit.Pixel(555);
                RadWindowMaster.Width = Unit.Pixel(485);
                RadContextMenuMenu.Items[1].Visible = true;
                RadContextMenuMenu.Items[2].Visible = true;
                break;
            case "Save":
                RadContextMenuMenu.Items[1].Visible = false;
                RadContextMenuMenu.Items[2].Visible = false;
                RadWindowMaster.Visible = false;
                Response.Redirect(Shuware.ShuwareCommon.Web.GetCurrentURL()); //redirect back to the same page
                break;
            case "Cancel":
                RadContextMenuMenu.Items[1].Visible = false;
                RadContextMenuMenu.Items[2].Visible = false;
                RadWindowMaster.Visible = false;
                break;
            case "Admin":
                RadContextMenuMenu.Items[1].Visible = false;
                RadContextMenuMenu.Items[2].Visible = false;
                RadWindowMaster.OnClientClose = "OnClientclose" + "_" + this.ID;
                RadWindowMaster.NavigateUrl = "~/admin.aspx";
                RadWindowMaster.Visible = true; //show the admin window
                break;
            default:
                RadContextMenuMenu.Items[1].Visible = false;
                RadContextMenuMenu.Items[2].Visible = false;
                RadWindowMaster.Visible = false;
                break;
        }
    }
}

This sets the onclientclose function for the radwindow.
string strScript = "function OnClientclose" + "_" + this.ID + "(sender, eventArgs)\n{\n var arg = eventArgs.get_argument();\nif(arg) {\n__doPostBack('ctl00$" + RadContextMenuMenu.ClientID.Replace("_", "$") + "', arg);\n}\n}";
LiteralOnClientClose.Text += strScript;
 
/*This becomes the below code at runtime:
function OnClientclose_ContentMenu1(sender, eventArgs)
{
 var arg = eventArgs.get_argument();
 if(arg) {
  __doPostBack('ctl00$ctl00$ContentPlaceHolder1$ContentMenu1$RadContextMenuMenu', arg);
 }
}
*/
Dan Miller
Top achievements
Rank 1
 answered on 16 Jul 2010
1 answer
149 views

I want to dynamically add RadPages and Radtab on the clientside. I dont know if this is possible because there isn't much documentation on this subject.

This is what i got so far:

var multipage = $find('multipage');
var page = new Telerik.Web.UI.RadPageView();
var tab = new Telerik.Web.UI.RadTab();
tab.set_text("New Tab");
 
multipage.get_pageViews().add(page);
$find('tabstrip').get_tabs().add(tab);

I got a new tab on my tabstrip and in the html i see a empty div element for my multipage.

When i click the tab, it doesn't open the page. Am i missing something here?


Simon
Telerik team
 answered on 16 Jul 2010
9 answers
1.3K+ views

I have a problem with the RadComboBox that I was hoping someone would have a fix for.  The problem is that if an item’s text contains more than one space between the words, the spaces are removed.  For example, if the text of an item is “Select              Frequency”, then it shows up as “Select Frequency”.  For our application we need to preserve the amount of white space in the text. 

I have read on another post where it says to use &nbsp instead of a space, but the values in the list are all from user entered values in the database.  I have been able to replace the spaces in the ItemDataBound event of the RadComboBox like this:

        protected void RadComboBox1_ItemDataBound(object sender, RadComboBoxItemEventArgs e)

        {

            e.Item.Text = Page.Server.HtmlDecode(((DataRowView)e.Item.DataItem)[ColumnName].ToString().Replace(" ","&nbsp;"));

        }

 

But this seems a little overly complicated to fix a problem like this.  Any Suggestions.

Simon
Telerik team
 answered on 16 Jul 2010
1 answer
127 views
I have the follwing code
function openConfirmBox()  
  {  
      radconfirm('Did you save an Excel Spreadsheet?', confirmCallBackFn, 330, 100, null,'Confirm');              
  }  
    
function confirmCallBackFn(arg)  
  {  
  alert(arg); 
  if (arg == true);
  {
          document.getElementById('<%= UpdateFailed.ClientID %>').click(); 
  }
   GetRadWindow().Close();   
 }  
but for some reason requardless if arg is true or false it always runs the click event.

What is wrong.
Eric Klein
Top achievements
Rank 1
 answered on 16 Jul 2010
1 answer
152 views
I have a RadComboBox that inside a RadRotatorItem that when I change the selected item through server side code, it does not reflect on the page.  On page load, I try changing the selected item using RadComboItem.SelectedIndex = 3 or RadComboItem.Items[3].Selected = true; but neither work.  Here is my code:

ASPX:
<telerik:RadComboBox ID="cmbReminder_1" MarkFirstMatch="True" runat="server" Height="190px"
                                                    Width="100px" Skin="Default" AutoPostBack="False" HighlightTemplatedItems="True"
                                                    ShowToggleImage="True" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged1">
                                                    <ItemTemplate>
                                                        <table style="border-bottom: 1px dotted #EFEFEF; margin-bottom: 10px; font-size: 11px;"
                                                            width="60px">
                                                            <tr>
                                                                <td>
                                                                    <img src='/Images/<%# DataBinder.Eval(Container, "Attributes['ImagePath']") %>' alt="" />
                                                                </td>
                                                                <td>
                                                                    <%# DataBinder.Eval(Container, "Attributes['DisplayName']") %>
                                                                </td>
                                                            </tr>
                                                        </table>
                                                    </ItemTemplate>
                                                    <Items>
                                                        <telerik:RadComboBoxItem ImagePath="EmailIcon_32x32p.png" DisplayName="Email" Text="Email" Value="1">
                                                        </telerik:RadComboBoxItem>
                                                        <telerik:RadComboBoxItem ImagePath="TextIcon_32x32p.png" DisplayName="SMS" Text="SMS" Value="2">
                                                        </telerik:RadComboBoxItem>
                                                        <telerik:RadComboBoxItem ImagePath="PhoneIcon_32x32p.png" DisplayName="Phone" Value="3"
                                                            Text="Phone"></telerik:RadComboBoxItem>
                                                         
                                                    </Items>
                                                </telerik:RadComboBox>

Code behind:
RadRotatorItem step3Item = (RadRotatorItem)this.RadRotatorHorizontal.Controls[2];
RadComboBox cmbTiming_2 = (RadComboBox)step3Item.FindControl("cmbTiming_2");

I am getting the correct control because when I step through the code, I examine the cmbTiming_2 and it contains the correct items.
Any help is appreciated
Helen
Telerik team
 answered on 16 Jul 2010
1 answer
118 views
I have an error retrieving the selected radcombobox item (clientside). Why doen't work? I receive error "Error: Object doesn't support this property or method"

http://www.telerik.com/help/aspnet-ajax/combo_clientsideradcombobox.html

This is my test page:

<script type="text/javascript">
        function getValue() {
            var combo = <%=RadComboBox1.ClientID %>; 
  
            alert('1');
              
            var sel = combo.get_selectedItem();
              
        }  
    </script>
    <telerik:RadComboBox ID="RadComboBox1" runat="server">
        <Items>
            <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" Value="RadComboBoxItem1" />
            <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2" Value="RadComboBoxItem2" />
            <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem3" Value="RadComboBoxItem3" />
        </Items>
    </telerik:RadComboBox>
    <input id="Button1" type="button" value="button" onclick="getValue()" />
Kalina
Telerik team
 answered on 16 Jul 2010
3 answers
125 views
Hi All:

I have another post, per setting focus on a combo-box:
http://www.telerik.com/community/forums/aspnet-ajax/combobox/client-side-focus-on-radcombobox.aspx
Either solution works in IE8 under Visual Studio, but once deployed to my development website, then it stops working.
My users need IE, because of SQL Server Reporting Services printing features only available with IE. 
So what is happening with IE8?

Phil
Simon
Telerik team
 answered on 16 Jul 2010
1 answer
112 views
I have an image with alt and title properties which cause a tooltip to appear when hovered. When the user right-clicks on the image, the context menu appears (I manually make the context menu appear via JavaScript), but the tooltip doesn't dissapear until the user moves over the menu items. Is this a z-order issue? Do I need to change the z-order of the context menu to appear above the tooltips? I am not talking about the Telerik tooltips and I would rather not use them. I would like to continue to use the browser-provided tooltips.
Helen
Telerik team
 answered on 16 Jul 2010
10 answers
189 views
Are there any know problems with the lasted version of Telerik and IE6. We are getting a 2-3 calls per day from users that say they enter all numbers in a masked phone field and it still says it is invalid. No matter what they do, it will not accept the input. We had one say they saw the page had an error (the bottom of the screen). We do not have IE6 in our office, but due to the number of calls, that seems to be the common thread. We cannot recreate on IE8.

Any suggestions???

Thanks,
Susan
Matthew Timbs
Top achievements
Rank 1
 answered on 16 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?