Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
77 views
Hi,

We have a LoadOnDemand ComboBox (2008.3.1114.35) with Header and ItemTemplates. When a user searches a text comprised of multiple words with space between words, spaces are encoded to %20 in text value of RadComboBoxItemsRequestedEventArgs object.  Furthermore, this generates other ItemRequested events, only this time '%' is encoded as '%25.' and continues for some time. (i.e. sample text, generates event for sample%20text, then sample%2520text, then sample%252520text etc.)

Code snippet of ComboBox is included below, .cs file is not included as it only contains comparison of text to empty string.

This occurs only sometimes, sometimes spaces are not encoded.  Are the users supposed to handle encoded chars separately or is this a bug ?

Thanks in advance,
Oner

*****************************************************************************************************************************
<telerik:RadComboBox ID="rcbCompanies" runat="server"
    Skin="Hay" Width="158" DropDownWidth="360"
    ShowToggleImage="False" AllowCustomText="True"
    DataTextField="Name" DataValueField="ID"
    EnableLoadOnDemand="True" OnItemsRequested="rcbCompanies_ItemsRequested"
>
    <HeaderTemplate>
        <table width="360px">
            <tr>
                <td align="left" style="width: 130px">
                    Company Name
                </td>
                <td align="left" style="width: 100px">
                    Category Name
                </td>
                <td align="left" style="width: 130px">
                    Parent Company Name
                </td>
            </tr>
        </table>
    </HeaderTemplate>
    <ItemTemplate>
        <table width="360px">
            <tr>
                <td align="left" style="width: 130px">
                    <%# DataBinder.Eval(Container.DataItem, "Name")%>
                </td>
                <td align="left" style="width: 100px">
                    <%# DataBinder.Eval(Container.DataItem, "CategoryName")%>
                </td>
                <td align="left" style="width: 130px">
                    <%# DataBinder.Eval(Container.DataItem, "ParentName")%>
                </td>
            </tr>
        </table>
    </ItemTemplate>
</telerik:RadComboBox>
*****************************************************************************************************************************
PPT
Top achievements
Rank 1
 answered on 26 Dec 2012
