Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
109 views
I am adding my field editors in code behind in Page_Init on every post pack (per the documentation). Some of the field editors are custom types. When I select the field associated with a custom editor, I get the following error:

Server Error in '/' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.RadFilterDataFieldEditor.CreateEditorFrom(RadFilterDataFieldEditor baseEditor) +110
   Telerik.Web.UI.RadFilterDataFieldEditorCollection.RetrieveEditorForFieldName(String fieldName) +68
   Telerik.Web.UI.RadFilter.ChangeExpressionFieldName(RadFilterSingleExpressionItem item, String fieldName) +124
   Telerik.Web.UI.RadFilterCommandEventArgs.ExecuteCommand(Object source) +1277
   Telerik.Web.UI.RadFilter.OnBubbleEvent(Object source, EventArgs args) +219
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.Web.UI.RadFilterExpressionItem.OnBubbleEvent(Object source, EventArgs args) +120
   Telerik.Web.UI.RadFilterExpressionItem.FireCommandEvent(String commandName, Object commandArgument) +88
   Telerik.Web.UI.RadFilter.HandleClientCommand(String commandName, String commandArgs) +791
   Telerik.Web.UI.RadFilter.RaisePostBackEvent(String eventArgument) +127
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9642338
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18045



My custom rad filter field editor types are created like the example in the documentation. While debugging, none of the overridden methods in my custom editor are ever called.

I am using the latest 2013 Q2 release for .NET 4.5
Kyle Smith
Top achievements
Rank 1
 asked on 03 Jul 2013
2 answers
175 views
for editing appointments,
the function:
            function AppointmentEditing(sender, eventArgs) 
            { 
                
                var apt = eventArgs.get_appointment(); 
                alert(apt.ID); 
                window.radopen("AdvancedFormCS.aspx?Mode=Edit&AppointmentId=" + apt.ID, "AdvancedForm"); 
 
                eventArgs.set_cancel(true); 
                currentApt = null
            }
 
the apt.ID returns undefined.
I started debugging and tracing the javascript and it seems the value is instead,
apt._id
is this correct?

it gives me the right id, just don't see this documented anywhere and apt.ID is undefined.
my page is inside a master page.

want to make sure we are using the right values.
I'm using: Telerik.Web.UI Trial Version 2008.1.401.20


David
Top achievements
Rank 1
 answered on 02 Jul 2013
3 answers
140 views
Hello,

Have a treeview and multiple nodes selected.

On server side click of context menu can not get the treeview selected nodes as always returns a count of 0.
How can I get the selected nodes to apply the context menu command to each?

Example: 
select 3 nodes and context menu command "Copy"
on server side can only ever access the node via RadTreeViewContextMenuEventArgs node

Need to be able to loop and do the "Copy" command on the 3 selected nodes...

Thanks,

Marc Cramer
cramer
Top achievements
Rank 1
 answered on 02 Jul 2013
2 answers
113 views

 I have a requirement to put multiple series into a chart. Each series should have a label & the item in the series should also have a label on the x-axis.
 I cannot find any samples that would help me with this and have been banging my head at it for the day.

 I've attached a sample of what our graph should look like. Any help on this would be great!


Thanks
Jeff
Top achievements
Rank 1
 answered on 02 Jul 2013
2 answers
114 views
I'm trying to create a Gantt chart out of the HtmlChart controls.

Is there any way to rotate the Candlestick horizontally.
The Bar Chart only takes a CategorySeriesItem that extends SingleValueSeriesItem.
  - Is there a way to extend this and y2?



Thanks
Steve
Steve
Top achievements
Rank 1
 answered on 02 Jul 2013
2 answers
182 views
Dears,

I am using HtmlChart and encounter some problems.
(1).I try to create series from the data table by creating SeriesItem which needs X and Y values. I saw the item must be decimal but actually my data is X:datetime, and Y:Decimal type. How to create the X value by datetime or even the string value?

ScatterLineSeries series1 = new ScatterLineSeries();
                series1.Name = "date_time";
                series1.LabelsAppearance.Visible = false;

