Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
111 views
I am using the built-in filtering on a RadGrid but I'm running into a problem with one column in particular. When I try to filter on the column in question, I get an "Object reference not set to an instance of an object" error and the filtering doesn't work. This particular column is generated from a subquery that's being used as a column expression (and then given an alias). It seems like the filtering only works for grid columns that have a matching column name in a database table (i.e. doesn't seem to work with columns generated from a subquery or UDF). Here is my aspx markup:
<telerik:RadGrid ID="grdAdmin" runat="server" Width="100%" AllowFilteringByColumn="True"
    GridLines="None" AllowPaging="True" AllowSorting="True"
    AutoGenerateColumns="False" onneeddatasource="grdAdmin_NeedDataSource"
    PageSize="20"
    ondeletecommand="grdAdmin_DeleteCommand">
    <GroupingSettings CaseSensitive="false" />
    <MasterTableView DataKeyNames="NominationID" NoMasterRecordsText="There are currently no nominations to display."
    Width="100%" CommandItemDisplay="Top" AutoGenerateColumns="False">
        <Columns
            <telerik:GridDateTimeColumn DataField="DateOfNomination" DataFormatString="{0:d}" HeaderText="Date Of Nomination" SortExpression="DateOfNomination" UniqueName="DateOfNomination" ReadOnly="true">
            </telerik:GridDateTimeColumn>       
            <telerik:GridBoundColumn DataField="NomineeName" HeaderText="Nominee Name"
                SortExpression="NomineeName" DataType="System.String" UniqueName="NomineeName" ReadOnly="true">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="NominatorName" HeaderText="Nominator Name"
                SortExpression="NominatorName" DataType="System.String" UniqueName="NominatorName" ReadOnly="true" AllowFiltering="false">
            </telerik:GridBoundColumn>
            <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteCommandColumn" ConfirmDialogType="Classic" ConfirmText="Are you sure you want to delete this nomination from the database?" ConfirmTitle="Are you sure?">  
            </telerik:GridButtonColumn
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

The column that I get the error on is the NomineeName column. Here is the C# codebehind:

protected void grdAdmin_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
    using (RecognitionEntities dc = new RecognitionEntities())
    {
        string selectStatement = string.Format(@"select n.NominationID,
            n.DateOfNomination,
            (SELECT FULL_NAME FROM dwdata.person_table where PERSON_ID=n.NomineeEmployeeID) as NomineeName,
            (SELECT FULL_NAME FROM dwdata.person_table where PERSON_ID=n.NominatorEmployeeID) as NominatorName
            from dbo.tblNominations as n
            where (n.DeletedBy IS NULL)
            and (n.FiscalYear = '{0}')",
                                               ConfigurationManager.AppSettings["CurrentFiscalYear"]);
 
        // bind the results to the grid
        IEnumerable<NominationAdmin> pn = dc.ExecuteStoreQuery<NominationAdmin>(selectStatement);
        grdAdmin.DataSource = pn.ToList();
    }
}

And here is the NominationAdmin.cs file:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace Recognition.EntityDataModel
{
    public class NominationAdmin
    {
        private int _nominationID;
        private DateTime _dateOfNomination;
        private string _nomineeName;
        private string _nominatorName;
 
        public int NominationID
        {
            get { return this._nominationID; }
            set { this._nominationID = value; }
        }
 
        public DateTime DateOfNomination
        {
            get { return this._dateOfNomination; }
            set { this._dateOfNomination = value; }
        }
 
        public string NomineeName
        {
            get { return this._nomineeName; }
            set { this._nomineeName = value; }
        }
 
        public string NominatorName
        {
            get { return this._nominatorName; }
            set { this._nominatorName = value; }
        }
    }
}

Any idea what's going on and how to fix it? Thanks.
Mira
Telerik team
 answered on 30 Jan 2012
1 answer
145 views
Hi,

We are trying to achieve the following goal: Invoke a RAD Progress Bar (located in a master page) from a child content-area page *while at the same time* disabling all of the screen content in the pnlMainZoneId control in the master page (IE: showing the ajax hourglass) except for the progress bar & its cancel button. When either the progress bar is complete or the cancel button is clicked, we want the ajax hourglass to go away and all of the screen controls to be re-enabled.

I have been trying to implement the following article: http://www.telerik.com/help/aspnet-ajax/ajax-masterpage-update-everywhere.html

