Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
191 views
I am not getting updated pageindex when navigating from page to page. it shows previous page number, not current one which is clicked.
Master.SearchResults is radGrid
Following is configuration of grid on aspx.     <telerik:RadGrid ID="SearchResultsGrid" runat="server" EnableViewState="True"             Height="100%" AutoGenerateColumns="false" AllowPaging="true" AllowCustomPaging="true"             AllowSorting="True" AllowMultiRowSelection="True" GridLines="None"              Skin="Telerik"  OnItemCommand="SearchResultsGrid_ItemCommand"             OnNeedDataSource="SearchResultsGrid_NeedDataSource" PageSize="50" Width="721" >             <MasterTableView EnableNoRecordsTemplate="true" TableLayout="Fixed" DataKeyNames="AssignmentId">




protected void SearchResultsGridNeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            try
            {
                    LoadSearchResults();
            }
            catch (Exception ex)
            {
                HandleException(Master.ErrorMessagePanel, AssignmentErrorMessages.FIND_ASSIGNMENTS, string.Empty, MessageStatus.Error, ex);
            }
        }

 private void LoadSearchResults(bool dataBind = false)
        {
            if (rdoObjectType.SelectedItem == null)
            {
                return;
            }
            if (string.IsNullOrEmpty(selNames.SelectedValue))
            {
                return;
            }
            int objectId = int.Parse(rdoObjectType.SelectedItem.Value);
            int nameId = int.Parse(selNames.SelectedValue);
            List<SelectListDto> clientNames = (List<SelectListDto>)GetClientNames(objectId, selNames.Text);
            int objectTypeId = int.Parse(clientNames.Single(c => c.Value == int.Parse(selNames.SelectedValue)).ExtraField);
            int statusId = int.Parse(rdoStatus.SelectedValue);
            AssignmentSearchResultDto assignments  = FindAssignment(objectTypeId, objectId, nameId, statusId);
 
            Master.SearchResults.VirtualItemCount = assignments.TotalItems;
            Master.SearchResults.AllowCustomPaging = true;
            Master.SearchResults.DataSource = assignments.Assignments;
            Master.SearchResults.PageIndexChanged += RadGrid1_PageIndexChanged;
        }

 private AssignmentSearchResultDto FindAssignment(int objectTypeId, int objectId, int personId, int status)
        {
            int startRowIndex = Master.SearchResults.CurrentPageIndex * Master.SearchResults.PageSize;
            int maximumRows = Master.SearchResults.PageSize;
            AssignmentSearchResultDto assignments;
            using (Assignment assignment = new Assignment())
            {
                assignments = assignment.FindAssignment(objectTypeId, objectId, personId, status, agencyId, startRowIndex, maximumRows);
            }
            return assignments;
        }



Vasil
Telerik team
 answered on 26 Jul 2011
2 answers
75 views
Edit: Title was supposed to read:

Bug Report: &nbsp; shows in Grid DropDownColumn and RadComboBox



When I upgraded to 2011.2.712.40 I now see &nbsp; in these grid columns sometimes. You can see it on your own demo page: http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/columntypes/defaultcs.aspx (Look at the RadComboBox for 'Andrew Fuller' in the second grid.)

Testing in my project, I switch to 2011.1.519.40 and &nbsp; does not show. Update the reference to Q2 and &nbsp; shows again.

Thanks,
Dan
Dan Lehmann
Top achievements
Rank 1
 answered on 26 Jul 2011
1 answer
91 views
Am trying do the same Scnarios in the following demo:

http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltiptreeview/defaultcs.aspx


am facing problem in RadToolTipmanager1_AjaxUpdat
when am tring Dim details As ProductDetails   ----usercontrol .

am getting error saying the usercontrol not defiend

i think am missing something ,, any one can help

thanks
Marin Bratanov
Telerik team
 answered on 26 Jul 2011
1 answer
85 views
I currently have a grid with 1 column split into 2 based on a GridTemplateColumn I'm trying to figure out how to sort each of the separate columns by 2 different fields.  Here is my code for my grid. 

 

