Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
209 views
I have a RadPanel that hosts a few items.  One of the items is a Help section where I am trying to simulate the standard help format with a Splitter showing two panels, a left and a right.  The left has a RadTreeView and the right has an asp:Literal control.

My plan is to load a hierarcy of help topics based on a URL that is recorded in the help table.  So the table has a ParentID column that will hold a value or not. This sets up the grouping of the tree view nodes
.
I also want to have JavaScript load the content of the selected help topic (RadTreeNode) into the literal control's text property when the node is clicked.  Researching it on this site had given me the JavaScript via a RadScript block to respond to click events, focus, etc.

This is a MVC application with a Master Page and the View is displaying an MVC user control that is wrapping the Help process.  So the RadPanelBar displays the help section item as a user control.  All the JavaScript and styles are in the UserControl markup.

So I am not able to do the following things in JavaScript:

  1. Get the Literal Control instance (this is nested in a RadPane.
  2. Get the RadTreeView instance.
  3. Get the selected node.
  4. Get the object databound to the node.
  5. Set the Text property of the Literal Control to the "Content" property of my help business object.

 

This is the only thing I have been successful with to get the Literal object...

function onNodeClicking(sender, args)
 {
    alert("OnClientNodeClicking: " + args.get_node().get_text()); <-- works
    var literalContent = $('#helpContentHolder');  <-- returns generic object, how to cast?            
    var tree = <%= ctrlHelpRadTreeView.ClientID %>;  <-- returns HTMLDivElement  ??
  }

All the client side events below are in place and working...

<telerik:RadTreeView ID="ctrlHelpRadTreeView" runat="server" CheckBoxes="True" AllowNodeEditing="True"
                EnableDragAndDrop="true" OnClientNodeClicking="onNodeClicking" OnClientNodeChecking="onNodeChecking"
                OnClientMouseOver="onMouseOver" OnClientMouseOut="onMouseOut" OnClientNodeEditStart="onEditStart"
                OnClientNodeEditing="onEditing" OnClientNodeEdited="onEdited" OnClientNodeDragStart="onNodeDragStart"
                OnClientNodeDropping="onNodeDropping" OnClientNodeExpanded="onNodeExpanded" OnClientNodeCollapsed="onNodeCollapsed"
                OnClientNodeAnimationEnd="onNodeAnimationEnd" OnClientLoad="onLoad" BeforeClientClick="BeforeClientClickHandler"  Width="100%" 
                Height="250px" Style="border: 1px solid #CBE7F5;">
     .........
</telerik:RadTreeView>

So the handler I am anticipating and have been working with is the OnNodeClicked.
Can anyone shed some light on how I get the literal and set it's text to the databound object in the TreeView?

The attached file shows how I am adapting it from a demo here on the site.  The TreeView is not databound at this time.  The image is intended to show the two panes side by side (again, inside the user control).  The Literal control is visible in the right panel inside the user control.

Thanks!

Reid

Reid
Top achievements
Rank 2
 answered on 30 May 2011
2 answers
131 views

Hi.

 

I know this is a general asp.net question, but I think it's very relavant here:

 

Is there a way to use <telerik:??? serverside controls in a jquery template.

 

Ex: A guestbook with comments to each entry.

 

If I create a set of nested templates for the messages and comments, I would like to use a "Comment" RadButton in the messages template so that each entry would have a "Comment" button. And.. maybe a rating control.

I just can't see how I can use anything but HTML.controls in my  templates.

Is there a solution to that.

Thanks
/Jesper

Jesper Krejberg Petersen
Top achievements
Rank 2
 answered on 30 May 2011
1 answer
83 views
My source of images in Sharepoint. Is there any link on how to get images from SP (with links, description)?
Niko
Telerik team
 answered on 30 May 2011
2 answers
361 views
Hi,

Lately I've been working on a user control to represent a week (Week User Control). This User Control contains, based on settings, 5, 6 or 7 days:
  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • (optional Saturday)
  • (optional Sunday)
Each day itself is a User Control (Day User Control) too and includes a RadListView object.

In my Default.aspx I'm using the Week User Control, but for each day I would like to create an AjaxSetting. This AjaxSetting should have its AjaxControlID set to the RadListView object of the User Control. Why? I want to catch changes in the selection of the RadListView, so my RadRibbonBar (menu) can change its appearance. Whenever a user selects or deselects an item in a RadListView object my menu has to change its appearance (enable / disable specific buttons), but how can I accomplish this?

So, on my Default.aspx I have my RadRibbonBar object and Week User Control.
In my Week User Control (week.ascx) I have 5 to 7 Day User Controls (Monday till Friday/Saturday/Sunday).
In my Day User Control (day.ascx) I have the RadListView control which ID has to be set to the AjaxControlID in my Default.aspx.

Default.aspx:
<telerik:RadRibbonBar ID="Menu" runat="server">
  ...
</telerik:RadRibbonBar>
 
<telerik:RadAjaxLoadingPanel ID="LoadingPanel" runat="server" />
<telerik:RadAjaxManagerProxy ID="AjaxManager" runat="server">
  <AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="??? RadListViewID of each Day user Control ???">
      <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="Menu" LoadingPanelID="LoadingPanel" />
      </UpdatedControls>
    </telerik:AjaxSetting>
  </AjaxSettings>
</telerik:RadAjaxManagerProxy>
 
<uc1:Week ID="Week" runat="server" OnActivitySelectionChanged="Week_SelectionChanged" />

Week User Control (week.ascx):
<uc1:Day ID="Sunday" runat="server" Day="Sunday" OnActivitySelectionChanged="OnActivitySelectionChanged" />
<uc1:Day ID="Monday" runat="server" Day="Sunday" OnActivitySelectionChanged="OnActivitySelectionChanged" />
<uc1:Day ID="Tuesday" runat="server" Day="Sunday" OnActivitySelectionChanged="OnActivitySelectionChanged" />
<uc1:Day ID="Wednesday" runat="server" Day="Sunday" OnActivitySelectionChanged="OnActivitySelectionChanged" />
<uc1:Day ID="Thursday" runat="server" Day="Sunday" OnActivitySelectionChanged="OnActivitySelectionChanged" />
<uc1:Day ID="Friday" runat="server" Day="Sunday" OnActivitySelectionChanged="OnActivitySelectionChanged" />
<uc1:Day ID="Saturday" runat="server" Day="Sunday" OnActivitySelectionChanged="OnActivitySelectionChanged" />

Day User Control (day.ascx):
<telerik:RadListView ID="lvDay" runat="server" onselectedindexchanged="lvDay_SelectedIndexChanged" AllowMultiItemSelection="true">
</telerik:RadListView>

The OnSelectedIndexChanged property "lvDay_SelectedIndexChanged" does the following to notify Week User Control and Default.aspx and eventually do something in the code-behind of Default.aspx in the "Week_SelectionChanged" event:
public event EventHandler ActivitySelectionChanged;
protected void OnActivitySelectionChanged(EventArgs e)
{
  if (ActivitySelectionChanged != null)
    ActivitySelectionChanged(this, e);
}
 
protected void DayListView_SelectedIndexChanged(object sender, EventArgs e)
{
  OnActivitySelectionChanged(e);
}

The Week_SelectionChanged event changes the appearance of the RadRibbonBar in Default.aspx.

Hopefully, you know a solution or workaround for my problem. The current solution is not eligible, because the page now postbacks after a (de)selection in a RadListView object in order to refresh the RadRibbonBar. But, I would like to only refresh the RadRibbonBar based on a (de)selection.

I'm looking forward to see your comments on this. Thanks in advance!

Regards,
Datamex
Datamex
Top achievements
Rank 2
 answered on 30 May 2011
1 answer
87 views
Hello,

I'm using an GridAttachmentColumn in my RadGrid according example: http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/gridattachmentcolumn/defaultcs.aspx

When click on the AttachmentColumn the error 'Can't find fireCommand' is raised on the following Javascript:
function onclick(event)
{
if(!$find('').fireCommand('DownloadAttachment','{"FileID":5,"ColumnUniqueName":"FileName","FileName":"Hydrangeas.jpg"}')) return false;
}

The problem is caused by $find('') I expect but how do I force that the right object is passend so it will perform like '$find('RadGrid')' ??

Anyone?

RvdGrint
Top achievements
Rank 1
 answered on 30 May 2011
7 answers
506 views
We are using the Telerik controls for our application. we are getting the following error when our application is idle for above 5 mins and do some server request.

Microsoft JScript runtime error:
Sys.WebForms.PageRequestManagerServerErrorException: An Unknown
error occured while processing the request on the server. The status code
returned from the server was: 12030


This error is occuring in the Telerik.Web.UI.... Please refer the screenshot attached for your reference.

Thanks in advance.
Iana Tsolova
Telerik team
 answered on 30 May 2011
1 answer
105 views
The attached .demonstration page gives an invalid character error when opening a radWindow from client script.

<%

 

@ Page Language="C#" AutoEventWireup="true" CodeBehind="ASPXPage1.aspx.cs" Inherits="LoadPlanner.ASPXPage1" %>

 

<!

 

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

 

<

 

 

html xmlns="http://www.w3.org/1999/xhtml">

 

 

<

 

 

head runat="server">

 

 

 

<title></title>

 

 

</

 

 

head>

 

 

<

 

 

body>

 

 

 

<form id="form1" runat="server">

 

 

 

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">

 

 

 

</telerik:RadScriptManager>

 

 

 

<script type="text/jscript">

 

 

 

function menuClick(sender, eventArgs) {

 

 

 

 

var item = eventArgs.get_item();

 

 

 

 

var text = item.get_text();

 

 

 

 

switch (text) {

 

 

 

 

case "New":

 

 

 

 

// ask 'Save changes?', clear form

 

 

 

break;

 

 

 

 

case "Open ...":

 

 

 

 

// open file dialog in new window

 

OpenFileExplorerDialog();

 

 

break;

 

 

}

 

 

 

return false;

 

 

}

 

 

 

function OpenFileExplorerDialog() {

 

 

 

 

var wnd = $find("<%= ExplorerWindow.ClientID %>");

 

 

wnd.show();

 

}

 

 

 

 

 

</script>

 

 

 

<div id="pageContainer">

 

 

 

<!-- Page Header -->

 

 

 

<telerik:RadMenu ID="RadMenu2" runat="server" onclientitemclicked="menuClick">

 

 

 

<Items>

 

 

 

<telerik:RadMenuItem runat="server" Text="File">

 

 

 

<Items>

 

 

 

<telerik:RadMenuItem runat="server" Text="New">

 

 

 

</telerik:RadMenuItem>

 

 

 

<telerik:RadMenuItem runat="server" Text="Open ...">

 

 

 

</telerik:RadMenuItem>

 

 

 

</Items>

 

 

 

<GroupSettings Flow="Horizontal" />

 

 

 

</telerik:RadMenuItem>

 

 

 

</Items>

 

 

 

</telerik:RadMenu>

 

 

 

</div>

 

 

 

<telerik:RadWindow runat="server" Width="400px" Height="400px"

 

 

 

 

VisibleStatusbar="false" NavigateUrl="~/LoadPlans" ID="ExplorerWindow"

 

 

 

Modal="true" Behaviors="Close,Move" ViewStateMode="Disabled">

 

 

 

</telerik:RadWindow>

 

 

 

</form>

 

 

</

 

 

body>

 

 

</

 

 

html>

 


An extract of the relevant part of the automatically generated script file in which the error occurs is shown below

if

 

 

(this._dockMode){var k=$get(this.get_id()+"_C");

 

if

 

 

(k&&k.innerHTML){k.style.overflow="auto";

 

 

k.style.border=

 

"0px";

 

this

 

 

.set_contentElement(k);

 

this

 

 

.setWidthDockMode(this.get_width());

 

this

 

 

.setHeightDockMode(this.get_height());
///////////////////// my highlighting - offending statement shown in bold

 

 

}}

 

else{var o=($telerik.isIE)?document.createElement("<iframe name='"+c+"'>"):document.createElement("iframe");

 

 

o.name=c;

 

o.src=

 

"javascript:'<html></html>';";

 

 

o.style.width=

 

"100%";

 

 

o.style.height=

 

"100%";

 

 

o.style.border=

 

"0px";

 

 

o.frameBorder=

 

"0";

 



Rgds
Len Jones
Georgi Tunev
Telerik team
 answered on 30 May 2011
4 answers
345 views
Hi,
I have RadGrid in RadPane in scenario same like this demo: http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandsplitterresizing/defaultcs.aspx?product=grid

When I put this code to Content Page (under Master Page), RadGrid will shrink itself, ignoring its Height=100% parameter. This problem is reproductable when:
  • RadGrid is in ContentPage
  • RadGrid is in RadPane
  • RadGrid's height is set to 100%
  • RadGrid's Scrolling is on (<Scrolling AllowScroll="true" UseStaticHeaders="true" />)
  • RadGrid is Ajaxified by RadAjaxManager (RadAjaxManagerProxy)

When I shut off Ajax, everything is fine. I have only one RadAjaxManager in MasterPage in ContentPages I use RadAjaxManagerProxy. I send sample as attachment,

Code:
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"
    <script type="text/javascript"
        function ClientResized(sender, eventArgs) { 
            $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest('ChangePageSize'); 
        } 
    </script> 
         
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadGrid1"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManagerProxy> 
 
    <telerik:RadSplitter ID="RadSplitter1" Width="100%" Height="100%" runat="server" Orientation="Horizontal" BorderSize="0" BorderStyle="None" PanesBorderSize="0" VisibleDuringInit="false"
        <telerik:RadPane ID="gridPane" runat="server"  Width="100%" Height="60%" Scrolling="None" OnClientResized="ClientResized">            
            <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" GridLines="None"  Width="100%" Height="100%" UseStaticHeaders="true"  Style="border: 0; outline: none"
            <ClientSettings><Scrolling AllowScroll="true" UseStaticHeaders="true" /></ClientSettings
            <MasterTableView> 
            </MasterTableView> 
        </telerik:RadGrid> 
        </telerik:RadPane> 
        <telerik:RadSplitBar CollapseMode="Both" ID="RadSplitBar2" runat="server" EnableResize="True"></telerik:RadSplitBar> 
        <telerik:RadPane ID="listBoxPane" runat="server" BackColor="#d9eeff"  Height="40%"
            Bottom Pane 
        </telerik:RadPane> 
    </telerik:RadSplitter> 
</asp:Content> 


Thank you for help!
Pavlina
Telerik team
 answered on 30 May 2011
4 answers
98 views
hi all
I want design RadDock like SolutionExplorer window of VisualStudio .net
which move left & right not up&down and can fixed it position

please tell me how can I do that
samaneh
Top achievements
Rank 1
 answered on 30 May 2011
1 answer
99 views

Hi Telerik experts,

Was wondering if I could get some help on this issue.

Have a Control Panel page with multiple 'filter' buttons.
What we want to do is put multiple Grids onto this single page
and hide/show them based on what 'filter' button is clicked.
(For reasons having to do with another issue I was having,
it's actually the Grid inside the Control that is being
shown/hidden.)

We do this by puttingmultiple User Controls (.ascx) on the page, each of which contains a Grid
and a RadCodeBlock with javascript to do client-side binding.

The issue is as follows:

You start the app, go to Control Panel page.
It defaults to 'Button1', shows the Grid1, and it works fine. The User Control loads, the Grid inside
the control is Data Bound.

The problem is when you click 'Button 2' and it tries to load a different control.
The Grid fails to databind. Checking the output I can see that the client side binding javascript
for the new control is there/compiled.

weird thing is, it only fails to bind the 'second time'.
After that, if you click 'Button 2' again (or any other button first then click 'Button 2'),
the Grid binds and displays correctly.

 

Each User Control looks something like this:

<telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
    <script type="text/javascript">

        var headerView = null;
        var commandName = "";
        var entityTypeID = 3;
        var entityID = 154;

        var detailsView = null;

        function m_rgPickupRequests_controlLoad(sender, args) {
            /*
            headerView = $find("<%= m_rgPickupRequests.ClientID %>").get_masterTableView();
            commandName = "Load";
            updateHeaderVirtualItemCount(0);
            var s = headerView.get_sortExpressions().toString();
            var filterState = $get("<%= m_hdnStateButtonType.ClientID %>").value;
            totalcontrol.Service.RequestsService.GetPickupRequestGridContents(
                entityTypeID,
                entityID,
                filterState,
                headerView.get_currentPageIndex() * headerView.get_pageSize(),
                headerView.get_pageSize(),
                headerView.get_sortExpressions().toString(),
                headerView.get_filterExpressions().toString(),
                updateHeaderGrid);
                */
        }

        function m_rgPickupRequests_Command(sender, args) {
            args.set_cancel(true);
            commandName = args.get_commandName();
            var filterState = $get("<%= m_hdnStateButtonType.ClientID %>").value;
            totalcontrol.Service.RequestsService.GetPickupRequestGridContents(
                entityTypeID,
                entityID,
                filterState,
                headerView.get_currentPageIndex() * headerView.get_pageSize(),
                headerView.get_pageSize(),
                headerView.get_sortExpressions().toString(),
                headerView.get_filterExpressions().toString(),
                updateHeaderGrid);
        }

        function m_rgPickupRequests_RowDataBound(sender, args) {
            var description = args.get_dataItem()["Description"];
            var cell = args.get_item().get_cell("Description");
            cell.style.cursor = 'pointer';
            setToolTip(cell, description);
        }

        function setToolTip(element, description) {
            var radToolTipManager = $find('<%= Parent.FindControl("m_rttToolTipManager").ClientID %>');
            if (!radToolTipManager) {
                return;
            }

            var tooltip = radToolTipManager.getToolTipByElement(element);
            if (!tooltip) {
                tooltip = radToolTipManager.createToolTip(element);
            }
        }

        function updateHeaderGrid(result) {
            headerView.set_dataSource(result);
            headerView.dataBind();
            var filterState = $get("<%= m_hdnStateButtonType.ClientID %>").value;
            if (commandName == "Filter" || commandName == "Load") {
                totalcontrol.Service.RequestsService.GetRequestGridContentsCount(
                    entityTypeID,
                    entityID,
                    filterState,
                    headerView.get_filterExpressions().toString(),
                    updateHeaderVirtualItemCount);
            }
        }

        function updateHeaderVirtualItemCount(result) {
            headerView.set_virtualItemCount(result);
        }

    </script>
</telerik:RadCodeBlock>

<asp:ScriptManagerProxy ID="ScriptManager2" runat="server">
    <Services>
        <asp:ServiceReference Path="~/Services/RequestService.svc" />
    </Services>
</asp:ScriptManagerProxy>

<asp:HiddenField ID="m_hdnStateButtonType" runat="server" />

<telerik:RadGrid ID="m_rgPickupRequests" runat="server" AllowFilteringByColumn="true">
    <MasterTableView>
        <Columns>
   <....GridBoundsColumns....>
        </Columns>

    </MasterTableView>
<ClientSettings>
            <ClientEvents OnCommand="m_rgPickupRequests_Command"
            OnGridCreated="m_rgPickupRequests_controlLoad"
            OnRowDataBound="m_rgPickupRequests_RowDataBound"
            />
</ClientSettings>
</telerik:RadGrid>


 

Control Panel is something like so:

    <asp:Panel ID="m_pnlFilters" runat="server" CssClass="clear">           
        <fieldset>
            <table style="display:inline">
                <tr>
                    <th>
                        Filter by Site/Department
                    </th>
                </tr>
                <tr>
                    <td>
                        <telerik:RadTreeView ID="m_rtvEntities" runat="server" CheckBoxes="true"
                            CheckChildNodes="true"
                            TriStateCheckBoxes="true"
                            Width="23em"
                            Height="8em"
                            BorderStyle="Solid"
                            BorderColor="Gray"
                            BorderWidth="1px">
                        </telerik:RadTreeView>
                    </td>
                </tr>
            </table>
            <table style="display:inline; margin-left: 2em">
                <tr>
                    <th>
                        Filter by User
                    </th>
                </tr>
                <tr>
                    <td>
                        <telerik:RadButton ID="m_btnAllItems" runat="server"
                            Text="All Items" ToggleType="Radio" GroupName="MyItemsFilters" Width="8em" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <telerik:RadButton ID="m_btnMyItems" runat="server"
                            Text="My Items Only" ToggleType="Radio" GroupName="MyItemsFilters" Width="8em" />
                    </td>
                </tr>
            </table>
            <table style="display:inline; margin-left: 2em">
                <tr>
                    <th colspan="3">
                        Filter by Status
                    </th>
                </tr>
                <tr>
                    <td>
                        <telerik:RadButton ID="button1" runat="server"
                            Text="Items In Use" ToggleType="Radio" GroupName="StateButtonFilters" Width="12em"
                            CommandName="Filter" CommandArgument="ItemsInUse" OnCommand="FilterStateButton_Command" />
                    </td>
                    <td>
                        <telerik:RadButton ID="button2" runat="server"
                            Text="Pending Pickup" ToggleType="Radio" GroupName="StateButtonFilters" Width="12em"
                            CommandName="Filter" CommandArgument="PendingPickup" OnCommand="FilterStateButton_Command"/>
                    </td>
                </tr>
  <table>  
        </fieldset>
    </asp:Panel>

    <asp:Panel ID="m_pnlGridContainer" runat="server">
        <TC1:RequestGrid ID="m_ctlRequestGrid" runat="server" />
        <TC1:PickupGrid ID="m_ctlPickupRequestGrid" runat="server" />
        <TC1:QuoteGrid ID="m_ctlQuoteGrid" runat="server" />
    </asp:Panel>

Any help would be appreciated. Thanks!

Richard 

 

Iana Tsolova
Telerik team
 answered on 30 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?