0 answers
121 views
Hi,
When i Put the RadListView inside RadGrid Binding is fine But when click the Next Page of RadListView it Showing
"Index was out of range. Must be non-negative and less than the size of the collection"
Paging is Implementd in RadListView, when go to next Page it showing the above error.......
my code is Like this
<telerik:RadListView ID="RadListViewAdBookings" runat="server"
        SkinID="WebBlue" DataKeyNames="BID" AllowPaging="true" PageSize="3"
            ItemPlaceholderID="BranchPalceHolder"
            onitemdatabound="RadListViewAdBookings_ItemDataBound"
            onneeddatasource="RadListViewAdBookings_NeedDataSource">
        <LayoutTemplate>
            <asp:PlaceHolder ID="BranchPalceHolder" runat="server"></asp:PlaceHolder>
            <div style="clear: both;">
            </div>
            <div style="background-color: #EBEBEB; height: 30px;">
                <div style="float: left; margin-left: 30%; text-align: center; margin-top: 5px;">
              <asp:LinkButton ID="btnFirst" runat="server" CommandName="Page" CommandArgument="First"
                        Text="First" Enabled="<%#Container.CurrentPageIndex > 0 %>" Font-Underline="false"
                        Style="font-family: calibri; font-size: 15px; font-weight: bold; color: #5FA3E1;
                        padding-left: 10px; padding-right: 10px;"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="btnPrev" runat="server" CommandName="Page" CommandArgument="Prev"
                        Text="Prev" Enabled="<%#Container.CurrentPageIndex > 0 %>" Font-Underline="false"
                        Style="font-family: calibri; font-size: 15px; font-weight: bold; color: #5FA3E1;
                        padding-left: 10px; padding-right: 10px;"></asp:LinkButton>
                    <span style="font-family: calibri; font-size: 15px; font-weight: bold; color: #545454;
                        padding-left: 10px; padding-right: 10px;">Page
                        <%#Container.CurrentPageIndex + 1 %>
                        of
                        <%#Container.PageCount %></span>
                    <asp:LinkButton ID="btnNext" runat="server" CommandName="Page" CommandArgument="Next"
                        Text="Next" Enabled="<%#Container.CurrentPageIndex + 1 < Container.PageCount %>"
                        Font-Underline="false" Style="font-family: calibri; font-size: 15px; font-weight: bold;
                        color: #5FA3E1; padding-left: 10px; padding-right: 10px;"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="btnLast" runat="server" CommandName="Page" CommandArgument="Last"
                        Text="Last" Enabled="<%#Container.CurrentPageIndex + 1 < Container.PageCount %>"
                        Font-Underline="false" Style="font-family: calibri; font-size: 15px; font-weight: bold;
                        color: #5FA3E1; padding-left: 10px; padding-right: 10px;"></asp:LinkButton>
                    <span style="font-family: calibri; font-size: 15px; font-weight: bold; color: #545454;
                        padding-left: 10px;">Page Size:</span>
                    <telerik:RadComboBox runat="server" ID="cmbPageSize" OnSelectedIndexChanged="cmbPageSize_SelectedIndexChanged"
                        AutoPostBack="true" Width="40px" SelectedValue="<%#Container.PageSize %>">
                        <Items>
                            <telerik:RadComboBoxItem Text="3" Value="3"></telerik:RadComboBoxItem>
                            <telerik:RadComboBoxItem Text="6" Value="6"></telerik:RadComboBoxItem>
                            <telerik:RadComboBoxItem Text="9" Value="9"></telerik:RadComboBoxItem>
                            <telerik:RadComboBoxItem Text="12" Value="12"></telerik:RadComboBoxItem>
                        </Items>
                    </telerik:RadComboBox>
                    
                </div>
            </div>
        </LayoutTemplate>
        <ItemTemplate>
            <div class="in-searches">
            <div class="in-branch-info">
                <table width="100%" cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <td>
                              <div class="branch">
                                <asp:Label ID="lblBranchID" runat="server" Visible="false" Text='<%#Eval("BID") %>'></asp:Label>
                                    <%#Eval("BranchName")%></div>
                                <div class="dis">
                                    <strong>
                                        <%#Eval("Address")%><br />
                                        Queue : 15<br />
                                    </strong><span><strong>Next available Time : 4pm</strong></span>
                                </div>
                           
                        </td>
                        
                    </tr>
                   <tr>
                        <td valign="top">
                        <div class="dis"><strong>Available Slots</strong>
                         <telerik:RadGrid ID="RadGridDates" Width="100%" runat="server"  ShowHeader="false"
                        GridLines="None" AutoGenerateColumns="false" OnNeedDataSource="RadGridDates_NeedDataSource">
                        <MasterTableView AutoGenerateColumns="false" >            
                       <Columns>
                       <telerik:GridTemplateColumn ItemStyle-CssClass="date">
                       <ItemTemplate>
                       <%#Eval("BookingDate")%>
                       </ItemTemplate>
                       </telerik:GridTemplateColumn>
                         <telerik:GridTemplateColumn ItemStyle-CssClass="count">
                       <ItemTemplate>
                       <%#Eval("Bookingcount")%>
                       </ItemTemplate>
                       </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn ItemStyle-CssClass="book">
                       <ItemTemplate>
                        1
                       </ItemTemplate>
                       </telerik:GridTemplateColumn>
                       </Columns>
                        </MasterTableView>
                        </telerik:RadGrid>
                        </td>
                         </div>
                    </tr>
                </table>
            </div>
            </div>
        </ItemTemplate>
    </telerik:RadListView>