<

 

telerik:RadGrid ID="grdCurrentandPrior" runat="server" AllowSorting="True" AutoGenerateColumns="False"

 

 

 

 

 

 

GridLines="None" Skin="Web20" Style="margin-right: 0px" Width="673px" Height="260px"

 

 

 

 

 

 

OnNeedDataSource="grdCurrentandPrior_NeedDataSource" OnItemDataBound="grdCurrentandPrior_ItemDataBound">

 

 

 

 

 

 

<ExportSettings FileName="OpenItemsCurrentInventory" IgnorePaging="True" OpenInNewWindow="True">

 

 

 

 

 

 

<Excel Format="HTML" />

 

 

</ExportSettings>

 

 

 

 

 

 

<MasterTableView CommandItemDisplay="Bottom" AllowNaturalSort="false">

 

 

 

 

 

 

<CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" ShowRefreshButton="false"/>

 

 

 

 

 

 

<Columns>

 

 

<telerik:GridTemplateColumn HeaderText="Assignee" UniqueName="Assignee" SortExpression="Assignee">

 

 

 

 

 

 

<HeaderStyle Font-Bold="True" Width="100px" HorizontalAlign="Center" />

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

<asp:Label ID="lbAssignee" runat="server" Text='<%# Eval("Assignee") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

 

 

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn HeaderText="Jurisdictions" UniqueName="JurisdictionCount" SortExpression="JurisdictionCount">

 

 

 

 

 

 

<HeaderStyle Font-Bold="True" Width="100px" HorizontalAlign="Center" />

 

 

 

 

 

 

<ItemTemplate >

 

 

 

 

 

 

<asp:Label ID="lbJurisdiction" runat="server" Text='<%# Eval("JurisdictionCount") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

 

 

 

 

<ItemStyle HorizontalAlign="Right" ForeColor="Black" />

 

 

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

 

 

<telerik:GridTemplateColumn UniqueName="TemplateColumn">

 

 

 

 

 

 

<HeaderTemplate>

 

 

 

 

 

 

<table id="Table1" cellspacing="1" cellpadding="1" width="200px" border="1">

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

<td colspan="2" align="center">

 

 

 

 

 

 

<b>Open Items by Age</b>

 

 

 

 

 

 

</td>

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

<td align="center" width="50%">

 

 

 

 

 

 

<b>Prior</b>

 

 

 

 

 

 

</td>

 

 

 

 

 

 

<td align="center" width="50%">

 

 

 

 

 

 

<b>Current</b>

 

 

 

 

 

 

</td>

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

</table>

 

 

 

 

 

 

</HeaderTemplate>

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

<table id="Table2" cellspacing="1" cellpadding="1" width="260px" border="1">

 

 

 

 

 

 

<tr>

 

 

 

 

 

 

<td width="50%">

 

 

 

 

 

 

<asp:Label ID="lblPriorCount" runat="server" Text='<%# Eval("OpenItemsCountPrior") %>'></asp:Label>

 

 

 

 

 

 

</td>

 

 

 

 

 

 

<td width="50%">

 

 

 

 

 

 

<asp:Label ID="lblCurrentCount" runat="server" Text='<%# Eval("OpenItemsCountELD") %>'></asp:Label>

 

 

 

 

 

 

</td>

 

 

 

 

 

 

</tr>

 

 

 

 

 

 

</table>

 

 

 

 

 

 

</ItemTemplate>

 

 

 

 

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn HeaderText="Items Left to Pay" UniqueName="TotalRemainingItems" SortExpression="TotalRemainingItems">

 

 

 

 

 

 

<HeaderStyle Font-Bold="True" Width="100px" HorizontalAlign="Center" />

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

<asp:Label ID="lblPctComplete" runat="server" Text='<%# Eval("TotalRemainingItems") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

 

 

 

 

<ItemStyle HorizontalAlign="Right" ForeColor="Black" />

 

 

 

 

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridTemplateColumn HeaderText="% Complete" UniqueName="clmPctComplete">

 

 

 

 

 

 

