Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
106 views
I want to get the row count after the  NeedDataSource event (after rebind client side).
How can I do this from client side.
Please help
Shinu
Top achievements
Rank 2
 answered on 07 Feb 2013
5 answers
184 views
Hi there,

I'm  using radEditor and found annoying error that must be solved.
What happened was the user wanted to paste HTML content from google finance to radEditor.
And it triggered javascript error, object not found in Internet Explorer 8.
For more details, I enclosed the google finance content at the end of this page.

After tiring and restless debugging, much testing, I still couldn't suppress the javascript error.
I use the onerror syntax to capture all javascript error, but it doesn't work.
window.onerror = function () {
    alert("Error captured");
}

Finally, I found the culprit. The image tag has javascript onload event. Thus I use the following crude code to replace the onload event.
This works for future use, but it sill doesn't solve the issue when the user pasted the content.
function OnClientPasteHtml(sender, args) {
    alert("OnPaste");
    var value = args.get_value();
    alert(value);
    value = value.replace(/ on/g, " _on");
    args.set_value(value);
}

In fact, I tried to paste the google finance content, I received the same javsacript error in this page.
I tried to use OnClientCommandExecuting radEditor client event, hoping I can modiy the clipboard content before it's being paste into radEditor. But the args.get_value() returns empty.

My questions,
1. How to suppress all javascript error in radEditor?
2. How to modify the clipboard content before it's being paste to radEditor. OnClientPasteHtml is too late.

Thank you.




http://www.google.com/finance

Huffington Deal Raises Question: What Site Will Be Sold Next?
By EVELYN M. RUSLI In agreeing to buy The Huffington Post for $315 million, AOL is putting what appears to be a significant premium on the ability to attract and build a community of readers.
Can the Huffington Post save AOL?  
Newspaper stocks jump on content hopes  
Market Chart
12,161.63 +69.48 (0.57%)
1,319.05 +8.18 (0.62%)
2,783.99 +14.69 (0.53%)
Rumen
Telerik team
 answered on 07 Feb 2013
1 answer
123 views
The modal is not resizing.  Please refer to the PNG file.
Here is my code:
<telerik:RadWindow ID="RadWindow2" runat="server"
                                                                        Modal="True" Behaviors="Move, Reload" Title="     Recurrence"
                                                                        AutoSize="True" ForeColor="White"
                                                                        AutoSizeBehaviors="Width, Height, Default" ReloadOnShow="True">
                                                                    <ContentTemplate>
                                                                        <p align="left">
                                                                                <asp:RadioButtonList ID="RadioButtonList1" runat="server">
                                                                                    <asp:ListItem Value="ThisWeekOnly" Selected="True">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Selected Week</asp:ListItem>
                                                                                    <asp:ListItem Value="Forever" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Forever</asp:ListItem>
                                                                                    <asp:ListItem Value="Forever" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Vocation !!!</asp:ListItem>
                                                                                    <asp:ListItem Value="Forever" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;More Vocation !!!!</asp:ListItem>
                                                                                    <asp:ListItem Value="Forever" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Even More Vocation !!!!!</asp:ListItem>
                                                                                </asp:RadioButtonList>
                                                                        </p>
                                                                        <p>                                                                                       
                                                                            <asp:Button ID="btnSubmit" runat="server" Text="Submit"
                                                                                ForeColor="White"
                                                                                BackColor="#CC0000" BorderStyle="Outset"
                                                                                Font-Bold="True"
                                                                                UseSubmitBehavior="False" EnableTheming="True" OnClick="btnSubmit_Click"/>
                                                                               
                                                                            <asp:Button ID="Cancelbtn" runat="server" BackColor="#CC0000"
                                                                                            BorderStyle="Outset" Font-Bold="True" ForeColor="White" Text="Cancel"
                                                                                            UseSubmitBehavior="False" />
                                                                        </p>
                                                                    </ContentTemplate>
                                                                    </telerik:RadWindow>

 

Princy
Top achievements
Rank 2
 answered on 07 Feb 2013
