Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
89 views
Hi,

I've added the following property in my config file to forbid javascript code in the RADEditor:

<property name="AllowScripts">False</property>

I've noticed the following:
- an "onclick" attribute of a href in a "page content" where the telerik editor is activated, is stripped out when saving the page.
- an "onclick" attribute of a href in a "Telerik RADeditor webpart", is not stripped out when saving the page.

How can I forbid the onclick attribute in a RADeditor webpart? I want it to be stripped out as well in the webpart.

Kind regards,

Jean

 

Stanimir
Telerik team
 answered on 07 Dec 2010
1 answer
219 views
Is it possible to use a RadCalender to filter a RadGrid connected to a SQLDataSource?

This is how simple it is using standard .NET controls:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TestConnectionString %>"
        SelectCommand="SELECT [name], [id], [dtime] FROM [test] WHERE ([dtime] = @dtime)">
        <SelectParameters>
            <asp:ControlParameter ControlID="Calendar1" Name="dtime" PropertyName="SelectedDate"
                Type="DateTime" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="id"
        DataSourceID="SqlDataSource1">
        <Columns>
            <asp:BoundField DataField="name" HeaderText="name" SortExpression="name" />
            <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
                SortExpression="id" />
            <asp:BoundField DataField="dtime" HeaderText="dtime" SortExpression="dtime" />
        </Columns>
    </asp:GridView>
    <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>

If I attempt the same thing using RadControls, I get the following Error.

SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.


Here is the code I am using for the same funtionallity above using RadControls:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>
  
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadCalendar ID="RadCalendar1" Runat="server" AutoPostBack="True" 
        EnableMultiSelect="False" SelectedDate="" ViewSelectorText="x">
    </telerik:RadCalendar>
    <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" 
        GridLines="None">
<MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
  
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
  
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridBoundColumn DataField="DateSubNeeded" DataType="System.DateTime" 
            HeaderText="DateSubNeeded" SortExpression="DateSubNeeded" 
            UniqueName="DateSubNeeded">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Reason" HeaderText="Reason" 
            SortExpression="Reason" UniqueName="Reason">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="FullName" HeaderText="FullName" 
            ReadOnly="True" SortExpression="FullName" UniqueName="FullName">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="EmailAddress" HeaderText="EmailAddress" 
            SortExpression="EmailAddress" UniqueName="EmailAddress">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Office" HeaderText="Office" 
            SortExpression="Office" UniqueName="Office">
        </telerik:GridBoundColumn>
    </Columns>
</MasterTableView>
    </telerik:RadGrid>
    <p>
         </p>
    <p>
        <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
        </telerik:RadScriptManager>
    </p>
    <p>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:Human_ResourcesConnectionString %>" 
            SelectCommand="SELECT [DateSubNeeded], [Reason], [FullName], [EmailAddress], [Office] FROM [vw_SCS_SubRequests] WHERE ([DateSubNeeded] = @DateSubNeeded)">
            <SelectParameters>
                <asp:ControlParameter ControlID="RadCalendar1" Name="DateSubNeeded" 
                    PropertyName="SelectedDate" Type="DateTime" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <p>
         </p>
    </form>
</body>
</html>


Tsvetina
Telerik team
 answered on 07 Dec 2010
2 answers
137 views
Hi!

This is my scenario:
I dynamically load my target control "m_View_lnk_Username" in my "RadToolTipManager1" but when I click with the mouse on the Hyperlink the page don't call "OnAjaxUpdate" methods. Why?

HTML:
<telerik:RadToolTipManager ID="RadToolTipManager1" HideEvent="ManualClose"
        Width="600" Height="500" runat="server" EnableShadow="true" OnAjaxUpdate="OnAjaxUpdate"
        RelativeTo="Element" Position="BottomRight" Modal="true" ShowEvent="OnClick">
    </telerik:RadToolTipManager>

<asp:HyperLink ID="m_View_lnk_Username" runat="server" NavigateUrl="#" />

C# (Page_Load method):
this.RadToolTipManager1.TargetControls.Add( m_Update_lnk_Username.ClientID, "104", true );


Thanks in advance,

Francesco
Lorenzo
Top achievements
Rank 1
 answered on 07 Dec 2010