<HeaderStyle Font-Bold="True" Width="100px" HorizontalAlign="Center" />

 

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

 

<asp:Label ID="lblPctComplete" runat="server" Text='<%# Eval("TotalRemainingItems") %>'></asp:Label>

 

 

</ItemTemplate>

 

 

 

 

 

 

<ItemStyle HorizontalAlign="Right" ForeColor="Black" />

 

 

 

 

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn DataField="AssigneeEmployeeKey" ReadOnly="True" UniqueName="AssigneeEmployeeKey"

 

 

 

 

 

 

Visible="False">

 

 

 

 

 

 

</telerik:GridBoundColumn>

 

 

 

 

 

 

</Columns>

 

 

 

 

 

 

</MasterTableView>

 

 

 

 

 

 

<HeaderStyle BorderStyle="Solid" />

 

 

 

 

 

 

 

<ClientSettings>

 

 

 

 

 

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" />

 

 

 

 

 

 

</ClientSettings>

 

 

 

 

 

 

</telerik:RadGrid>

 




Thanks
Kristi
Vasil
Telerik team
 answered on 26 Jul 2011
1 answer
103 views
Hey Telerik,

This isn't a huge thing, but I'm looking for a solution that is better than storing data inside of the AttributeCollection field. 

Basically, I do this:

//TODO: Make this obsolete. Somehow. Probably through thinking!
public void SetAttributes()
{
    Logger.InfoFormat("Setting Attributes for {0}: ", ID);
    Attributes["RefreshEnabled"] = RefreshEnabled.ToString();
    Logger.InfoFormat("RefreshEnabled: {0}: ", RefreshEnabled);
    Attributes["RefreshInterval"] = RefreshInterval.ToString();
    Logger.InfoFormat("RefreshInterval: {0}: ", RefreshInterval);
    Attributes["ChartType"] = ChartType.ToString();
    Logger.InfoFormat("ChartType: {0}: ", ChartType);
    Attributes["ReportType"] = ReportType.ToString();
    Logger.InfoFormat("ReportType: {0}: ", ReportType);
    Attributes["TimeRestrictionEnabled"] = TimeRestrictionEnabled.ToString();
    Logger.InfoFormat("TimeRestrictionEnabled: {0}: ", TimeRestrictionEnabled);
    Attributes["TimeStart"] = TimeStart.ToString();
    Logger.InfoFormat("TimeStart: {0}: ", TimeStart);
    Attributes["TimeEnd"] = TimeEnd.ToString();
    Logger.InfoFormat("TimeEnd: {0}: ", TimeEnd);
    Attributes["DataPointsEnabled"] = DataPointsEnabled.ToString();
    Logger.InfoFormat("DataPointsEnabled: {0}: ", DataPointsEnabled);
    Attributes["ReportID"] = Chart.ReportID.ToString();
    Logger.InfoFormat("ReportID: {0}: ", Chart.ReportID.ToString());
}

and then, for instance, when the user clicks a custom command on the RadDock which opens a RadWindow, I would like to populate the RadWindow with data about the RadDock.

As such, I store the fields in Attributes so that they are accessible client-side. 

//Opens a historical report settings window -- passing the known settings to it
//so that the window will show the proper data to the user.
function OnHistoricalLocalSettingsShow(sender, eventArgs) {
    var historicalAttributes = {};
    var radDockElement = radDock.get_element();
 
    historicalAttributes["RefreshEnabled"] = radDockElement.getAttribute("RefreshEnabled");
    historicalAttributes["RefreshInterval"] = radDockElement.getAttribute("RefreshInterval");
    historicalAttributes["ChartType"] = radDockElement.getAttribute("ChartType");
    historicalAttributes["TimeRestrictionEnabled"] = radDockElement.getAttribute("TimeRestrictionEnabled");
    historicalAttributes["TimeStart"] = radDockElement.getAttribute("TimeStart");
    historicalAttributes["TimeEnd"] = radDockElement.getAttribute("TimeEnd");
    historicalAttributes["DataPointsEnabled"] = radDockElement.getAttribute("DataPointsEnabled");
 
    sender.argument = historicalAttributes;
}