...however, I am getting an exception "object not set to an instance..." when reaching this line: ajaxMgr.AjaxSettings.AddAjaxSetting(object1, object2);

Could someone please give me a bit of direction? I have confirmed that the ajaxMgr, object1 and object2 are all correctly instantiated and populated, so I'm not sure where the error is coming from.

I have attached a sample of the pages we are using to replicate the error, below. Please let me know if I can provide more information. Thank you!

Lars


[TEST.MASTER]

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="test.master.cs" Inherits="AutoAAP.test1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<html>
    <head runat="server">
        <title></title>
        <asp:ContentPlaceHolder ID="head" runat="server">
        </asp:ContentPlaceHolder>
    </head>
    <body>
        <form id="form2" runat="server" style="height: 100%;">
        
            <telerik:RadScriptBlock runat="Server" ID="RadScriptBlock1">
            <script type="text/javascript">                     
                function handleProgressBarUpdateFromServer(sender, args)
                {
                    if ((args.get_progressData() && args.get_progressData().OperationComplete == 'true'))
                    {
                        args.set_cancel(true);                       
                    }
                }                                        
            </script>
            </telerik:RadScriptBlock>

            <telerik:RadAjaxManager ID="RadAjaxManagerMain" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadAjaxManagerMain">
                        <UpdatedControls><telerik:AjaxUpdatedControl ControlID="pnlMainZoneId" LoadingPanelID="RadAjaxLoadingPanelMain" /></UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>

            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanelMain" runat="server" />
            <telerik:RadScriptManager ID="ScriptManager" runat="server" EnableTheming="True" ></telerik:RadScriptManager>

            <asp:Panel ID="divUniversalProgressBar" runat="server">        
                <telerik:RadProgressManager id="MasterRadProgressManager1" runat="server" />
                <telerik:RadProgressArea RegisterWithScriptManager="true" id="MasterRadProgressArea1" runat="server" DisplayCancelButton="true" OnClientProgressUpdating="handleProgressBarUpdateFromServer" />        
            </asp:Panel>

            <asp:Panel ID="pnlMainZoneId" runat="server" Height="100%" Width="100%" >            
                <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                </asp:ContentPlaceHolder>
            </asp:Panel>

       </form>
    </body>
</html>



[TEST.MASTER.CS]

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Global;
using AutoAAP.StateManagement;
using System.Collections.Generic;
using Telerik.Web.UI;
using Telerik.Web.UI.Upload;

namespace AutoAAP
{
    public partial class test1 : System.Web.UI.MasterPage
    {



        #region Page Events

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        #endregion



        #region Progress bar subsystem.
    
        public struct ProgressBarConfig
        {
            public string dialogHeaderText;
            public string cancelText;
            public string elapsedTimeText;
            public string estimatedTimeText;
            public string totalText;
            public string totalFilesText;
            public string transferSpeedText;
            public string uploadedFilesText;
            public bool showProgressBar;
        }
        static public ProgressBarConfig ProgressBarConfiguration = new ProgressBarConfig();

        private void pbPause()
        {
            // Server wait 4 seconds after sending an update.
            // Since browser checks for progress every 3 seconds, should always receive updates.
            System.Threading.Thread.Sleep(new TimeSpan(0, 0, 4));
        }
        private bool pbIsNullOrEmptyString(string sArg)
        {
            bool ret = false;

            if (sArg == null)
            {
                ret = true;
            }
            else if (sArg == string.Empty)
            {
                ret = true;
            }
            else
            {
            }

            return ret;
        }