1 answer
62 views
Hi, 
I've tried to bind a radgrid using jquery. On the first databind of the grid the desired rows have been shown without problems, from the second databind the grid has correcly set the datasource but it always displays "No records to display" message.
Debuggin the code I've found this function:
get_dataItems:function(){if(this._dataItems.length>0||(this._cachedItems&&this._cachedItems.length>0)){return this._dataItems; ....

The function is not correct because returns always the dataitems and It not considers the cachedItems. In my case the dataItmes is always empty from the second databind on the other hand the cachedItems is set.

this is my code to bind the grid:

function bindGridView(result) {
            var masterTable = $find("<%= Grid.ClientID %>").get_masterTableView();
            masterTable.set_dataSource(result.Dia);
            try {
                masterTable.dataBind();
            }
            catch (e) {
                alert(e);
            }
        }

There is a workaround to fix this behaviour?

Thanks,

Maurizio
Radoslav
Telerik team
 answered on 07 Feb 2013
1 answer
49 views
Hi,
Radwindow works fine in firefox and chrome but doesnot render properly in IE 9(doesnot display border, titlebar and behaviour buttons).
SKin is set at application level in webconfig file and  mark up for radwindow and radwindow manager is as below:
//ASPX

 

<telerik:RadWindowManager ID="RadWindowManager14" runat="server" EnableShadow="true"

 

VisibleStatusbar="false" Behaviors="Close, Move, Resize" DestroyOnClose="false"

 

ShowContentDuringLoad="false" IconUrl="img/preview_16x16.png" >

 

<Windows>

 

<telerik:RadWindow ID="APage" runat="server" Title="M4 Workforce" OnClientPageLoad="SetRadwindowHeightAndWidth" Left="200px" Top="25px" ReloadOnShow="true"

ShowContentDuringLoad="false" Modal="false" IconUrl="img/preview_16x16.png" Behaviors="Maximize, Minimize,Move, Close"

 

KeepInScreenBounds="true" OpenerElementID="ABtn" NavigateUrl="ggPages.aspx" >

 

</telerik:RadWindow>




//WebConfig

<

add key="Telerik.EnableEmbeddedSkins" value="true" />

<

 

 

add key="Telerik.Skin" value="Outlook" />

<

 

 

add key="Telerik.Window.Skin" value="WebBlue" />



Thanks in advance,
Prava
Princy
Top achievements
Rank 2
 answered on 07 Feb 2013
1 answer
59 views
just above the scrollbar is a white space as see in the attached. I think it would be a skin problem but I have no idea what to do.
Shinu
Top achievements
Rank 2
 answered on 07 Feb 2013
1 answer
150 views
I'm trying to use custom images for the left/right buttons on my implementation of the RadRotator. The problem I'm running into is that when I add the images they appear above and below the rotator instead of to the left and right like the default images do. Does anyone have any ideas as to how I can use custom image while still using custom api calls to make sure scrolling is limited to just one item at a time?

Thanks,

Jaime
Princy
Top achievements
Rank 2
 answered on 07 Feb 2013
1 answer
906 views
Hi
I am using asynupload control where I have given the max file size as 100000 how can increase this to 10 mb?
what are the configuration changes I need to do?
Princy
Top achievements
Rank 2
 answered on 07 Feb 2013
1 answer
45 views
Hi,

I'd though RadWindow was what I wanted, but I can't have a table element as a child.

I'd like some window that the client can minimize and maximize, resize and move around that I can simple put a Web Service response in an XML format.

I'm very new to Telerik Rad controls, and am very confused on where I would find documentation on the Rad Controls with simple examples of there use and a full list of each attribute.

Thanks for the pointers!
Princy
Top achievements
Rank 2
 answered on 07 Feb 2013
4 answers
552 views

Folks,

Using VS 2010 with RadControls for ASP.NET AJAX Q3 2012 SP2. Using this below link as a Prototype (the 1st example: Grid-like multi-column):

http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multicolumncombo/defaultcs.aspx

My question is: How to hide an item alongwith it's other attribute columns from that Multi Column RadCombo Box and Put that item along with its attributes always on top of the list. Example: I would like the Item with Customer id BONAP will always be the 1st Item (i.e. apprear before Customer Id: ALFKI). Attached is my desired result.

In the past I was able to hide and insert the item on the Top with Single Column in Item Databound event with below code.


protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
   {
       if (e.Item is GridEditableItem && e.Item.IsInEditMode && e.Item.OwnerTableView.Name == "MainClientAddress")
       {
           string defaultstate = "New York";
 
           GridEditableItem itm = e.Item as GridEditableItem;
 
           RadComboBox rb = (RadComboBox)itm.FindControl("RadComboBoxState");
 
           RadComboBoxItem citem = rb.Items.FindItemByText(defaultstate);
 
           rb.Items.Remove(citem);
 
           rb.Items.Insert(0, citem);
       }
   }

 
But here I am dealing with Multi- Column Rad ComboBox. Below is my complete declaration, Any help will be appreciated.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ServerItemAddTemplateCombo.aspx.cs"
  
Inherits="ServerItemAddTemplateCombo" %>
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
 
    <head id="Head1" runat="server">
 
        <title></title>
 
        <link href="StyleSheet.css" rel="stylesheet" type="text/css" />
 
    </head>
 
    <body>
 
        <form id="form1" runat="server">
 
            <div>
 
                <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
 
                </telerik:RadScriptManager>
 
                <telerik:RadComboBox runat="server" ID="RadComboBox1" Height="190px" Width="520px" AutoPostBack = "true" AppendDataBoundItems="true"
  
                                     MarkFirstMatch="true" DataSourceID="SqlDataSource1" EnableLoadOnDemand="true"
  
                                     HighlightTemplatedItems="true" OnClientItemsRequested="UpdateItemCountField"
  
                                     OnDataBound="RadComboBox1_DataBound" OnItemDataBound="RadComboBox1_ItemDataBound"
  
                                     OnItemsRequested="RadComboBox1_ItemsRequested" Label="Grid-like multi-column:">
 
                    <HeaderTemplate>
 
                        <ul>
 
                            <li  class="col1">Customer Id</li>
 
                            <li  class="col1">Contact Name</li>
 
                            <li class="col2">City</li>
 
                            <li class="col3">Title</li>
 
                        </ul>
 
                    </HeaderTemplate>
 
                    <ItemTemplate>
 
                        <ul>
 
                            <li class="col1">
 
                            <%# DataBinder.Eval(Container.DataItem, "CustomerId") %></li>
 
                            <li class="col1">
 
                            <%# DataBinder.Eval(Container.DataItem, "ContactName") %></li>
 
                            <li class="col2">
 
                            <%# DataBinder.Eval(Container.DataItem, "City") %></li>
 
                            <li class="col3">
 
                            <%# DataBinder.Eval(Container.DataItem, "ContactTitle") %></li>
 
                        </ul>
 
                    </ItemTemplate>
 
                    <FooterTemplate>
 
                        A total of
 
                        <asp:literal runat="server" id="RadComboItemsCount" />
 
                        items
 
                    </FooterTemplate>
 
                </telerik:RadComboBox>
 
            </div>
 
            <asp:SqlDataSource ID="SqlDataSource1" runat="server"
  
                               ConnectionString="<%$ ConnectionStrings:NorthWindConnectionString %>"
 
                               SelectCommand="SELECT *  FROM [Customers] ORDER BY [CustomerID]"></asp:SqlDataSource>
 
            <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
 
                <script type="text/javascript">
 
                    function UpdateItemCountField(sender, args) {
                        //Set the footer text.
                        sender.get_dropDownElement().lastChild.innerHTML = "A total of " + sender.get_items().get_count() + " items";
                    }
                </script>
 
            </telerik:RadScriptBlock>
 
        </form>
 
    </body>
 
</html>

__________

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
 
public partial class ServerItemAddTemplateCombo : System.Web.UI.Page
{
    protected void RadComboBox1_DataBound(object sender, EventArgs e)
    {
        //set the initial footer label
        ((Literal)RadComboBox1.Footer.FindControl("RadComboItemsCount")).Text = Convert.ToString(RadComboBox1.Items.Count);
    }
 
    protected void RadComboBox1_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
    {
        //get all customers whose name starts with e.Text
        string sql = "SELECT * from Customers WHERE ContactName LIKE '" + e.Text + "%'";
 
        SqlDataSource1.SelectCommand = sql;
 
        RadComboBox1.DataBind();
    }
 
    protected void RadComboBox1_ItemDataBound(object sender, RadComboBoxItemEventArgs e)
    {
        //set the Text and Value property of every item
        //here you can set any other properties like Enabled, ToolTip, Visible, etc.
        e.Item.Text = ((DataRowView)e.Item.DataItem)["ContactName"].ToString();
 
        e.Item.Value = ((DataRowView)e.Item.DataItem)["CustomerID"].ToString();
    }
 
    
}

Thanks

gc_0620




gc_0620
Top achievements
Rank 1
 answered on 07 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?