I find this slightly harder to maintain than I would like, though. There is no guarantee that the data being stored in the dock is current and up-to-date. I would like to be pulling the data from the RadDock's properties directly from client-side, or possibly posting an AJAX call to go fetch the data from the server on-demand.

I looked into this a bit and I read about Page Methods some. I'm not sure if this would be a better solution, though. So, I'm keeping my ears open for any other suggestions.

Just a thought :) Thanks.

Sean
Pero
Telerik team
 answered on 26 Jul 2011
7 answers
246 views
I have a radwindow that contains a grid.  Selecting an item in the grid activates a second radwindow that allows the selected grid item to be edited.  Clicking 'update' in the 2nd radwindow should close the window and rebind the grid in the first window.  I just cant get this to work, when ever I close the second window the refresh function never gets fired, heres my code

this activates the 2nd window from the grid in the first radwindow

function ShowEditForm(id, rowIndex) {
             
            var grid = $find("<%= RadGrid1.ClientID %>");
            var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
            grid.get_masterTableView().selectItem(rowControl, true);
            var oBrowserWnd = GetRadWindow().BrowserWindow;
            oBrowserWnd.radopen("BandMemberEditForm.aspx?ID=" + id, "BandMemberDialog");
            return false;
        }




this code should refresh the grid when the 2nd radwindow closes

