Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
164 views
I'm using this example http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandsplitterresizing/defaultcs.aspx?product=splitter (Resizing RadGrid in RadSplitter) to help with resizing my RadGrid.  However, I'm getting the following javascript error: Line: 107
Error: 'null' is null or not an object

The error is occurring when it's trying to call the changepagesize function.

The grid and splitter on in a content page.  Any help would be appreciated.

ASPX
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadAjaxManagerProxy1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="ARGrid1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting>          
            <telerik:AjaxSetting AjaxControlID="rcbCodeList">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="rcbListType"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="rtbCode" /> 
                    <telerik:AjaxUpdatedControl ControlID="btnAddCode" /> 
                    <telerik:AjaxUpdatedControl ControlID="rlbCodes"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="rcbListType">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="rtbCode" /> 
                    <telerik:AjaxUpdatedControl ControlID="btnAddCode" /> 
                    <telerik:AjaxUpdatedControl ControlID="rlbCodes"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="btnAddCode">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="rtbCode"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                     <telerik:AjaxUpdatedControl ControlID="rlbCodes"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls>                  
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="ARGrid1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="ARGrid1"   
                        LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManagerProxy> 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">  
    </telerik:RadAjaxLoadingPanel> 
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
 
    </telerik:RadCodeBlock> 
           <script type="text/javascript">  
               function ClientResized(sender, eventArgs) {  
                   alert('in resize');  
                   var test = $find("<%= RadAjaxManagerProxy1.ClientID %>");  
 
                   alert('found proxy');  
                   $find("<%= RadAjaxManagerProxy1.ClientID %>").ajaxRequest('ChangePageSize');  
                   alert('changed size');  
                   //  if ($find("<%= RadAjaxManagerProxy1.ClientID %>").visible)  
                   // {  
                   //$find("<%= RadAjaxManagerProxy1.ClientID %>").ajaxRequest('ChangePageSize');  
                   //}  
               }  
        </script> 

 

<telerik:RadPane ID="gridPane" runat="server" Height="400px" Scrolling="None" OnClientResized="ClientResized">

 

 

<table border="0" width="986px" cellpadding="0" cellspacing="0" style="background-color:White;table-layout:fixed">

 

 

<tr valign="top">

 

 

<td width="15px"><img src="images/spacer.gif" width="15px" alt="" /></td>

 

 

<td style="height:400px;">

 

 

<table border="0" cellpadding="0" cellspacing="0" width="986px" style="background-color:White;table-layout:fixed" >

 

 

<tr>

 

 

<td>

 

 

<telerik:RadGrid ID="ARGrid1" runat="server" Width="95%" GridLines="None"

 

 

PageSize="50" AllowSorting="True" AllowPaging="True" Visible="false"

 

 

OnNeedDataSource="ARGrid1_NeedDataSource" ShowStatusBar="true" ShowGroupPanel="true" Skin="Outlook" >

 

 

<MasterTableView AllowFilteringByColumn="true" AllowMultiColumnSorting="true" Width="100%" CommandItemDisplay="None" AutoGenerateColumns="true">

 

 

 

<Columns>

 

 

</Columns>

 

 

</MasterTableView>

 

 

<ClientSettings AllowColumnsReorder="true" AllowDragToGroup="true" ColumnsReorderMethod="Reorder" >

 

 

<Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="false" FrozenColumnsCount="1" ScrollHeight="100%" />

 

 

<Resizing ClipCellContentOnResize="false" AllowColumnResize="true" />

 

 

</ClientSettings>

 

 

<GroupingSettings ShowUnGroupButton="true" />

 

 

</telerik:RadGrid>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</telerik:RadPane>

 


Server code:
       protected void RadAjaxManagerProxy1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)  
        {  
            switch (e.Argument.ToString())  
            {  
                case "ChangePageSize":  
                    //Calculate the number of rows that fit in the RadPane.  
                    //In this case 23 is the sum of the height of a single row and its upper border width.  
                    //Depending on the paticular scenario this value may vary.  
                    int rows = (Int32.Parse(this.gridPane.Height.Value.ToString()) - 60) / 23;  
                    if (rows >= 1)  
                    {  
                        ARGrid1.PageSize = rows;  
 
                        // Check whether the CurrentPageIndex is correct.  
                        if (Session["itemsCount"] != null)  
                        {  
                            int itemsCount = (int)Session["itemsCount"];  
                            int pageCount = (int)Math.Ceiling(((double)itemsCount / rows));  
                            if (ARGrid1.MasterTableView.CurrentPageIndex > pageCount - 1)  
                            {  
                                ARGrid1.MasterTableView.CurrentPageIndex = pageCount - 1;  
                            }  
                        }  
 
                        ARGrid1.Rebind();  
                    }  
                    break;  
            }  
        }  
 
        public string RadGrid1PanelClientID;  
 
        protected void RadAjaxManagerProxy1_AjaxSettingCreated(object sender, AjaxSettingCreatedEventArgs e)  
        {  
            if (e.Initiator.ID == "ARGrid1")  
            {  
                this.RadGrid1PanelClientID = e.UpdatePanel.ClientID;  
            }  
        } 
