Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
56 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
309 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
64 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
468 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
84 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
320 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
69 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
81 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
1 answer
185 views
Hi

Is there any way to cancel a user selecting another row in a radgrid with server-side validation? I want to allow the user to select a row in the grid, but only if some other textboxes are valid.
eg:
Markup:
<asp:TextBox ID="txtDummy" runat="server" />

<
telerik:RadGrid ID="rgProjects" runat="server"
      OnNeedDataSource="rgProjects_NeedDataSource"
      OnSelectedIndexChanged="rgProjects_SelectedIndexChanged">
   <ClientSettings Selecting-AllowRowSelect="true" EnablePostBackOnRowClick="true">
      <Scrolling AllowScroll="true" SaveScrollPosition="true" />
   </ClientSettings>
</telerik:RadGrid>
Code behind:
protected void rgProjects_SelectedIndexChanged(object sender, EventArgs e)
{
   Boolean result = CheckProjectChanges(txtDummy.Text);
   if (result == true)
      //continue with stuff - easy
   else
      //cancel row select! how??
}
Princy
Top achievements
Rank 2
 answered on 30 May 2011
5 answers
91 views
Hi.

I have a grid with some data (registers) with a GridClientSelectColumn.

When I have selected the desired registers I have I use the following function to access to the selected data:

function GetSelectedItems() {
    elems = $find("<%= leftGrid.MasterTableView.ClientID %>").get_selectedItemss();
}

At this point, I want to make an AJAX call for move the selected registers to another place (like another grid) or make some INSERTs into a concrete table at a database.

How can I get the selected rows to pass them to the server-side?

Best regards
Pavlina
Telerik team
 answered on 30 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?