        /// <summary>
        /// Pass in NULL for strings if you want to hide those fields.
        /// </summary>
        public void ProgressBarConfigure(
        string dialogHeaderText, string cancelText, string elapsedTimeText, string estimatedTimeText,
        string totalText, string totalFilesText, string transferSpeedText, bool showProgressBar)
        {
            ProgressBarConfiguration                            = new ProgressBarConfig();
            ProgressBarConfiguration.dialogHeaderText           = dialogHeaderText;
            ProgressBarConfiguration.cancelText                 = cancelText;
            ProgressBarConfiguration.elapsedTimeText            = elapsedTimeText;
            ProgressBarConfiguration.estimatedTimeText          = estimatedTimeText;
            ProgressBarConfiguration.totalText                  = totalText;
            ProgressBarConfiguration.totalFilesText             = totalFilesText;
            ProgressBarConfiguration.transferSpeedText          = transferSpeedText;
            ProgressBarConfiguration.uploadedFilesText          = "?2Please wait... ";
            ProgressBarConfiguration.showProgressBar            = showProgressBar;

            ProgressBarReset();
        }
        public void ProgressBarReset()
        {
            MasterRadProgressArea1.HeaderText                       = ProgressBarConfiguration.dialogHeaderText;

            ProgressIndicators indicators                           = ProgressIndicators.None;

            MasterRadProgressArea1.Localization.Cancel              = ProgressBarConfiguration.cancelText;
            MasterRadProgressArea1.DisplayCancelButton              = !(pbIsNullOrEmptyString(ProgressBarConfiguration.cancelText));

            MasterRadProgressArea1.Localization.CurrentFileName = "";
            indicators |= ProgressIndicators.CurrentFileName;

            MasterRadProgressArea1.Localization.ElapsedTime         = ProgressBarConfiguration.elapsedTimeText;
            if (!pbIsNullOrEmptyString(ProgressBarConfiguration.elapsedTimeText))
                indicators |= ProgressIndicators.TimeElapsed;

            MasterRadProgressArea1.Localization.EstimatedTime       = ProgressBarConfiguration.estimatedTimeText;
            if (!pbIsNullOrEmptyString(ProgressBarConfiguration.estimatedTimeText))
                indicators |= ProgressIndicators.TimeEstimated;

            MasterRadProgressArea1.Localization.Total               = ProgressBarConfiguration.totalText;
            if (!pbIsNullOrEmptyString(ProgressBarConfiguration.totalText))
                indicators |= ProgressIndicators.TotalProgress;

            MasterRadProgressArea1.Localization.TotalFiles          = ProgressBarConfiguration.totalFilesText;
            if (!pbIsNullOrEmptyString(ProgressBarConfiguration.totalFilesText))
            {
                indicators |= ProgressIndicators.FilesCount;
                indicators |= ProgressIndicators.SelectedFilesCount;
                indicators |= ProgressIndicators.FilesCountBar;
                indicators |= ProgressIndicators.FilesCountPercent;
            }

            MasterRadProgressArea1.Localization.TransferSpeed       = ProgressBarConfiguration.transferSpeedText;
            if (!pbIsNullOrEmptyString(ProgressBarConfiguration.transferSpeedText))
                indicators |= ProgressIndicators.TransferSpeed;

            MasterRadProgressArea1.Localization.Uploaded            = "Please wait...";
            MasterRadProgressArea1.Localization.UploadedFiles       = ProgressBarConfiguration.uploadedFilesText;
                       
            if (ProgressBarConfiguration.showProgressBar)
            {
                indicators |= ProgressIndicators.TotalProgressBar;
                indicators |= ProgressIndicators.TotalProgressPercent;
            }
            
            MasterRadProgressArea1.ProgressIndicators               = indicators;
        }
        public void ProgressBarUpdate(string stepDescription, int stepNumber, int totalSteps)
        {
            // If someone does not pass in a description we
            // will do our best to create one for the end user.
            if (pbIsNullOrEmptyString(stepDescription))
            {
                stepDescription =
                    (stepNumber == 0)
                        ? "Initializing..."
                    : (stepNumber == totalSteps)
                        ? "Completing..."
                        : string.Format("Step {0} of {1}...", stepNumber, totalSteps);
            }

            // Can only update the RadProgressContext, the MasterRadProgressArea1
            // is NOT manipulatable after the ProgressBar appears in the UI. Must
            // cancel the ProgressBar first.
            RadProgressContext progress                             = RadProgressContext.Current;
            progress.OperationComplete                              = false;
            progress.CurrentOperationText                           = stepDescription;
          
            progress.PrimaryTotal                                   = stepNumber;
            progress.PrimaryValue                                   = totalSteps;
            progress.PrimaryPercent                                 = Math.Round(100m * ((totalSteps > 0) ? (stepNumber/(decimal)totalSteps) : 0), 0);

            if (stepNumber >= totalSteps)
            {
                progress.PrimaryTotal                               = totalSteps;
                progress.PrimaryValue                               = totalSteps;
                progress.PrimaryPercent                             = 100;

                pbPause(); // This 4 second pause gives the UI time to poll (every 3 seconds) for text / presentation changes.
                progress.OperationComplete                          = true;
            }
            else
            {
                progress.OperationComplete                          = false;
                pbPause(); // This 4 second pause gives the UI time to poll (every 3 seconds) for text / presentation changes.
            }
        }
        public void ProgressBarHideNow()
        {
            ProgressBarUpdate("Cancelled. Cleaning up...", 0, 0);
        }