Michael
Top achievements
Rank 1
 answered on 17 Mar 2010
2 answers
210 views
I am having an issue with expanding a second detailtable in a RadGrid.  Whenever I try and expand the second level, the whole RadGrid collapses.  This also happens when expanding other rows from the MasterTableView.  I included snips below of the code.  Any help would be greatly appreciated.  In the code behind, please note that the GetSubmissionResults and the GetSubmissions are webservice calls. 

Thanks in advance.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server"   
            GridLines="None" AutoGenerateColumns="False" PageSize="20"   
            MasterTableView-Width="100%"   
            OnDetailTableDataBind="URLGrid_DetailTableDataBind" 
            Visible="True">  
    <MasterTableView ItemStyle-Width="100%" NoMasterRecordsText="No Results Found"   
            NoDetailRecordsText="No ResultsFound" Visible="true"   
            datakeynames="SubmissionGroupID" ExpandCollapseColumn-ItemStyle-BackColor="#CCCCCC">  
        <DetailTables> 
                <telerik:GridTableView DataKeyNames="SubmissionID" runat="server" Width="100%" Name="caseURLs">  
                    <DetailTables> 
                        <telerik:GridTableView runat="server" Name="caseDetails">  
                            <expandcollapsecolumn visible="True">  
                            </expandcollapsecolumn> 
                     <ParentTableRelation> 
                        <telerik:GridRelationFields DetailKeyField="SubmissionID" MasterKeyField="SubmissionID" /> 
                    </ParentTableRelation> 
                            <Columns> 
                            <telerik:GridBoundColumn DataField="SubmissionID" Visible="false">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn AllowSorting="false" DataField="SubmissionID"   
                                HeaderText="ID" ShowSortIcon="false" UniqueName="column">  
                            </telerik:GridBoundColumn> 
                            </Columns> 
                        </telerik:GridTableView>                      
                    </DetailTables> 
                 <expandcollapsecolumn visible="True"></expandcollapsecolumn> 
                <Columns> 
                        <telerik:GridBoundColumn AllowSorting="false" DataField="SubmissionID"   
                            HeaderText="ID" ShowSortIcon="false" UniqueName="column">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn AllowSorting="false" DataField="AbsoluteUrl"   
                            HeaderText="URL" ShowSortIcon="false" UniqueName="column">  
                        </telerik:GridBoundColumn> 
                </Columns> 
            </telerik:GridTableView> 
        </DetailTables> 
 
                <expandcollapsecolumn visible="True">  
                </expandcollapsecolumn> 
            <Columns> 
                <telerik:GridBoundColumn AllowSorting="false" DataField="SubmissionGroupID"   
                    HeaderText="Group" ShowSortIcon="false" UniqueName="column">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn AllowSorting="false" DataField="Baseline"   
                    HeaderText="Baseline" ShowSortIcon="false" UniqueName="column">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn AllowSorting="false" DataField="Description"   
                    HeaderText="Description" ShowSortIcon="false" UniqueName="column">  
                </telerik:GridBoundColumn> 
            </Columns> 
              
              
            <NoRecordsTemplate><div align="center">No Results Found</div></NoRecordsTemplate>  
            <expandcollapsecolumn visible="True">  
                <ItemStyle BackColor="#CCCCCC" /> 
            </expandcollapsecolumn> 
 
 
        <ItemStyle Width="100%" /> 
    </MasterTableView>      
    </telerik:RadGrid> 

Code Behind <snip> :

protected void URLGrid_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)  
    {  
        GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;  
          
        switch (e.DetailTableView.Name) {  
 
            case "caseURLs": {  
            int groupID = (int)dataItem.GetDataKeyValue("SubmissionGroupID");  
            submissionView = WebServiceClient.GetSubmissions(groupID);  
            e.DetailTableView.DataSource = submissionView;  
                break;  
            }  
 
            case "caseDetails": {  
                int detailsID = (int)dataItem.GetDataKeyValue("SubmissionID");  
            submissionResults = WebServiceClient.GetSubmissionResults(detailsID, ResultType.Passed);  
            e.DetailTableView.DataSource = submissionResults;  
                break;  
            }  
        }   
    }  
 