foreach (DataRow row in MyDataTable.Rows)
                {
                    string xx = "traffic_erlang";
                    SeriesItem item1 = new SeriesItem( 100,(decimal)row[xx]); //I put the static value 100 as I don't know how to put the datetime/string
                   
                    series1.Items.Add(item1);

              RadHtmlChart1.PlotArea.Series.Add(series1);
                    RadHtmlChart1.PlotArea.Series.Add(series2);
                    
                }

(2).Do we have any other ways to bind data from datatable by grouping the fields so the dynamic series will be created.
example:
--------------------------
ID | Name | Value
--------------------------
1 | ABC | 200
2 | GED | 340
...... which Name is the dynamic data
Tony
Top achievements
Rank 1
 answered on 02 Jul 2013
3 answers
826 views
I have a simple upload page that runs fine locally on my dev box but throws a nasty 500 error on the server, I have set the upload folder permissions to allow full control to everyone--any ideas?

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">

        <link href="Upload.css" rel="Stylesheet" type="text/css" />
        <script type="text/javascript">
            //<![CDATA[
            function validationFailed(sender, eventArgs) {
                $(".ErrorHolder").append("<p>Validation failed for '" + eventArgs.get_fileName() + "'.</p>").fadeIn("slow");
            }
            //]]>
        </script>

        <div class="MainWrap">
            <div class="TopWrap">
                <div class="Holder">
                    <telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1" AllowedFileExtensions=".txt,.csv" TargetFolder="c:\Files\Import"
                        OnFileUploaded="RadAsyncUpload1_FileUploaded" OnClientValidationFailed="validationFailed">
                    </telerik:RadAsyncUpload>
                    <telerik:RadButton runat="server" ID="BtnSubmit" Text="Submit" Skin="Metro">
                        <Icon SecondaryIconLeft="5" SecondaryIconTop="3" SecondaryIconUrl="images/gear.png" />
                    </telerik:RadButton>
                    <p>
                        Select File To Upload (formats accepted .csv,.txt, only)
                    </p>

                    <div class="ErrorHolder">
                    </div>
                </div>
                <div class="Holder Right">
                    <asp:Panel runat="server" ID="ResultsPanel" Visible="false">
                        <asp:Panel ID="ValidFiles" Visible="false" runat="server">
                            <p>
                                <asp:Label runat="server" ID="lblFileUpload" Font-Bold="True" /><br/>
                                <asp:Label runat="server" ID="lblBatchId"/><br/>
                                 <asp:Label runat="server" ID="lblProcessTime"/>
                            </p>
                            <p>
                                <telerik:RadButton ID="BtnImport" runat="server" Text="Import" OnClick="BtnImport_Click" Skin="Metro" Visible="false">
                                    <Icon SecondaryIconLeft="5" SecondaryIconTop="3" SecondaryIconUrl="images/find.png" />
                                </telerik:RadButton>
                            </p>
                            <br />
                            <asp:Label ID="lblMessage" runat="server" Visible="false" />
                        </asp:Panel>
                        <asp:Panel ID="InvalidFiles" Visible="false" runat="server">
                            <p>
                                <strong>The following files were not saved due to exceeding the maximum total size:</strong>
                            </p>
                        </asp:Panel>
                    </asp:Panel>
                </div>
                <div class="BottomWrap">
                </div>
            </div>
        </div>
    </telerik:RadAjaxPanel>
 public void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
    {
        Label fileName = new Label();
        fileName.Text = e.File.FileName;
        Session["FileName"] = e.File.FileName;

        if (totalBytes < MaxTotalBytes)
        {
            // Total bytes limit has not been reached, accept the file
            e.IsValid = true;
            totalBytes += e.File.ContentLength;
        }
        else
        {
            // Limit reached, discard the file
            e.IsValid = false;
        }

        if (e.IsValid)
        {
            ValidFiles.Visible = true;
            ValidFiles.Controls.Add(fileName);
            BtnImport.Visible = true;
            lblMessage.Visible = true;
            lblFileUpload.Text = @"File Upload Was Successful";

        }
        else
        {
            InvalidFiles.Visible = true;
            InvalidFiles.Controls.Add(fileName);
        }
    }
Hristo Valyavicharski
Telerik team
 answered on 02 Jul 2013
5 answers
564 views
Hi,