    #endregion


   }
}



[TEST.ASPX]

<%@ Page Title="" Language="C#" MasterPageFile="~/test.Master" AutoEventWireup="true" CodeBehind="test.aspx.cs" Inherits="AutoAAP.test" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <p>We are testing the invocation of the master page's progress dialog from a content page.</p>

   
    <telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnBeginUpdates">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="divUniversalProgressBar" LoadingPanelID="pnlMainZoneId" />
                    <telerik:AjaxUpdatedControl ControlID="MasterRadProgressManager1" LoadingPanelID="pnlMainZoneId" />
                    <telerik:AjaxUpdatedControl ControlID="MasterRadProgressArea1" LoadingPanelID="pnlMainZoneId" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>


    <asp:Panel ID="pnlButtons" runat="server">
        <asp:Button ID="btnBeginUpdates" runat="server" Text="Test Progress Bar" onclick="btnBeginUpdates_Click" />
    </asp:Panel>

</asp:Content>


[TEST.ASPX.CS]

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using Telerik.Web.UI.Upload;

namespace AutoAAP
{
    public partial class test : System.Web.UI.Page
    {

        static private int _curStep = 0;
        static private int _maxStep = 4;
        static private bool _cancelled = false;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                setupProgressBar(); // When this page is first rendered we need to call "resetProgressBar()" if we are going to use the progress bar on this page.


                RadAjaxManager ajaxMgr      = RadAjaxManager.GetCurrent(Page); //(RadAjaxManager)this.Master.FindControl("RadAjaxManagerMain");
                RadAjaxLoadingPanel pLoad   = (RadAjaxLoadingPanel)this.Master.FindControl("RadAjaxLoadingPanelMain"); //pnlMainZoneId                
                    
                Panel p1                                = (Panel)this.Master.FindControl("divUniversalProgressBar");
                RadProgressManager pRadProgressManager  = (RadProgressManager)this.Master.FindControl("MasterRadProgressManager1");
                RadProgressArea pRadProgressArea        = (RadProgressArea)this.Master.FindControl("MasterRadProgressArea1");


// These statements all throw errors, do not know why!

                try { ajaxMgr.AjaxSettings.AddAjaxSetting(btnBeginUpdates, p1); }
                catch (Exception ex) { System.Diagnostics.Debug.Print(ex.Message); }

                try { ajaxMgr.AjaxSettings.AddAjaxSetting(btnBeginUpdates, pRadProgressManager); }
                catch (Exception ex) { System.Diagnostics.Debug.Print(ex.Message); }

                try { ajaxMgr.AjaxSettings.AddAjaxSetting(btnBeginUpdates, pRadProgressArea); }
                catch (Exception ex) { System.Diagnostics.Debug.Print(ex.Message); }


                try { ajaxMgr.AjaxSettings.AddAjaxSetting(btnBeginUpdates, p1, pLoad); }
                catch (Exception ex) {System.Diagnostics.Debug.Print(ex.Message); }

                try { ajaxMgr.AjaxSettings.AddAjaxSetting(btnBeginUpdates, pRadProgressManager, pLoad); }
                catch (Exception ex) { System.Diagnostics.Debug.Print(ex.Message);}

