Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
120 views
asdf
Veronica
Telerik team
 answered on 28 Apr 2011
2 answers
211 views
Hi, I am facing a issue to find the ChildItem of the parent grid in ItemCreated event of Child grid after doing paging or filtering or sorting on parent grid.
Here is my code of OnNeedDataSource for Parent Grid :
public void GetInProcessData(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
    EffortCertificationList effortCertifications = new EffortCertificationList();
    if (Session["IPEffortCertifications"] != null)
    {   effortCertifications = (EffortCertificationList)Session["IPEffortCertifications"];  }
    else
    {   effortCertifications.CurrEmployee = Session["currEmployee"].ToString();
        effortCertifications.Load("InProcess");
        Session["IPEffortCertifications"] = effortCertifications;
    }
   grdInProcess.DataSource = effortCertifications;
}

Here is my code of OnNeedDataSource for Child Grid which is in NestedViewTemplate :
protected void GetInProcesDetails(object source, GridNeedDataSourceEventArgs e)
{
                GridDataItem parentItem = ((source as RadGrid).NamingContainer as GridNestedViewItem).ParentItem as GridDataItem;
                string _employeeId = parentItem.GetDataKeyValue("Employee").ToString();
                Label lblBeginDate = (Label)parentItem.FindControl("lblIPStartDate");
                Label lblEndDate = (Label)parentItem.FindControl("lblIPEndDate");
                EffortCertificationList objeffortCertifications = new EffortCertificationList();
               if (Session["IPEffortCertifications"] != null)
               {
               objeffortCertifications = (EffortCertificationList)Session["IPEffortCertifications"];
               var effortDetails = from ec in objeffortCertifications
                                            where ec.Employee == _employeeId && ec.CertPeriodStartDate ==                                          Convert.ToDateTime(lblBeginDate.Text) && ec.CertPeriodEndDate == Convert.ToDateTime(lblEndDate.Text)
                                            select ec;
               EffortDetailList objEffortDetails = new EffortDetailList();
               foreach (var ed in effortDetails)
               {
                       objEffortDetails = ed.Details;
               }
               (source as RadGrid).AllowFilteringByColumn = false;
               (source as RadGrid).DataSource = objEffortDetails;
    }
 protected void grdInProcesDetails_ItemCreated(object sender, GridItemEventArgs e)
 {
       if (e.Item is GridDataItem)
       {
                GridDataItem item = (GridDataItem)e.Item;
                GridDataItem parentItem = ((sender as RadGrid).NamingContainer as GridNestedViewItem).ParentItem as GridDataItem;
                if (parentItem != null && parentItem.ChildItem !=null)
                {   string _employeeId = parentItem.GetDataKeyValue("Employee").ToString();
                    CheckBox chkIPReviewed = parentItem.ChildItem.FindControl("chkInProcessReviewed") as CheckBox;
                }
     }
}

Here in this event parentItem.ChildItem is null because of which i could not add attribute for calling javascript funcation for chkIPReviewed control. This is happening only after paging or sorting or filtering.
I am using client side function to expand or collapse for showing the Inner grid which is present in Nesstedviewtemplate.

Please provide me a solution.

Thanks in advance
MadhuSudhan
Top achievements
Rank 1
 answered on 28 Apr 2011
2 answers
116 views
Hi,

I'm trying to do "Grid / Self-referencing Hierarchy"
http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/selfreferencing/defaultvb.aspx
But display "No child records to display." and repeat the herarquical data??

    Column1            Column2
v    Reg1name            value1
    No child records to display.
v    Reg2name            value2
    No child records to display.
v    Reg3name            value3
    v Reg31name         value31            <--herarquical data relation
        No child records to display.
    v Reg32name         value32     
        No child records to display.
v   Reg31name         value31            <-- Again!...
    No child records to display.
v   Reg32name         value32   
    No child records to display.
v    Reg4name            value4
    No child records to display.
....      

miguel
Top achievements
Rank 1
 answered on 27 Apr 2011
3 answers
539 views
Hi:

I have a long running process that I placed a Loading Panel on the form, but if it take say 92 seconds, it throws the following exception:
  Microsoft JScript runtime error:
  Sys.WebForms.PageRequestManagerTimeoutException: The server request timed out.
How can I set the timeout?

Phil
Rhonda
Top achievements
Rank 1
 answered on 27 Apr 2011
1 answer
79 views
How can I apply the same CSS style that is being used by my Rad Controls onto another control like a asp:label? Ex. I have all of my Rad controls set to use the Black skin and I want all of my standard asp:labels to have the same text/font/etc that is being used by Rad-Slider
Matt
Top achievements
Rank 1
 answered on 27 Apr 2011
6 answers
85 views
Hi,

i am new to telerik. I have built a user control with the following code:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" Codebehind="WebUserControl.ascx.cs" ClassName="WebUserControl" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
<asp:SqlDataSource ID="GridSource" runat="server" ConnectionString="<%$ ConnectionStrings:Test%>" SelectCommand="SELECT * FROM Evt"> </asp:SqlDataSource>
 
<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0"
        DataSourceID="GridSource" AllowFilteringByColumn="True" AllowPaging="True"
        AllowSorting="True" ShowGroupPanel="True">
        <ClientSettings AllowDragToGroup="True">
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>
    <MasterTableView>
        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
 
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
 
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
        </EditFormSettings>
    </MasterTableView>
 
    <FilterMenu EnableImageSprites="False"></FilterMenu>
 
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
</telerik:RadGrid>
  
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid1"
                    LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
 </telerik:RadAjaxManager>
When i put it in a content tag in my html code it works fine. But i would like to add the control via a click on a button.
So on the page where the button is located i wrote the following in the code behind:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class SiteMaster : System.Web.UI.MasterPage
{
    WebUserControl ctrl;
 
    protected void Page_Load(object sender, EventArgs e)
    {
            Button BTN1 = new Button();
            BTN1.Click += new EventHandler(BTN_Click);
 
            this.MenuContent.Controls.Add(BTN1);
    }
    protected void BTN_Click(object sender, EventArgs e)
    {
        ctrl = (WebUserControl)LoadControl("~/WebUserControl.ascx");
        this.MenuContent.Controls.Add(ctrl);
    }
}
Has anybody an idea why this doesn't work or a solution so ajax functionality will be enabled for this purpose?

Thanks
Simon
Pavlina
Telerik team
 answered on 27 Apr 2011
13 answers
220 views
Hi,
I am using Rad Calender inside a  Repeater.

<asp:Repeater ID="ResultRpt" runat="server">
 <ItemTemplate>
 <telerik:RadCalendar Style="width: 191px; height: 123px" ID="RadCalendar1" runat="server"
  EnableMonthYearFastNavigation="false" AutoPostBack="true" MultiViewColumns="1"
  MultiViewRows="1" EnableMultiSelect="true">
  </telerik:RadCalendar>
<telerik:RadToolTipManager Width="270px" Height="135px" Style="font-size: 11px" RelativeTo="Element"
  ID="RadToolTipManager1" runat="server" OffsetX="7" Position="MiddleRight"   OnAjaxUpdate="RadToolTipmanager1_AjaxUpdate"  Skin="Telerik" AutoCloseDelay="90000"                            </telerik:RadToolTipManager>
  </ItemTemplate>
  </asp:Repeater>

this is my  rad ajax manager

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
       <AjaxSettings>
           <telerik:AjaxSetting AjaxControlID="RadCalendar1">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="RadCalendar1"    LoadingPanelID="RadAjaxLoadingPanel1">
                   </telerik:AjaxUpdatedControl>
               </UpdatedControls>
           </telerik:AjaxSetting>
              <telerik:AjaxSetting AjaxControlID="calMarker">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="RadCalendar1"    LoadingPanelID="RadAjaxLoadingPanel1">
                   </telerik:AjaxUpdatedControl>
                   <telerik:AjaxUpdatedControl ControlID="calMarker" LoadingPanelID="RadAjaxLoadingPanel1">
                   </telerik:AjaxUpdatedControl>
               </UpdatedControls>
           </telerik:AjaxSetting>
            </AjaxSettings>
       <ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />
   </telerik:RadAjaxManager>
   <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="WebBlue" />

The tool tip on the date is not working . And the loading panel is not working for the onclick on the rad calender(instead the page is postbacking) .

The calmarker control is a panel bar which is also inside the repeater its loading panel is also not working .

These was working when there was no repeater. After i put the repeater control the issue started.

Regards
Sankardeep

Rob Caruk
Top achievements
Rank 1
 answered on 27 Apr 2011
6 answers
608 views
Hi,

I have a Page Controller design pattern, so I have a base Page class that defines and dumps out a RadAjaxManager control. The (edited) base class is:

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Web; 
using System.Xml; 
using xxx.yyy.ASPNET.Security; 
using xxx.yyy.Client; 
using xxx.yyy.Client.Security; 
using xxx.yyy.Core; 
using Telerik.Web.UI; 
 
namespace xxx.yyy.ASPNET 
    public class AuthenticatedyyyPage : yyyPageBase 
    { 
        private RadAjaxManager _radAjaxManager=null
        #region ~ Properties ~ 
 
        public RadAjaxManager AjaxManager 
        { 
            get { return _radAjaxManager; } 
        } 
        #endregion 
 
        protected override void OnLoad(EventArgs e) 
        { 
            // set up global AJAX Manager 
            _radAjaxManager = BuildRadAjaxManager(); 
            Form.Controls.Add(_radAjaxManager); 
 
            if (!ClientScript.IsClientScriptBlockRegistered(_radAjaxManager.ClientID)) 
            { 
                ClientScript.RegisterClientScriptBlock(_radAjaxManager.GetType(), _radAjaxManager.ClientID,GenerateJavascript(),true); 
            } 
             
 
            base.OnLoad(e); 
        } 
 
        protected virtual RadAjaxManager BuildRadAjaxManager() 
        { 
            RadAjaxManager radAjaxManager = new RadAjaxManager(); 
            radAjaxManager.ID = "radAjaxManager";    
            return radAjaxManager; 
        } 
 
        private string GenerateJavascript() 
        { 
            StringBuilder sb = new StringBuilder(); 
 
             
 
            sb.Append("\n\nfunction migGetRadAjaxManager() {\n"); 
            sb.Append("\tvar ajaxManager=$find(\"" + _radAjaxManager.ClientID + "\");\n"); 
            sb.Append("\treturn ajaxManager;\n"); 
            sb.Append("}\n\n"); 
 
 
            return sb.ToString(); 
        } 
    } 
 
 

(The RadAjaxManager is added into the Form and appears in the rendered HTML)

In the derived page, I want to add an AjaxSetting programmatically (as per http://www.telerik.com/help/aspnet-ajax/ajxaddajaxsettingsprogrammatically.html) in the Page_Load():

protected void Page_Load(object sender, EventArgs e) 
        { 
            AjaxManager.AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(AjaxManager_AjaxRequest); 
             
            AjaxManager.AjaxSettings.AddAjaxSetting(btnCancel0, pnlScriptInjector); 
             
        } 

But this results in the exception:

Object reference not set to an instance of an object.
AjaxManager.AjaxSettings.AddAjaxSetting(btnCancel0, pnlScriptInjector); 
             

   at Telerik.Web.UI.AjaxSettingsCollection.AddAjaxSetting(Control ajaxifiedControl, Control updatedControl) 
   at xxx.yyy.ASPNET.Presentation.Secure.Admin.ImportWindowsUsers.Page_Load(Object sender, EventArgs e) in c:\dev2008\yyy2\yyy_WEB\secure\admin\ImportWindowsUsers.aspx.cs:line 128 
   at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) 
   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) 
   at System.Web.UI.Control.OnLoad(EventArgs e) 
   at xxx.yyy.ASPNET.yyyBase.OnLoad(EventArgs e) in C:\dev2008\yyy2\xxx.yyy.ASPNET\yyyPageBase.cs:line 45 
   at xxx.yyy.ASPNET.Authenticatedyyy.OnLoad(EventArgs e) in C:\dev2008\yyy\xxx.yyy.ASPNET\AuthenticatedyyyPage.cs:line 138 
   at System.Web.UI.Control.LoadRecursive() 
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 

