Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
192 views
I have a user control which I use on mulitple pages. The user control contains a RadWindow, which contain a RadTabStrip and an asp:Panel. It also contains a custom control which outputs javascript necessary for the control. I've enclosed the entire contents of the RadWindow in an asp:Panel and used that panel to ajaxify the process. This all works great. When I click on the tabs the correct controls get loaded into the panel correctly, and the whole process seems to be ajaxified correctly (only the ajaxified panel is updated). Even the javascript code that is dynamically loaded with the user controls is executed (it's contained in RadScriptBlock). There's only one small problem: The javascript code that is output by the user control cwtg:ClientServerVariables is never updated! The code is output successfully when the control is initially loaded, and it always gets executed when a new control is loaded into the panel when a tab is clicked, but it's is always the original version of the code and doesn't contain any changes made during the postback!

I've stepped through my code, and I can actually see the updated javascript being output by the cwtg:ClientServerVariables control in its OnPreRender event handler, but that code never makes it back to the browser. If I comment out the RadAjaxManagerProxy in the control below, the javascript changes DO make it to the browser, but that destroys the nice ajaxification of the window!

So my question is: What is there about using the RadAjaxManager that causes the javascript output by my ClientServerVariables control to not be updated, when everything else in the ajaxified panel IS updated. Does it have to do with WHEN I am outputting the javascript (OnPreRender)?

FYI, I have tried outputting the javascript in all of the following ways. In none of them does the javascript contain the updated data:
1) Insert the javascript into an existing RadScriptBlock as a new literal control (as is done below).
2) Create a new RadScriptBlock and insert the javascript code into that as a new literal control.
3) Write out the javascript code "inline" by creating a literal control and inserting the javascript into that.
4) Register the javascript code using ClientScript.RegisterStartupScript
5) Register the javascript code using RadAjaxManager.ResponseScripts.Add

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="TicketDetailPopup.ascx.vb" Inherits="Controls_TicketDetailPopup" %>
<%@ Register Assembly="ClientServerVariables" Namespace="CWTG.WebControls" TagPrefix="cwtg" %>
 
<%@ Reference Control="~/Controls/dtlLocateRaw.ascx" %>
 
<telerik:RadAjaxManagerProxy runat="server" ID="rampTicketDetail">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="pnlWindowContent">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="pnlWindowContent" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
<telerik:RadWindow ID="rwTicketDetail" runat="server" Width="900px" Height="600px" Modal="False" AutoSize="False" KeepInScreenBounds="true"
    Skin="WebBlue" Title="Polaris Workforce Web Ticket" VisibleStatusbar="False" CssClass="rwTicketDetail" ShowContentDuringLoad="false"
    Behaviors="Resize, Close, Minimize, Move, Reload" OnClientShow="radWinShow" OnClientClose="radWinClosed"
    OnClientResizeEnd="radWinResizeEnd" OnClientDragEnd="radWinDragEnd" OnClientCommand="radWinCommand" >
    <ContentTemplate>
        <asp:Panel ID="pnlWindowContent" runat="server" Width="100%" Height="400">
            <telerik:RadTabStrip ID="rtsTicketDetail" runat="server" CssClass="rtsTicketDetail"  OnClientTabSelecting="rtsTabSelecting"
                SelectedIndex="-1" ClickSelectedTab="True" Skin="WebBlue" ScrollChildren="true" PerTabScrolling="true" ScrollButtonsPosition="Middle">
            </telerik:RadTabStrip>
            <asp:Panel ID="pnlDetailControl" runat="server" ViewStateMode="Disabled" Width="100%" Height="352">
            </asp:Panel>
            <cwtg:ClientServerVariables runat="server" ID="tdClientServerVars" ClientNamespace="ClientServerVars.DetailPopup" RenderClientVarsAs="SubControl" ControlID="rsbClientServerVars" DebugMessagesAs="Alert">
            </cwtg:ClientServerVariables>  
            <telerik:RadScriptBlock ID="rsbClientServerVars" runat="server"></telerik:RadScriptBlock>
            <telerik:RadScriptBlock runat="server">
                <script type="text/javascript">
                    $(document).ready(function() {
//                      console.log(ClientServerVars.DetailPopup.ClientIDs);
                    });
                </script>
            </telerik:RadScriptBlock>
        </asp:Panel>
    </ContentTemplate>