                try { ajaxMgr.AjaxSettings.AddAjaxSetting(btnBeginUpdates, pRadProgressArea, pLoad); }
                catch (Exception ex) { System.Diagnostics.Debug.Print(ex.Message);}



            }
        }


        private AutoAAP.test1 getMaster()
        {
            return ((AutoAAP.test1)this.Master);
        }

        private void setupProgressBar()
        {
            _curStep = 0;
            _cancelled = false;
            getMaster().ProgressBarConfigure(
                "Progress Bar Test",
                "Cancel",
                "Elapsed Time",
                null, //"3estimatedTime",
                "4total",
                null, //"totalFiles",
                null, //"transferSpeed",
                true
                );
        }

        protected void btnConfigure_Click(object sender, EventArgs e)
        {
            setupProgressBar();
        }

        protected void btnBeginUpdates_Click(object sender, EventArgs e)
        {
            _curStep = 0;
            getMaster().ProgressBarReset(); // It's wise to always do a reset.

            for (int i = 0; i <= _maxStep; i++)
            {
                if (Response.IsClientConnected & !_cancelled)
                {
                    getMaster().ProgressBarUpdate(
                        null,
                        _curStep,
                        _maxStep
                        );

                    _curStep++;
                }
                else
                {
                    // If Response.IsClientConnected == false,
                    // the user clicked Cancel or closed their browser.
                    _cancelled = false;
                    getMaster().ProgressBarReset();
                    break;
                }
            }
        }

        protected void btnCancel_Click(object sender, EventArgs e)
        {
            _cancelled = true;
            getMaster().ProgressBarHideNow();
            getMaster().ProgressBarReset();
        }

        protected void btnReset_Click(object sender, EventArgs e)
        {
            setupProgressBar();
        }


    }
}
Maria Ilieva
Telerik team
 answered on 30 Jan 2012
3 answers
204 views
Hi there,

I'm using the RadWindow 2011 Q3 and for some reason it sporadically throws javascript errors in internet explorer 6. Here is my code:

<telerik:RadAjaxManagerProxy ID="UserAjaxManager" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="UserListGrid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="UserListGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RefreshList">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="UserListGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="DeleteSelectedItems">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="UserListGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Search">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="UserListGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>


<
telerik:RadWindowManager ID="RadWindows" runat="server" Skin="Web20" Behaviors="Close,Move,Resize">
        <Windows>
            <telerik:RadWindow Height="362" Width="504" ID="ViewWindow" OnClientClose="updateRadGrid" RegisterWithScriptManager="false" runat="server" CssClass="actionWindow" NavigateUrl="UserEditor.aspx" VisibleStatusbar="false" VisibleTitlebar="true" ReloadOnShow="true">
            </telerik:RadWindow>
        </Windows>
     </telerik:RadWindowManager>
 
     <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            //View USER
            function showUserViewerWindow(userId)
            {
                var actionWindow = $find("<%=ViewWindow.ClientID %>");
                actionWindow.setUrl("UserViewer.aspx?userId=" + userId);
                actionWindow.show();
            }
 
            //UPDATEGRID
            function updateRadGrid(sender, eventArgs)
            {
                var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
                ajaxManager.ajaxRequestWithTarget("<%= RefreshList.UniqueID%>");
            }
        </script>
     </telerik:RadCodeBlock>

I have attached alerts to the $find function and I keep getting a null value in IE6, a problem I'm not encountering in any other browsers. Ultimately, Im trying to resize the windows specifically for IE because Autosize ="true" always results in scrollbars. I have attached a screen capture of the script error I'm receiving.
Marin Bratanov
Telerik team
 answered on 30 Jan 2012
4 answers
121 views
hi 
i have a RadGrid, popup edit templates at insert/update i need to keep the popup opened after insert/update, how can i accomplish this?


thank you
Tsvetina
Telerik team
 answered on 30 Jan 2012
1 answer
63 views
Hi,
   I have a grid that I am creating programmactically. Everything in the grid works fine. In the Column created Event I am setting the
Column.AutoPostback property to true. When I try to fiter on any of the columns I am getting this error

Microsoft JScript runtime error: 'value' is null or not an object

This is happening on all the column filters. Can someone tell me what is causing this since this is making the filtering useless for the grid? Please let me know since this is kind of a vague error from ajax and im having a hard time trying to find the cause and solution around it, your helps appreciated!!
Princy
Top achievements
Rank 2
 answered on 30 Jan 2012
1 answer
129 views

Hi,

I am using RadEditor in my web application.

Please suggest, how i can add text in editable and non editable area of RadEditor dynamically by coding in c#.
(For Example 3 to 4 lines of Address in non-editable part that come from database).

  i want to save the editable text after text change and i don't want this in any button click. 
 i have to save all the contents in MS Word  in user's system.

Aslo i want to hide all the tools of radeditor and implement copy & paste,

changing the text format on button click events  that are outsite the editor.

Thanks

Vikram 

Vijay
Top achievements
Rank 1
 answered on 30 Jan 2012
15 answers
862 views
Hello,

I'm currently using the client-side scrollIntoView() option to scroll to a node that is selected based on a user's search string. This is working, however, I'd like it to work a little bit differently and can't figure out how to achieve the desired functionality.