I do like this new RadSearchBox control, but I am having a few small problems.

First, I am having difficulty accessing the control client side.  I've used several variations of $find to no avail.  Would someone please suggest some alternative syntaxes.

Second, once I find this control, I would like to .clear() it of its previous search text/value.  I've tried to do this on the OnClientSearch event (using sender.clear()), but no luck with that either. 

Any suggestions?

Jim
Evgeniy Ovcharenko
Top achievements
Rank 1
 answered on 02 Jul 2013
2 answers
330 views
Howdy all.

I've got a 'fun' situation.  I have a vertical grown, image only menu on my left hand side, and a right side content area.  The idea is that on the right, you'll see pertinent employee data, and the menu will pull up extra info as you wish to see it, through RadWindows.  I'm using an OffsetElementID of my header on the right hand side, which (as I understand it) should mean that if I have set Top and Left at 0, my window should have a matching upper left hand corner as the header.

That's not what it's doing right now.  I can't get it to respect Top at all.  It'll go Left any way I tell it, but it won't go up further than it's initially appearing on the page.  Here's my code, and a picture to hopefully illustrate what I mean.

I've also included my Javascript, which I got off these forums for how I'm opening and closing the windows.  I tried programmatically setting them in there with oWindow.set_top(0); and oWindow.set_left(0);, but that didn't work.

Thanks for your help!

<telerik:RadMenu id="menuMain" ClientIDMode="Static" runat="server" flow="Vertical" OnClientItemClicked="MenuOpenWindow" Width="100%"
    BackColor="#37495D">
    <Items>
      <telerik:RadMenuItem ImageUrl="../Images/button1.png" Value="EmpProj" />
    </Items>
</telerik:RadMenu>
 
 
 
<telerik:RadWindow id="winProjList" runat="server" Top="0" Left="0" Style="z-index: 8000" EnableEmbeddedSkins="false" OffsetElementID="divEmpHeader"
    ShowContentDuringLoad="false" VisibleStatusbar="false" VisibleTitlebar="false" AutoSize="true">
    <ContentTemplate>
        <div id="divProjListList" runat="server" style="width: 400px;">
            <div>Projects</div>
            <div style="width: 400px">
                <telerik:RadGrid ID="grdCheckAcctList" runat="server" AutoGenerateColumns="False"
                    Skin="" EnableLinqExpressions="False" CellSpacing="0" EnableViewState="False">
                    <ClientSettings Selecting-AllowRowSelect="true" EnablePostBackOnRowClick="true" />
                    <MasterTableView DataKeyNames="KeyColumn" ShowHeader="true" HeaderStyle-HorizontalAlign="Center" EnableViewState="false">
                        <Columns>
                            <telerik:GridBoundColumn DataField="Department" />
                            <telerik:GridBoundColumn DataField="Project" />
                            <telerik:GridBoundColumn DataField="Supervisor" />
                            </telerik:GridBoundColumn>
                        </Columns>
                        <HeaderStyle HorizontalAlign="Center" />
                    </MasterTableView>
                    <FilterMenu EnableImageSprites="False">
                    </FilterMenu>
                </telerik:RadGrid>
            </div>
        </div>
    </ContentTemplate>
</telerik:RadWindow>

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        //Global Variables
        var lastOpenedWindow;
         
        function pageLoad() {
            $addHandler(document, "click", onClickHandler);
        }
 
        function MasterMenuOpenWindow(sender, eventArgs) {
            var oWindow;
 
            //Closes the last window opened
            if (lastOpenedWindow) {
                lastOpenedWindow.close();
                lastOpenedWindow = null;
            }
 
            if (eventArgs.get_item().get_value() == "EmpProj") {
                oWindow = $find("<%=winEmpProj.ClientID%>");
                      oWindow.set_top(0);
                      oWindow.set_left(0);
                      oWindow.show();
                lastOpenedWindow = oWindow;
                return false;
            }
        }
 
        function onClickHandler(e) {
            var targedNodeName = e.target;
 
            if (lastOpenedWindow) {
                // If the RadWindow is clicked then do nothing ;
                if ($telerik.isMouseOverElementEx(lastOpenedWindow.get_popupElement(), e)) return;
 
                lastOpenedWindow.close();
                lastOpenedWindow = null;
            }
        }
    </script>