</telerik:RadWindow>
Mike
Top achievements
Rank 1
 answered on 16 Sep 2011
9 answers
410 views
I'm having a RadGrid with two columns which need to display custom Aggregate result.$0$0$0$0In RadGrid each column with Aggregate = "Custom" column triggers event OnCustomAggregate and passes GridCustomAggregateEventArgs object to it. $0$0$0$0$0However I couldn't find any property within GridCustomAggregateEventArgs object that would allow me to distinguish between several columns within one GridItem. $0$0It only contains a reference to the current GridItem object but not a particular cell within it which actually triggers the call. $0$0Is there still any way to know within the event handler to know which column the current aggregate=custom call refers to?$0$0$0$0$0$0Protected Sub rgSummary_CustomAggregate(ByVal sender As System.Object, ByVal e As Telerik.Web.UI.GridCustomAggregateEventArgs) Handles rgSummary.CustomAggregate$0$0...........................$0$0    End Sub$0$0$0End Class$0$0
Marc Fearby
Top achievements
Rank 1
 answered on 15 Sep 2011
3 answers
149 views
I have created a series of RadGrids dynamically from a SQL Datasource.  The grid is a list of reports with information pertaining to each report (format, frequency, published date).  I need to add a NestedViewTemplate to each row so that I can also display the report description.  

All this worked fine when declaring the RadGrid in the .ascx and then binding in code behind.  Using those grids as templates I removed the declarations, inserted a placeholder and started creating the grids dynamically. That also worked fine.   It only goes haywire when i try to add a NestedViewTemplate.  Basically what happens is that though there are 4 columns defined for the list, it renders a 5th with no content and causes the defined columns to shift left by one.  Can anyone tell me what I'm doing wrong? Here's the code:

//Create Grid object
var rgReport = new Telerik.Web.UI.RadGrid
{
    CssClass = css,
    Width = Unit.Percentage(100),
    PageSize = 5,
    AllowPaging = true,
    AllowSorting = true,
    AutoGenerateColumns = false,
    DataSource = dataSource,
    ID = itemName
};
 
//Nested template
rgReport.MasterTableView.NestedViewTemplate = new EeisNestedTemplate();
rgReport.MasterTableView.NestedViewSettings.DataSourceID = "Description";
 
// ReportName column
GridHyperLinkColumn reportName = new GridHyperLinkColumn
{
    DataTextField = "ReportName",
    HeaderText = "Report Name",
};
var landingURL = new string[1];
landingURL[0] = "LandingPageUrl";
reportName.DataNavigateUrlFields = landingURL;
reportName.DataNavigateUrlFormatString = "{0}";
reportName.HeaderStyle.Width = Unit.Pixel(340);
reportName.HeaderStyle.Wrap = true;
 
// Report Format
GridBoundColumn reportFormat = new GridBoundColumn
{
    HeaderText = "Format",
    DataField = "Format"
};
reportFormat.HeaderStyle.Width = Unit.Pixel(66);
reportFormat.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
 
// Report Frequency
GridBoundColumn reportFrequency = new GridBoundColumn
{
    HeaderText = "Frequency",
    DataField = "Frequency"
};
reportFrequency.HeaderStyle.Width = Unit.Pixel(80);
 
 
// Report Publish Date
GridBoundColumn reportPublishedDate = new GridBoundColumn
{
    HeaderText = "Published",
    DataField = "Published",
    DataFormatString = "{0:MM/dd/yyyy}"
};
reportPublishedDate.HeaderStyle.Width = Unit.Pixel(70);
 