For example: The user searches and a match is found in the RadTreeView. The node is selected and the scrollIntoView() method is called. If the node that matches the search string is above the current scroll position, the SelectedNode appears at the top of the treeview. This is fine. What I would like to change is that if the node that matches is below the current scroll position then the SelectedNode appears at the bottom of the treeview. I would like the scrollIntoView method to automatically scroll so the SelectedNode is always at the TOP of the treeview, regardless of which way the SelectedNode was in relation to the current scroll position.

I have not been able to find out how to achieve this and I do not believe that it is built in either.

If anybody knows how to achieve this, I would greatly appreciate some guidance on what I need to do.

Thanks,
Casey
Peter
Telerik team
 answered on 30 Jan 2012
3 answers
85 views
Does Telerik charge to create a new skin?

I am having trouble trying to make the black skin which is Black/Lime green to be more of a Black/Red skin.
The sprite images is where its getting me as some have the Green fading and i cant quite get the colorize to look the same... as it starts to color text etc... i just want the icons/hover effect to be red no green
Bozhidar
Telerik team
 answered on 30 Jan 2012
1 answer
124 views
I kept getting error (Input string was not in a correct format.) loading image from database. some of the values are empty(null).
trying to work around null value, i use dbnull to check for null value and make the pix to be null. it gave me the error above.
Most of the solutions i get online did not work for me.

This is my code.
<div>
<asp:ScriptManager ID="scmn" runat="server" ></asp:ScriptManager>
<asp:UpdatePanel ID="upd" runat="server" >
    <ContentTemplate>
    <asp:SqlDataSource id="dsTrucks" runat="server"
    SelectCommand="SELECT DriverID, UPPER(FirstName) + ', ' + Lastname + ' ' + OtherName AS FullName, dateOfBirth, PlaceOfBirth, StateOfOrigin, Telefone AS Phone, HomeAddress, Picture FROM Trip.Driver ORDER BY FirstName, Lastname, OtherName"
            ConnectionString="<%$ ConnectionStrings:defaultcon %>">
        
    </asp:SqlDataSource>

        <telerik:RadListView ID="RadListView1" runat="server"
        ItemPlaceholderID="ListViewContainer" AllowPaging="True"
            DataSourceID="dsTrucks">
        <LayoutTemplate>
                <asp:PlaceHolder runat="server" id="ListViewContainer" /></LayoutTemplate>
                <ItemTemplate>
                <fieldset>
                    <legend><b>Driver No: </b><%#Eval("DriverID")%></legend>
                    <div class="details">
                        <div style="padding: 5px">
                    <table class="templateTable">
                        <tr>
                            <td rowspan="5">
                                <telerik:RadBinaryImage runat="server" ID="RadBinaryImage1" DataValue='<%#Eval("Picture") == DBNull.Value ? null : Eval("Picture")%>'
                                AutoAdjustImageControlSize="True" Width="120px" Height="140px" ToolTip='<%#Eval("DriverID", "Driver {0} picture.") %>'
                                AlternateText='<%#Eval("DriverID", "Driver {0} picture.}") %>' ResizeMode="Fit" />
                                <a ID="A4" runat="server" class="thickbox"
                            href='<%# Eval("DriverID", "driver_attachpix.aspx?DriverID={0}&TB_iframe=true&height=320&width=400") %>'
                            title='<%# Eval("DriverID", "Change Picture for {0} ::") %>'>Change Picture</a>
                            </td>
                            <td>
                                Driver ID.
                            </td>
                            
                            <td class="value">
                                <asp:Label ID="lblDriverID" runat="server" Text='<%# Eval("DriverID") %>' />
                            </td>
                            <td>
                                Date of Birth
                            </td>
                            <td class="value">
                            <asp:Label ID="lblDateofbirth" runat="server" Text='<%# Eval("dateofBirth", "{0:d}") %>' />
                                
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Fullname
                            </td>
                            <td class="value" colspan="3">
                                <asp:Label ID="lblFullname" runat="server" Text='<%# Eval("Fullname") %>' />
                               
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Place of Birth
                            </td>
                            <td class="value">
                                <asp:Label ID="lblPlaceofBirth" runat="server" Text='<%# Eval("PlaceOfBirth") %>' />
                            </td>
                            <td>
                                State of Origin
                            </td>
                            <td class="value">
                                <asp:Label ID="lblState" runat="server" Text='<%# Eval("StateOfOrigin") %>' />
                            </td>
                        </tr>
                        <tr >
                            
                            <td >Telephone</td>
                            <td class="value"><asp:Label ID="lbphone" runat="server" Text='<%# Eval("Phone") %>' /></td>
                            <td >Home Address</td>
                            <td class="value"><asp:Label ID="lbAddress" runat="server" Text='<%# Eval("HomeAddress") %>' /></td>
                        </tr>

                        <tr >
                            
                            <td class="value">
                                <a ID="btnShowPopup" runat="server" class="thickbox"
                            href='<%# Eval("DriverID", "Driver_Details.aspx?DriverID={0}&TB_iframe=true&height=620&width=860") %>'
                            title='<%# Eval("DriverID", "Other details for {0} ::") %>'>Other details</a>
                            </td>
                            <td class="value">
                                <a ID="A1" runat="server" class="thickbox"
                            href='<%# Eval("DriverID", "Driver_Edit.aspx?DriverID={0}&TB_iframe=true&height=620&width=860") %>'
                            title='<%# Eval("DriverID", "Edit driver {0} details::") %>'>Edit details</a>
                            </td>
                            <td class="value">
                                <a ID="A2" runat="server" class="thickbox"
                            href='<%# Eval("DriverID", "Truck_RecentTrips.aspx?Driver={0}&TB_iframe=true&height=520&width=700") %>'
                            title='<%# Eval("DriverID", "Recent trips for {0}") %>'>Recent trips</a>
                            </td>
                            <td class="value">
                            <a ID="A3" runat="server" class="thickbox"
                            href='<%# Eval("DriverID", "AssignDriver.aspx?Driver={0}&TB_iframe=true&height=220&width=400") %>'
                            title='<%# Eval("DriverID", "Assign truck for {0}") %>'>Assign Truck</a>
                            </td>
                        </tr>
                       
                        
                    </table>
                </div>
                    </div>
                </fieldset>
                </ItemTemplate>
        </telerik:RadListView>

           
        
    </ContentTemplate>