</telerik:RadScriptBlock>
Amanda
Top achievements
Rank 1
Iron
 answered on 02 Jul 2013
1 answer
256 views
Hello,
I have been trying to improve performance of my page that has aTelerik tabstrip with 8 tabs and many user controls under each tab.
I read that having multiple pageviews can be a performance drag and so have been trying to dynamically create radtabs,  associate radpageviews and load usercontrols on each tab as they are created.Everything is "working" fine, but as I am trying to improve the performance of the tabs, I find that this scenario -
-I have programatically created 5 tabs - Tab1 , Tab2, Tab 3, Tab 4, Tab5 .On page load, there is only one radpageview with unique ID, pageView_Tab1 created initially for Tab1. Everything loads fine, no issues.
-But when I click on Tab2 , control goes into creating pageView_Tab1 again. Then it creates pageView_Tab2.
-Similar behavior follows as I click on subsequent tabs. E.g, Clicking on Tab3 creates pageView_Tab1, pageView_Tab2 and then creates PageView_Tab3.
This behavior is very strange , as it keep reloading the pageviews for already loaded tabs- hence no performance increase. Infact, I added code to keep track of already loaded tabs and not re-load it. But tabs show blank. Any help is greatly appreciated.

Code is below-

<telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel1"> </telerik:RadAjaxLoadingPanel>

<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager1_AjaxRequest">

<AjaxSettings>

<telerik:AjaxSetting AjaxControlID="tabMain">

<UpdatedControls>
<
telerik:AjaxUpdatedControl ControlID="tabMain"></telerik:AjaxUpdatedControl>

<telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1">

</telerik:AjaxUpdatedControl>

</UpdatedControls>

</telerik:AjaxSetting>

<telerik:AjaxSetting AjaxControlID="RadMultiPage1">

 

<UpdatedControls>

 

<telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1">

 

</telerik:AjaxUpdatedControl>

 

</UpdatedControls>

 

</telerik:AjaxSetting>

 

</AjaxSettings>

 

</telerik:RadAjaxManager><telerik:RadTabStrip ID="tabMain" runat="server" SelectedIndex="0" onTabClick="tabMain_SelectedTabChanged" MultiPageID="RadMultiPage1" OnClientTabSelecting="onTabSelecting" Orientation="HorizontalTop"></telerik:RadTabStrip>

<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" OnPageViewCreated="RadMultiPage1_PageViewCreated"> </telerik:RadMultiPage>

---codebehind-----------

 

   Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
            AddTab("Tab1")
            AddPageView("Tab2")
            AddTab("Tab3"
            AddTab("Tab4"
            AddTab("Tab5"
end if

end sub

  Private Sub AddTab(ByVal tabName As String)
        Dim tab As RadTab = New RadTab
        tab.Text = tabName
        tabMain.Tabs.Add(tab)
    End Sub

Protected Sub RadMultiPage1_PageViewCreated(ByVal sender As Object, ByVal e As RadMultiPageEventArgs) Handles RadMultiPage1.PageViewCreated

        Dim userControlName As String = "\CompanyDetails\" & e.PageView.ID & "_Tab.ascx"
        Dim userControl As Control = Page.LoadControl(userControlName)
        userControl.ID = e.PageView.ID & "_userControl"
 e.PageView.Controls.Add(userControl)
        RadMultiPage1.FindPageViewByID(e.PageView.ID).Selected = True
End Sub

Protected Sub tabMain_SelectedTabChanged(ByVal sender As Object, ByVal e As RadTabStripEventArgs) Handles tabMain.TabClick
        AddPageView(e.Tab.Text)
        e.Tab.PageView.Selected = True
End Sub

  Private Sub AddPageView(ByVal pageViewID As String)
        If RadMultiPage1.FindPageViewByID(pageViewID) Is Nothing Then
            Dim pageView As New RadPageView()
            pageView.ID = pageViewID.Replace(" ", "") '"RadMultiPage1" '
            RadMultiPage1.PageViews.Add(pageView)
            pageView.Selected = True
        End If
      
    End Sub

Kate
Telerik team
 answered on 02 Jul 2013
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?