5 answers
144 views

The page has a panel bar which dynamically loads TreeViews as PanelItems.  To prevent losing the trees during a postback, a custom control is loaded in the XmlHttpPanel.  In order to get the correct control and pass all desired information, I need to access multiple custom attributes of the selected node.  Any suggestions on how to either pass or access the selected node server side (from within the "XmlHttpPanel_ServiceRequest" without performing a postback? 

Update to post: The trees are gone upon the service request as well and since the tree and nodes or not serializable the information cannot be stored in the viewstate either.  What was the point of making a control that loses its contents upon a postback?  Looks like the path will be to stuff everything into a long string for use as the "value" on the service call then parse out what's needed.  For such an impressive toolset overall, seems like the PanelBar is a tad lacking.  Unless of course, I missing the obvious which is always a possibility.

Below is an overly simplified view of what is being attempted.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
    <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script language="javascript" type="text/javascript">
            function NodeClicked(sender, args) {
                var node = args.get_node();
                var panel = $find("<%= RadXmlHttpPanel1.ClientID %>");
                panel.set_value(node.get_text());
            }
        </script>
    </telerik:RadScriptBlock>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <table>
        <tr>
            <td>
                <telerik:RadPanelBar ID="RadPanelBar1" runat="server">
                </telerik:RadPanelBar>
            </td>
            <td>
                <telerik:RadXmlHttpPanel ID="RadXmlHttpPanel1" runat="server" OnServiceRequest="XmlHttpPanel_ServiceRequest">
                </telerik:RadXmlHttpPanel>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>

public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
                LoadRootContent();
        }
        private void LoadRootContent()
        {
            RadPanelItem myPanelItem = new RadPanelItem("Item 1");
            RadTreeView myTreeView = new RadTreeView();
            myTreeView.OnClientNodeClicked = "NodeClicked";
            //Build a node
            RadTreeNode node1 = new RadTreeNode("TreeNode 1");
            node1.Category = "Customers";
            node1.Attributes.Add("CustomerID", "123");
            myTreeView.Nodes.Add(node1);
            //Build another node
            RadTreeNode node2 = new RadTreeNode("TreeNode 2");
            node2.Category = "Prospects";
            node2.Attributes.Add("ProspectID", "456");
            myTreeView.Nodes.Add(node2);
  
            //Add the tree to the PanelItem - this could happen more than once for each PanelItem
            myPanelItem.Controls.Add(myTreeView);
            //Add the item to the PanelBar - this would occur for multiple items
            RadPanelBar1.Items.Add(myPanelItem);
        }
        protected void XmlHttpPanel_ServiceRequest(object sender, RadXmlHttpPanelEventArgs e)
        {
            string val = e.Value;
            if (val == "TreeNode 1")
            {
                RadXmlHttpPanel1.Controls.Add(LoadControl("Test1.ascx"));
            }
            if (val == "TreeNode 2")
                RadXmlHttpPanel1.Controls.Add(LoadControl("Test2.ascx"));
  
        }
    }

Any suggestions or thoughts are welcome.
Thanks in advance.
Pero
Telerik team
 answered on 07 Dec 2010
11 answers
202 views
Hi All

I have a page which has 2 Grid on it (related tables), as follow

Grid1
ItemID     Name            Address

Grid2
employeeID       Photo       ItemID

- The Grid 2 has insert new record on it.

What i need is when insert new record on grid2 (depends on the row the user select in grid1) the ItemID get the value automatically from Grid1 and display it as label so the user does not have to enter its value... is it possible?

Thanks
Iana Tsolova
Telerik team
 answered on 07 Dec 2010
8 answers
130 views
Hi

I have a problem that I have a good idea that its caused by the Ajaxification using RadAjaxManager.

The app that Im working on has a RadTreeView and a RadScheduler. A click on a node in the tree view causes a reload of the scheduler and populate it with appoinments filtered by a filter from the tree view.

Then I want to open an appointment in the scheduler in the standard advanced edit dialog. I have a couple of resources connected to each appointment.

When I doesnt have AjaxSettings and there by reload the whole app when I update the scheduler and then open an appointment it all works fine.
But when I have an AjaxSetting between the tree view and the scheduler so that only the scheduler reloads when I click on my node and after that open an appointment in the edit dialog I get an error. The error I get is "There is not enough storage to complete this operation".
I also works fine if I remove some of the RadSplitters around the scheduler. 