in Code Behind

 DataTable dtList = new DataTable();
    DataSet dsList = new DataSet();
    SqlParameter [] objSqlParameter;

    VQBranchesBC objVQBranchesBC = new VQBranchesBC();
    VQBranchesInterfaceReq objVQBranchesInterfaceReq = new VQBranchesInterfaceReq();
    VQBranchesInterfaceResp objVQBranchesInterfaceResp = new VQBranchesInterfaceResp();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            
        }
    }
    protected void cmbPageSize_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        RadListViewAdBookings.PageSize = int.Parse(e.Value);
        RadListViewAdBookings.CurrentPageIndex = 0;
        RadListViewAdBookings.Rebind();
    }
    protected void RadListViewAdBookings_ItemDataBound(object sender, RadListViewItemEventArgs e)
    {
        if (e.Item is Telerik.Web.UI.RadListViewDataItem)
        {
            DataList DataListDates = (DataList)e.Item.FindControl("DataListDates");
            Label lblBranchID = (Label)e.Item.FindControl("lblBranchID");
        }
    }


    protected void RadListViewAdBookings_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
    {
        objVQBranchesInterfaceReq.Activity = "SELECT";
        objVQBranchesInterfaceReq.Status = true;
        objVQBranchesInterfaceReq.IsDelete = false;
        objVQBranchesInterfaceResp = objVQBranchesBC.VQBranchesList(objVQBranchesInterfaceReq);
        dtList = objVQBranchesInterfaceResp.Records;
        RadListViewAdBookings.DataSource = dtList;
    }
  protected void RadGridDates_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {

        var grid = sender as RadGrid;
        var lvItem = grid.NamingContainer as RadListViewDataItem;
        var data = Convert.ToInt32(lvItem.GetDataKeyValue("BID"));
        objSqlParameter = new SqlParameter[3];
        string strDate = GlobalFunctions.GetCountryDateTime().ToString("MM/dd/yyyy");
        objSqlParameter[0] = new SqlParameter("@Today", strDate);
        objSqlParameter[1] = new SqlParameter("@intFlag", "-10");
        objSqlParameter[2] = new SqlParameter("@BranchID", data);
        dsList = VQ.VQDBFunctions.ExecuteDataSetWithParams(CommandType.StoredProcedure, "SP_VQ_GetAdvanced_BookingInfo_Slots", objSqlParameter);
        grid.DataSource = dsList;
        RadListViewAdBookings.AllowPaging = true;
       
    }


Vempalli
Top achievements
Rank 1
 asked on 26 Dec 2012
6 answers
312 views
Hello,

We are getting an intermitent java script error in our SharePoint custom ASP.NET page. (FYI, the telerik controls are showed into page via web parts which intern calls .NET user control)

Java script error details:

Message: 'type' is null or not an object
Line: 6
Char: 33796
Code: 0
URI: http://mycompany.com/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3ad0c4ca6e-6b5d-49b6-922d-5244924fb100%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2012.1.411.35%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a4cad056e-160b-4b85-8751-cc8693e9bcd0%3a16e4e7cd%3aed16cbdc%3a86526ba7%3af7645509%3a2003d0b8%3a24ee1bba%3ae330518b%3a1e771326%3ac8618e41%3af46195d3%3aaa288e2d

We make use of lastest Telerik.Web.UI and Telerik.Web.UI.Skins dlls version 2012.1.411.35.

Below are the list of web.config changes made for Telerik usage,
1) SafeControl
 
<SafeControl Assembly="Telerik.Web.UI, Version=2012.1.411.35, 
Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" 
TypeName="*" Safe="True" SafeAgainstScript="False" />

2) Page tag prefix
<add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI, 
Version=2012.1.411.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4
/>

3) web.server handlers
<add name="Telerik.Web.UI.WebResource" path="Telerik.Web.UI.WebResource.axd" 
verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, 
Version=2012.1.411.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4
/>

The page works fine most of the time; but at times it throws above specified java script error and dont work anymore until another page refresh.