Inspecting the variables in the debugger and I can't see anything that is null.

Could you please tell me why is this happening? Am I using it right?

Jack
Top achievements
Rank 1
 answered on 27 Apr 2011
4 answers
259 views
Happy Monday, everyone!

Our users have requested that when we use the RadListBox with CheckBoxes that when they click on a checkbox that the entire row become focused - like it does when they click on the text of a row.

I've tried setting focus manually in the ItemChecked event with the following but no matter what I do I can't get this accomplished.
event.get_item().select();
event.get_item().get_element().focus();

Anyone managed to get this working?

Thanks!
Thad
Thad
Top achievements
Rank 2
 answered on 27 Apr 2011
2 answers
67 views
Hi,
  I'm not able to start_edit() a new node at the 2nd Level client-side if the parent node does not have any child previously and this is the only child.

Below is the code I've written to add a new node.

                function AddNode(parentNode)
                {
                    var tree = parentNode.get_treeView();
                    tree.trackChanges();
                    var node = new Telerik.Web.UI.RadTreeNode();
                    node.set_text("New Node");
                    node.set_value("New Node");
                    parentNode.get_nodes().add(node);
                    node.select();
                    tree.add_nodeEdited(NodeAdded);
                    tree.commitChanges();
                    node.startEdit();
                }


at the node.startEdit() statement it throws an error as: "htmlfile: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus."


Please note that the ExpandMode of the Nodes are "WebService"

-Himanshu

Himanshu
Top achievements
Rank 1
 answered on 27 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?