louis chan
Top achievements
Rank 1
Iron
 answered on 17 Mar 2010
4 answers
222 views
Hi,
    I used this example to customize the advanced form http://demos.telerik.com/aspnet-ajax/scheduler/examples/advancedformtemplate/defaultcs.aspx
  When opening a recurrence event or an all day event more than one time (open the advance form then close and then re-open), the recurrence checkbox is still checked, but it doesn't expand to show the recurrence options.  If it's an all day event, the all day checkbox is checked, but the Start Time and End Time are still shown up. 
Does anybody have a workaround for that?  It seems like it's a Javascript problem from the example.
Thank you
Mike
Top achievements
Rank 2
 answered on 17 Mar 2010
1 answer
107 views
Hi!

On your editor demo page if you click template manager the dialog shows the preview styled in default settings. This seems to be hardcoded styling in the template-html. Is there a way to use a css-file for this instead. Preferably the editor.CssFiles already loaded.

To clarify: I want the preview to be styled without having to do it inline in the template html.

Thanx

Rumen
Telerik team
 answered on 17 Mar 2010
1 answer
87 views
Hello,

I'm trying to buil a shceduler solution where one can choose a certain employee (row in timeline view) and when clicked the user would get redirected to AdvancedInsertTemplate where he/she could see a grid with a set of appointments for the day and could then add a comment.

I'm at a stage that I can get a RadGrid inside the AdvancedInsertTemplate and can view it if I hardcode the select command of the Sqldatasource to fill the grid. It happens that I need to pass the employeeID, StartDate and EndDate that is selected on the event of opening the AdvancedInsertTemplate. How can I get these properties and what event should I use.

I apreciate all the help.

Cheers.
Peter
Telerik team
 answered on 17 Mar 2010
1 answer
70 views
My Unique customer ID is: WT370784

When I create/update a new appointment i want to be able to start my edition
on more... menu, not in the small windown that the control first show?

PS:
When double-click cell appointments
This small window is used to enter the subject and by default have:
(Save / cancel / more) options

I want to be able to go directy to more window.

Best Regards.
Veronica
Telerik team
 answered on 17 Mar 2010
1 answer
122 views
I managed to install Radmenu in a Sharepoint Publishing site. I am not getting the submenu's though. Here is the code I use.

<telerik:RadMenu ID="RadMenu1"
                      runat="server"
                      DataSourceID="SiteMapDataSource1"
                      Skin="Simple" />
<PublishingNavigation:PortalSiteMapDataSource ID="SiteMapDataSource1"
                  Runat="server"
                  SiteMapProvider="GlobalNavSiteMapProvider"
                  EnableViewState="true"
                  StartFromCurrentNode="true"
                  StartingNodeOffset="0"
                  ShowStartingNode="false"
                  TreatStartingNodeAsCurrent="true"
                  TrimNonCurrentTypes="Heading"/> 

When I look into the code generated for the menu I see the submenu items are there. But nothing happens when I hover or click the top menu item.

What am I missing?.
Schlurk
Top achievements
Rank 2
 answered on 17 Mar 2010
1 answer
139 views
Hi,

I have the following contextmenu in my tools.xml.

<contextMenu forElement="INPUT">
      <tool Name="TextField"></tool>      
 </contextMenu>    

Is it possible to define that the contextmenu only should be visible if the input-element has text as its type?
Dobromir
Telerik team
 answered on 17 Mar 2010
1 answer
133 views
I've just installed RadControls 2010. However, they do not appear in my toolbox.
All the previous versions used to have an option to "register radControls in Visual Studio." This feature was really helpful, since for some reason, telerik controls would disappear from the toolbox once in a while.

This package doe not have such option. How can I add these controls to my toolbox?
Pavlina
Telerik team
 answered on 17 Mar 2010
3 answers
85 views

Hi,

I've a button and two RadMenus on my Page. The RadAjaxManager is telling to ajaxify the Menus when the button is clicked.

Why just one RadMenu is being ajaxified ??

        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" RestoreOriginalRenderDelegate="true"> 
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="US_IB"> 
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadMenu1" LoadingPanelID="" />  
                        <telerik:AjaxUpdatedControl ControlID="RadMenu2" LoadingPanelID="" />  
                </telerik:AjaxSetting>                                                                                                               
            </AjaxSettings> 
        </telerik:RadAjaxManager> 

Pavlina
Telerik team
 answered on 17 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?