I couldn't even debug this error as this is very unstable error.  
May I know what may be the issue?

Your reply is much appreciated.

Thanks,
~Yuva
Felipe
Top achievements
Rank 1
 answered on 26 Dec 2012
3 answers
192 views
Hi,

I need to implement the recursive selection at this way:
1. Select all parents when the at least one child item was selected.
2. Select all childs when the parent was selected.

When i use "AllowRecursiveSelection=true" the 1st part of the task does not work for me (when deselect one of the child - parent deselects too). If AllowRecursiveSelection is true then "OnItemSelected" and "OnItemDeselected" client events does not fire...
In other way at client side "get_childItems()" return null for the node not expanded before select and "ExpandCollapse" command fires after "OnItemSelected" and "OnItemDeselected"...

I have no idea how to implement this task. Can anybody show the right way to complete this?

Thx.
Priya
Top achievements
Rank 1
 answered on 25 Dec 2012
2 answers
90 views
Greetings,

I have a problem with recursive selection. Treelist selects recursively whole branch of selected node (all its ancestors and descendants). This behavior is pretty "unconfortable" for me. If my nodes are folders and files and I select a subfolder and I want to delete it with it contents for example then I cerainly don't want to delete its parent folder (or any of its ancestors) so I would like to ask if there is any way how to make treelist to recursively select only descendant nodes of selected item.

Thanks in advance
Miro 
Priya
Top achievements
Rank 1
 answered on 25 Dec 2012
3 answers
153 views
I have the following JavaScript code that creates a really simple JSON object...

var data = {'MyID':1,'MyItem':'This is the first item'};
var JSONdata = JSON.stringify(data);
$find('<%= RadAjaxManager1.ClientID %>').ajaxRequest(JSONdata);

This generates the following JSON string after running the object through the stringify method...

{"MyID":1,"MyItem":"This is the first item"}

This is valid JSON according to JSONLint.com.

Calling the .ajaxRequest() method results in Sys.WebForms.PageRequestManagerServerErrorException - "Specified cast is not valid"

It's not even getting to my RadAjaxManager1_AjaxRequest() event handler where I have a breakpoint set to inspect the value of e.argument.

What's wrong here?

I'm using version 2010.3.1317.35 of the Telerik controls.

Rob  
Pavlina
Telerik team
 answered on 25 Dec 2012
5 answers
177 views
I have an usercontrol that has a RadTabStrip control. This usercontrol is loaded in SharePoint 2007. The problem is that the Tabclick event is working for IE, Chrome, and Firefox but not for Safari.

I have a Breakpoint in the RadTabStrip1_TabClick event and I found out that code never is running.

I need your help!!
Safari 5.1.7
SharePotin 2007
Telerik 3.5


************Usercontrol*********

<%@ Register Assembly="Telerik.Web.UI, Version=2010.3.1109.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
    Namespace="Telerik.Web.UI" TagPrefix="telerik" %>


<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" 
   Assembly="Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral, 
   PublicKeyToken=71e9bce111e9429c" %>
<SharePoint:CssRegistration name="Ajax.Settings.css" runat="server"/>      
  
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
         <telerik:RadTabStrip runat="server" ID="RadTabStrip1" OnTabClick="RadTabStrip1_TabClick" AutoPostBack="True" CausesValidation="false">
            <Tabs>
                <telerik:RadTab runat="server" Text="Root RadTab1">
                    <Tabs>
                        <telerik:RadTab runat="server" Text="Child RadTab 1">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Child RadTab 2">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Child RadTab 3">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Child RadTab 4">
                        </telerik:RadTab>
                    </Tabs>
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Root RadTab2">
                    <Tabs>
                        <telerik:RadTab runat="server" Text="Child RadTab 1">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Child RadTab 2">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Child RadTab 3">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Child RadTab 4">
                        </telerik:RadTab>
                    </Tabs>
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Root RadTab3">
                    <Tabs>
                        <telerik:RadTab runat="server" Text="Child RadTab 1">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Child RadTab 2">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Child RadTab 3">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Child RadTab 4">
                        </telerik:RadTab>
                    </Tabs>
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>