Ive read a lot about that error but cannot find any connections to what Im doing.

I attach an image of the problem. And look specially on the line number. What is that!

Does anyone have any idea what this can 

//Mathias
Radoslav
Telerik team
 answered on 07 Dec 2010
3 answers
187 views
Hello,
I am using grid to display the data in a pivot manner. The intial data will be in the following format.
Apart from these columns there are many more columns from the source data.
Id  Cat/SubCatGroup TransactionDate Amount
1   Painting   10/04/2010 250
2   Music   09/27/1010 51.75
3   Music   09/27/1010 30
4   Music   09/27/1010 4

What I need to display in the grid is as shown in the  attached file  output format.png I have been trying this since long time. I am using OnNeedDataSource to bind the data.
protected void samplegrid_DataSource(object sender, EventArgs e)
{
//tr is the data (list<t> that contains the data received from the database)
//ToDataTable() is the method which converts the list of objects to datatable
   samplegrid.DataSource = GetInversedDataTable(ToDataTable(tr), "TransactionDate", "CatSubCatName",Amount", "-");
}


//In the GetInversedDataTable()-- I tried to create a datatable with data which will be in the required format

Id            Cat/SubCatGroup            09/27/2010         10/04/2010

1              Painting                                                         250

2              Music                                    51.75

3              Music                                    30          

4              Music                                    4


But here I dont want to display the Id column.
I want the amount value as a hyperlink. When I click particular amount value, I need to collect that Id value at the backend. Based on that value I have to do some action.


Could anyone please suggest me how to proceed.
Urgent pls.
thanks in advance

Radoslav
Telerik team
 answered on 07 Dec 2010
3 answers
217 views
I have just installed the ASP.NET Ajax controls with Visual Studio 2010 on Windows 7 64bit. I did a complete install from the .msi package.

When I try to create any Telerik project I am getting the error:

Template attempted to load component assembly Web.UI.VSPackage version 2010.3.1109.0. This is the version that shows in the VS2010 extension manager. I have uninstalled it and downloaded it from the online gallery, getting the same version.

In my Telerik.../Bin40 directory the Web.UI.dll file is version 2010.3.1109.40, which is probably while it is not being found. Tis version is also in the GAC.

Also, I have no Telerik Menu but I have Telerik tools in the toolbox. I have followed the steps in the documentation that are documented for this problem but no success.

Anyone have any idea?

Thank you
Juanita
Erjan Gavalji
Telerik team
 answered on 07 Dec 2010
2 answers
115 views
I looked up your example below and i am having problem reproducing it exactly like you.
I am not sure what my problem is because it looks pretty similar to your example to me.

http://www.telerik.com/help/aspnet/chart/grouping-databound-items.html

I have a list of custom objects with 3 properties (Service, Name, Quantity)
The list i get is as follow

    Name: "décembre"
    Quantite: 3
    Service: "C.I. Centre administratif "

    Name: "décembre"
    Quantite: 1
    Service: "C.I. Centre-ville"

    Name: "novembre"
    Quantite: 1
    Service: "C.I. Temporaire"

Public Sub RefreshData()
    Dim i As List(Of Intervention) = AccesDonneesHelper.GetInterventionsDetails()
    RadChart1.ChartTitle.TextBlock.Text = "MY GRAPH"
    RadChart1.Series.Add(New ChartSeries())
    RadChart1.DataSource = AddFilter()
    RadChart1.DataGroupColumn = "Service"
    RadChart1.PlotArea.XAxis.DataLabelsColumn = "Name"
    RadChart1.DataBind()
End Sub
and the output (see attached) is not what expected. There should be at least one bar in november. What am i doing wrong?
Ves
Telerik team
 answered on 07 Dec 2010
2 answers
50 views
I'm having this problem where the onGridItemSelected event is not being executed when I multi-select items using the SHIFT key.
It works just fine if I use CTRL.

Is this normal? Am I doing something wrong?

Thanks in advance.
Fiko
Telerik team
 answered on 07 Dec 2010
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
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
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?