//Pager Template
rgReport.MasterTableView.PagerTemplate = new EeisPagerTemplate { itemCount = dataSource.Count };
rgReport.MasterTableView.PagerStyle.AlwaysVisible = true;
rgReport.MasterTableView.PagerStyle.Mode = GridPagerMode.NumericPages;
rgReport.MasterTableView.PagerStyle.PageButtonCount = 3;
 
 
 
//Misc Properties
rgReport.MasterTableView.ID = "MasterView" + reportCategoryCount.ToString();
rgReport.MasterTableView.HierarchyDefaultExpanded = false;
 
//Add columns
rgReport.MasterTableView.Columns.Add(reportName);
rgReport.MasterTableView.Columns.Add(reportFormat);
rgReport.MasterTableView.Columns.Add(reportFrequency);
rgReport.MasterTableView.Columns.Add(reportPublishedDate);
 
return rgReport;

And the Template Class:
internal class EeisNestedTemplate : ITemplate
{
    protected Literal nestedContent;
    protected Panel headerObj;
    public string description { get; set; }
 
    public void InstantiateIn(System.Web.UI.Control container)
    {
        headerObj = new Panel();
        headerObj.ID = "panel" + Guid.NewGuid().ToString();
        nestedContent = new Literal();
        nestedContent.ID = "literal" + Guid.NewGuid().ToString();
        nestedContent.Text = "Report Description";
 
        headerObj.Controls.Add(nestedContent);
        container.Controls.Add(headerObj);
    }
}

Thanks!
Chris
Top achievements
Rank 1
 answered on 15 Sep 2011
1 answer
240 views

Not sure how to interpret this error... I'm getting it at runtime.  I recently upgraded the RadControls non-AJAX framework to the AJAX framework. 

FYI: these are the dlls we were using, if that gives you any clue, but they are now removed. 

If you need me provide anymore info, just ask.

C:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadAjax.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadCalendar.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadComboBox.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadEditor.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadGrid.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadInput.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadMenu.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadSpell.NET2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadSplitter.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadTabStrip.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadToolbar.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadTreeView.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadUpload.Net2.dll
C
:\source\clients\web\framework\_base\docs\admin\references\Telerik\RadWindow.Net2.dll

------------------------------------
Runtime Error:

Server Error in '/' Application.

Compilation Error

 

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30009: Reference required to assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' containing the implemented interface 'System.Web.UI.IScriptControl'. Add one to your project.

Source Error:

Line 43:         Private Shared __initialized As Boolean
Line 44:         
Line 45: Private Shared __BuildControl__control2_skinKey As Object = System.Web.UI.PageTheme.CreateSkinKey(GetType(Telerik.Web.UI.RadEditor), "")Line 46:         
Line 47:         Private Shared __BuildControl__control5_skinKey As Object = System.Web.UI.PageTheme.CreateSkinKey(GetType(Telerik.Web.UI.RadEditor), "MinimalSetOfTools")

Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\d1181b04\d55e5605\App_Theme_Default.9qs9avxh.0.vb    Line: 45


 

 

 


Version Information: Microsoft .NET Framework Version:2.0.50727.3623; ASP.NET Version:2.0.50727.3618

 

..... some of the code above in the error is not visible.  Use this for more readability:

Line 43:         Private Shared __initialized As Boolean
Line 44:        
Line 45:         Private Shared __BuildControl__control2_skinKey As Object = System.Web.UI.PageTheme.CreateSkinKey(GetType(Telerik.Web.UI.RadEditor), "")
Line 46:        
Line 47:         Private Shared __BuildControl__control5_skinKey As Object = System.Web.UI.PageTheme.CreateSkinKey(GetType(Telerik.Web.UI.RadEditor), "MinimalSetOfTools")

newb
Top achievements
Rank 1
 answered on 15 Sep 2011
1 answer
69 views
The combo box does not size the scrollable area of the box to fit within the visible area of the browser.  This means that when you open the list, you can have to scroll the page just to see the other end of the list.  Especially annoying if you have a lot of items in the combo box since it can make some items inaccessible without resizing the browser window.