*******C# Code*******

  protected void Page_Load(object sender, System.EventArgs e)
        {
     
        }
        protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
        {
            Label1.Text="TabClick: " + e.Tab.Text;
        }
        protected void Page_PreRender(object sender, EventArgs e)
        {
            EnsureUpdatePanelFixups();
        }
        private void EnsureUpdatePanelFixups()
        {
            RadScriptManager.RegisterStartupScript(this, GetType(), "UpdatePanelFixup", "_spOriginalFormAction = document.forms[0].action; _spSuppressFormOnSubmitWrapper=true;", true);
        }     



Kalina
Telerik team
 answered on 25 Dec 2012
1 answer
165 views

Hello,

I am new at Telerik RadGrid in Ajax/ASP .NET.

I am trying to allow the user of my application to be able to re order the columns of my RadGrid. I found on your website that :

GridDragDropColumn  has to be inserted in the Columns collection of a GridTableView, But as my RadGrid columns are autogenerated, I have no <Column> tag in the description of my RadGrid. So I am trying to understand where should the GridDragDropColumn  tag be inserted to allow Columns drag and drop (and re-ordering).
I tried to insert it in the <Columns> description of my MasterTableView (see the code below) but when running it, I cannot drag any of my columns ?

Another point is that I want that my columns can also be sorted by one click on the header of the column. Is that compatible with the GridDragDropColumn  option ?

Thank your for your help.

Here is the code of my grid in my ASPX file :

<telerik:RadGrid ID="GridView1" runat="server"
        ActiveItemStyle-BorderStyle="Solid" AllowSorting="True"
        AllowMultiRowSelection="True" AllowFilteringByColumn="True"  
        TableLayout="Fixed" ValidationSettings-EnableValidation="False"
        ScrollHeight="200px"  Height="700px"  Width = "98%" table-layout="auto">
    <MasterTableView  TableLayout="auto">
   <Columns>
    <telerik:GridDragDropColumn HeaderStyle-Width="18px" />
                        
      </Columns>
 
       <NestedViewTemplate>
           <asp:Panel runat="server" ID="configControlContainer" CssClass="viewWrap" Visible="true" BackColor="PaleGoldenrod">
            <table>
           <tr>
           <td><telerik:RadTextBox ID="RadTextbox1" runat="server">
           </telerik:RadTextBox>
            </td>
             </tr>
             <tr>
           <td><telerik:RadButton ID="RadButton1" Text="Confirm" runat="server"
                                                      OnClick="btn_Click">
            </telerik:RadButton>
 
            
             </td>
              </tr>
              </table>
            </asp:Panel>
            </NestedViewTemplate>
 
              <DetailTables>
                        
             </DetailTables>
          </MasterTableView>
           <ClientSettings  AllowRowsDragDrop="true">
              <Selecting AllowRowSelect="True" EnableDragToSelectRows="false" />
              <Scrolling AllowScroll="True" ScrollHeight="475px" UseStaticHeaders="true" FrozenColumnsCount="1" SaveScrollPosition="True" />
            </ClientSettings>
              
          </telerik:RadGrid>

Eyup
Telerik team
 answered on 25 Dec 2012
2 answers
302 views
am using telerik tab strip control in page2.aspx...am calling this page frompage1.aspx.... from there itself i want to mention the tab which i want to see first.in page1.aspx i have equal no of menu for each tab. for ex, if i click on 3rd menu then it shd redirect to page2.aspx and it shd focus on 3rd tab....



Kalina
Telerik team
 answered on 25 Dec 2012
2 answers
79 views

Hi,

How can I change the background image of RibbonBar?

Thanks in advance

Ivan Zhekov
Telerik team
 answered on 25 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?