</asp:UpdatePanel>
    
</div>

Can any1 please help?

Tsvetina
Telerik team
 answered on 30 Jan 2012
2 answers
80 views
Hi,    
    
    I use RadTreeView inside Collapsible panel extender. I couldn view the last node in the tree. But when i expand or collapse the collapsible panel extender, the last node is visible. Below is the code i used in design    
 
<div class="left width350" id="divAdministrationModules" runat="server">
                                <div class="divborder maarginleft20 width350">
                                    <asp:Panel ID="panelAdministrationModules" CssClass="" runat="server">
                                        <div class="divSearchHeader width350">
                                            <asp:Label ID="LabelAdministrationTitle" runat="server" Text="Administration Modules"
                                                CssClass="divSearchHeaderText" />
                                            <div class="floatRight">
                                                <asp:ImageButton ID="ImageButtonAdministration" runat="server" ImageUrl="~/images/collapsible.gif"
                                                    AlternateText="(Show/Hide Details...)" />
                                            </div>
                                        </div>
                                    </asp:Panel>
                                    <asp:Panel ID="panelAdministrationModulesContent" runat="server"  CssClass="maarginleft20 width350"
                                        Style="overflow: hidden;">
                                        <telerik:RadTreeView OnClientNodeChecked="AfterCheck" ID="treeViewAdministrationFunctionals"
                                            TriStateCheckBoxes="true" CheckBoxes="true"  runat="server" autopostbackoncheck="false"
                                            Width="350px">
                                        </telerik:RadTreeView>
                                    </asp:Panel>
                                    <ajaxToolkit:CollapsiblePanelExtender ID="AdministrationMenu" BehaviorID="cpbExtender2"
                                        runat="Server" TargetControlID="panelAdministrationModulesContent" ExpandControlID="panelAdministrationModules"
                                        CollapseControlID="panelAdministrationModules" Collapsed="false" ImageControlID="ImageButtonAdministration"
                                        ExpandedImage="~/images/Uncollapsible.png" CollapsedImage="~/images/collapsible.png"
                                        SuppressPostBack="true" />
                                </div>
                            </div>

Any Ideas would be great

Thanks,
Hema.
Hemamalini
Top achievements
Rank 1
 answered on 30 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?