function refreshGrid(arg) {
            //debugger;
            alert("refresh grid");
            if (!arg) {
                $find("<%= Telerik.Web.UI.RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("Rebind");
 
            }
            else {
                $find("<%= Telerik.Web.UI.RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("RebindAndNavigate");
 
 
            }
        }



in the 2nd radwindow, I have this code to close the window and rebind the grid in the first window

function CloseAndRebind(args) {
        alert("close and rebind");
        GetRadWindow().Close();
        //debugger;
        //var oWindow = GetRadWindow();
        GetRadWindow().BrowserWindow.refreshGrid(args);
    }


I know this function is called because of the alert, but the refreshGrid function never gets called

can anyone see what im doing wrong here ?
Marin Bratanov
Telerik team
 answered on 26 Jul 2011
2 answers
80 views
I have a panel bar on which i want to place a loading panel when an item is clicked.  It works fine as long as the item does not have any sub items in which case the loading panel is not covering the whole panel bar.  How can I solve this?

Jorge
Maria Ilieva
Telerik team
 answered on 26 Jul 2011
6 answers
872 views
Im working, in a Dynamics CRM customization, and I'm considering to use Telerik controls, but first I  would like to know If I can Include ASP.NET Ajax RadControls in this proyect, and If the radcontrols work fine with Dynamics CRM.


Many thanks, in advance, for your help.
Moises Rodriguez

Klibor
Top achievements
Rank 1
 answered on 26 Jul 2011
4 answers
114 views

I'm using RadHtmlField from Telerik.SharePoint.FieldEditor in my SharePoint site and make use of the Document Manager. When I've uploaded documents and then wish to select one, the list is not sorted. Should I add something to my ConfigFile.xml? It currently looks like this:

<configuration>
  <property name="AllowThumbGeneration">True</property>
  <property name="ConvertToXhtml">True</property>
  <property name="EnableDocking">False</property>
  <property name="ShowHtmlMode">False</property>
  <property name="ShowPreviewMode">False</property>
  <property name="StripAbsoluteAnchorPaths">true</property>
  <property name="StripAbsoluteImagesPaths">true</property>
  <property name="ToolbarMode">ShowOnFocus</property>
  <property name="ToolsWidth">100px</property>
  <property name="DocumentsPaths">
 <item>/Documents</item>
  </property>
  <property name="MaxDocumentSize">
 <item>20971520</item>
  </property>
  <property name="ImagesPaths">
    <item>PublishingImages</item>
    <item>/SiteCollectionImages</item>
  </property>

</configuration>

Stanimir
Telerik team
 answered on 26 Jul 2011
2 answers
98 views
Hello,

I have an existing master page that has worked without issue for a number of applications for a long time.

I (late to the party) added a RadAjaxLoadingPanel with a RadAjaxManager:

Navigating to a page with a RadGrid in the child page within the MainUpdatePanel, I see the Ajax loading image while the grid is waiting for results. However, when the grid finishes receiving the results (I think), I see a number of modal alerts with the following web page error:

Error: 'undefined' is null or not an object

This repeats then the page displays without any content rendered within the MainUpdatePanel area.

Clicking a RadMenu link in the header to navigate results in:

Error: Object required

Then navigation to the requested page proceeds with no other issue.

Can you help me to identify the cause? I have reproduced the issue with the following Master Page stripped of unnecessary items (no code-behind required).

Master Page

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="SiteMaster.master.cs" Inherits="SampleWebApplication.SiteMaster" %>
<%@ 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>
    <title>Test</title>
</head>
<body>
    <form id="MainForm" runat="server">
  
        <telerik:RadScriptManager ID="TelerikScriptManager" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
  
        <telerik:RadAjaxManager ID="TelerikAjaxManager" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="MainUpdatePanel">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="MainUpdatePanel" LoadingPanelID="TelerikAjaxLoadingPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
  
        <telerik:RadMenu ID="MajorNavMenu" runat="server">
            <CollapseAnimation Duration="200" Type="OutQuint" />
            <ExpandAnimation Type="None" />
            <Items>
                <telerik:RadMenuItem runat="server" NavigateUrl="~/Default.aspx" Text="Home"></telerik:RadMenuItem>
            </Items>
        </telerik:RadMenu>
  
        <asp:UpdatePanel ID="MainUpdatePanel" runat="server">
            <ContentTemplate>
  
                <asp:ContentPlaceHolder ID="MainContentPlaceHolder" runat="server">
                </asp:ContentPlaceHolder>
  
            </ContentTemplate>
        </asp:UpdatePanel>
  
        <telerik:RadAjaxLoadingPanel ID="TelerikAjaxLoadingPanel" runat="server">
        </telerik:RadAjaxLoadingPanel>
  
    </form>
</body>
</html>

Content Page

<%@ Page Title="Home" Language="C#" MasterPageFile="~/SiteMaster.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SampleWebApplication.Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
  
    <asp:Button 
        id="DoSearch" 
        runat="server" 
        Text="Search" 
        OnClick="DoSearch_OnClick" 
        Width="195">
    </asp:Button>
  
    <telerik:RadGrid ID="SearchResults" runat="server" AutoGenerateColumns="False" CellSpacing="0" GridLines="None">
        <MasterTableView DataKeyNames="TestValue">
            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
            </RowIndicatorColumn>
            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="TestValue" HeaderText="Test Value">
                </telerik:GridBoundColumn>
            </Columns>
            <EditFormSettings>
                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
        <FilterMenu EnableImageSprites="False">
        </FilterMenu>
        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
        </HeaderContextMenu>
    </telerik:RadGrid>
  
</asp:Content>

Content Page Code-behind

namespace SampleWebApplication
{
    using System;
  
    public partial class Default : System.Web.UI.Page
    {
        private readonly dynamic testData = new[]
        {
            new { TestValue = "Test Value 1" },
            new { TestValue = "Test Value 2" },
            new { TestValue = "Test Value 3" },
            new { TestValue = "Test Value 4" },
            new { TestValue = "Test Value 5" },
            new { TestValue = "Test Value 6" },
            new { TestValue = "Test Value 7" },
            new { TestValue = "Test Value 8" },
            new { TestValue = "Test Value 9" },
            new { TestValue = "Test Value 10" }
        };
  
        protected void DoSearch_OnClick(object sender, EventArgs e)
        {
            this.SearchResults.DataSource = testData;
            this.SearchResults.DataBind();
        }
    }
}

Thank you!

Richard
Maria Ilieva
Telerik team
 answered on 26 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?