It also doesn't detect the best direction to expand the box based on proximity to the browser window edge.

This is with EnableScreenBoundaryDetection set to true.
Kalina
Telerik team
 answered on 15 Sep 2011
4 answers
336 views
We are trying to use the new functionality in Telerik Radcombobox  to be able to accomplish multi select functionality with checkboxes. Is there a property / code sample that would allow us to Select All checkboxes.

For example: if we have a multi select combo box loaded with states. We want the client to be able to select multiple states. If the client wants to select all of the states, checking 50+ check boxes will be a lot more work than having one select all check box, that would let them select all of them.

Thanks
Chandra
Kalina
Telerik team
 answered on 15 Sep 2011
1 answer
220 views
Hi,
  I have a asp.net page that has a grid on it.  This grid is refreshed peridodically via a RadXMLHttpPanel.  The problem is that I need this auto refresh to stop when session state ends and redirect to a login page...however the auto refresh mechanism keeps the session state alive.  I thought the Ajax controls bypassed part of page life cycle and session state would expire...but it appears to be doing a full postback?  How can I get a partial page update without keeping session state alive?...and ultimately once session state is dead then to redirect to another page...Below is my script code that starts the refresh based on a js timer...

//js script
function startWorklistRefresh() {
                if (wlIntervalId == 0) {
                    wlIntervalId = setInterval("reloadWorklist();", wlCtrlAutoRefreshRate);
                }
               }
 
            function reloadWorklist() {
                $find("<%= XmlGridPanel.ClientID %>").set_value("Reload");
            }
 
            function GridXmlPanel_OnResponseEnded(sender, args) {
                startWorklistRefresh();
            }
 
//aspnet markup...
 <telerik:RadXmlHttpPanel ID="XmlGridPanel" runat="server" OnServiceRequest="GridXmlPanel_OnServiceRequest"
            OnClientResponseEnded="GridXmlPanel_OnResponseEnded" EnableClientScriptEvaluation="true">
            <telerik:RadGrid id="GridWorklist" runat="server" SkinID="main" GridLines="None" style="outline: none;" OnItemCreated="GridWorklist_ItemCreated" OnItemDataBound="GridWorklistt_ItemDataBound">...
 
And the xml panel event on the server side...
 protected void GridXmlPanel_OnServiceRequest(object sender, RadXmlHttpPanelEventArgs e)
        {
            GridWorklist.DataSource = RadTechData.GetWorklist(AppUtils.CurrentFacilityID);
            GridWorklist.DataBind();
        }
Pero
Telerik team
 answered on 15 Sep 2011
1 answer
277 views
I've been following the instructions on this page to get Telerik controls working in a SharePoint WebPart. I'm getting an error on the following line in the OnInit method:
this.Page.Form.Controls.AddAt(0, scriptManager);
The error says:
"The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases."
I reckon the RadScriptManager could be added to the masterpage, but because it is a WebPart we're building we'd much prefer to keep it as a self-contained object. Anyway, it looks like the example code isn't really valid. Am I missing something?
Eraph
Top achievements
Rank 1
 answered on 15 Sep 2011
1 answer
504 views
In RadGrid control, you can add DetailTables.

By default, the html generated out of this added DetailTable contains <colgroup> and <thead> elements.

I'd need to remove these 2 elements and currently I'm using JQuery on the client side:

thisNestedTable.find('> thead,> colgroup').remove();

How to achieve this from the server side? Does GridTableView support this to exclude these 2 elements from the generated html?

I'd need this asap so would really appreciate it if you could respond quickly.
Galin
Telerik team
 answered on 15 Sep 2011
1 answer
95 views
Hi

I have a radscheduler in a weekday view. When the user clicks in the weekday name the radscheduler render all the appointments for that day, eg, if I click in "Tuesday" the form makes a postback and automatically displays the events only for "Tuesday". How can I detect this event? I wish to save in a state variable if the user is seeing the whole week or only one day


Thanks
Regula
Top achievements
Rank 1
 answered on 15 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?