Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
188 views
I am using NodeTemplates in my RadTreeView and have set EnableDragAndDrop and EnableDragAndDropBetweenNodes to true, however, the lines used to indicate the dropzone between two nodes is not showing up.

Any tips or insight on on how I should go about debugging that?

Thanks,
Neil
Kate
Telerik team
 answered on 31 Jan 2011
4 answers
174 views
Hello,

I have own composite control inherited from RadWebControl. It contains RadTextBox control where I need handle keyup client event.
I have implemented client class for it and I attached event in initialize function. In dispose function I'm removing this event handler but it causes javascript error:

Line: 6
Error: '_events' is null or not an object

Here is the script:

nData.KnowledgeManagement.Web.UI.Searcher.prototype =
{
    initialize: function () {
        nData.KnowledgeManagement.Web.UI.Searcher.callBaseMethod(this, 'initialize');
  
        // SearchTextBox
        this._searchTextBox = $find(this.get_id() + '_searchTextBox');
        this._keyUpDelegate = Function.createDelegate(this, this._keyUp);
        $addHandler(this._searchTextBox._textBoxElement, "keyup", this._keyUpDelegate);
  
        // XmlHttpPanel
        this._xmlHttpPanel = $find(this.get_id() + '_xmlHttpPanel');
        this._xmlHttpPanel._searcher = this;
        this._xmlHttpPanel.add_responseEnding(this._xmlHttpPanelResponseEnding);
        this._xmlHttpPanel.add_responseError(this._clientResponseError);
    },
  
    dispose: function () {
        nData.KnowledgeManagement.Web.UI.Searcher.callBaseMethod(this, 'dispose');
  
        if (this._keyUpDelegate) {
            $removeHandler(this._searchTextBox._textBoxElement, "keyup", this._keyUpDelegate);
            this._keyUpDelegate = null;
        }
  
        this._xmlHttpPanel.remove_responseEnding(this._xmlHttpPanelResponseEnding);
        this._xmlHttpPanel.remove_responseError(this._clientResponseError);
    },
  
    _keyUp: function () {
        this._search(this._searchTextBox._textBoxElement.value);
    },
    ...
}

Cound you tell me what I have wrong?
Thanks
Jiri
Maria Ilieva
Telerik team
 answered on 31 Jan 2011
1 answer
98 views
How do I get the DataItem in a NodeDrop event?

I am trying to get my database Id of the row for the source and destination nodes when I drag and drop a node using:

DataRowView dataSourceRow = (DataRowView)e.SourceDragNode.DataItem;

When I step through my code dataSourceRow  is null

Thanks, 
Neil

Dimitar Terziev
Telerik team
 answered on 31 Jan 2011
2 answers
281 views
Hi in my application i have a treeview control ...
In the pageload i have initialized to collapse all the nodes
The problem is when all the nodes get expanded i am unable to accomodate the list on the page  and it gets scrolled...
I need to keep the active selected node displayed with all the other parent nodes collapsed  and if i select the other node the previous active node should get collapsed, so that only one node will be active and the rest will be in collapsed state. I hope you got my scenario and will provide a solution for it.

deva
Top achievements
Rank 1
 answered on 31 Jan 2011
3 answers
104 views

We have a problem with the telerik radeditor on WSS v3. We are using the lite editor: 4.5.6

When clicking bold, italic, underline, justify, indent etc. tool buttons in the middle or at the end of some text the cursor jumps to the start of the text(box). When you select some text first the buttons work fine. Also when inserting a table somewhere in the middle of a text it always inserts the table at the start of the text.
Shortcuts like CTRL+B work fine when typing. 
Toolbuttons like Imagemanager or bullets and numbering work fine as well.

Any help would be much appreciated!

Stanimir
Telerik team
 answered on 31 Jan 2011
3 answers
146 views
Hi

I am adding tabs to a radtabstrip dynamically and the tabs automatically break over multiple rows when they exceed the width of the tabstrip, which is nice. However when I select a tab in the top row it doesn't reorder - which is not so nice. Similar to this question. I have ReorderTabsOnSelect = true, is there something else I have to set?

Markup:
<telerik:RadTabStrip ID="RadTabStrip1" runat="server"
     MultiPageID="RadMultiPage1"
     SelectedIndex="0"
     Skin="Vista"
     ReorderTabsOnSelect="true"
     Width="550px">
</telerik:RadTabStrip>
 
<telerik:RadMultiPage ID="RadMultiPage1" runat="server"
     SelectedIndex="0"
     BorderStyle="Solid" BorderColor="Gray" BorderWidth="1px"
     OnPageViewCreated="RadMultiPage1_PageViewCreated">
</telerik:RadMultiPage>


Source Code:
protected void Page_Load(object sender, EventArgs e)
{
    if (Page.IsPostBack == false)
    {
        //get details of tabs
        List<DummyObject> lstDummys = GetTabsFromDataBase(Request.QueryString["Tabs"]);
        //loop through and add to page
        foreach (DummyObject obj in lstDummys)
        {
           //add tab
           RadTabStrip1.Tabs.Add(new Telerik.Web.UI.RadTab(obj._displayName));
           //add pageview
           RadPageView pageView = new RadPageView();
           pageView.ID = obj._name;
           RadMultiPage1.PageViews.Add(pageView);
        }
    }
}
Dimitar Terziev
Telerik team
 answered on 31 Jan 2011
5 answers
146 views
I am using the Telerik.Web.UI version 2010.3.1317.40
Visual Studio 2010 premium.  .NET 4.0

I have a simple grid, embedded in a simple List View.

The data source for the list view is a Class Object.

When I get to the point that I am trying to get the list views key data value of customer number, it fails to set the parameter.

Let me post my code:

<%@ Page Language="c#" CodeBehind="AddressBook.aspx.cs" AutoEventWireup="True"
    EnableViewState="true" Inherits="JDE.Reporting.AddressBook" MasterPageFile="~/MenuMaster.Master" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="WorkTracker" runat="server" ContentPlaceHolderID="MainPage">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
    </telerik:RadStyleSheetManager>
    <h2>
        <asp:Label ID="lblReportHeader" runat="server"></asp:Label></h2>
      <p>
            
          <asp:Label ID="Label9" runat="server" Font-Bold="True" Font-Size="Large" 
              ForeColor="#3399FF"></asp:Label>
          <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
  
            
            <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Windows7">
            </telerik:RadSkinManager>
  
    </p>
          <telerik:RadListView ID="RLV_Address" runat="server" 
                DataKeyNames="CustomerNumber"
                ItemPlaceholderID="Addresses"
                onneeddatasource = "RLV_Address_NeedDataSource">
                  <LayoutTemplate>
                    <fieldset>
                        <legend>
                        Address
                        </legend>
                        <asp:PlaceHolder ID="Addresses" runat="server" />
                    </fieldset>
                  </LayoutTemplate>
  
                  <ItemTemplate>
                    <legend> <p> Customer Number: <%#Eval("CustomerNumber")%> </p><p>Customer Name : <%# Eval("CustomerName") %> </p> <p>Customer Type : <%# Eval("CustomerType") %> </p></legend>
                      
                    <telerik:RadGrid ID="rgContacts" runat="server" AllowFilteringByColumn="False"
                                            AllowPaging="False" AllowSorting="false" ClientSettings-AllowColumnHide="false"
                                            AutoGenerateColumns="False" ShowGroupPanel="false" ShowFooter="true" EnableHeaderContextMenu="false"
                                           OnNeedDataSource="RG_Contacts_NeedDataSource">
                                            <MasterTableView CommandItemDisplay="None">
                                                <RowIndicatorColumn>
                                                    <HeaderStyle Width="20px"></HeaderStyle>
                                                </RowIndicatorColumn>
                                                <ExpandCollapseColumn>
                                                    <HeaderStyle Width="20px"></HeaderStyle>
                                                </ExpandCollapseColumn>
                                                <Columns>
                                                    <telerik:GridBoundColumn DataField="CustomerNumber" HeaderText="CustomerNumber" UniqueName="CustomerNumber">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="FullName" HeaderText="FullName" UniqueName="FullName">
                                                    </telerik:GridBoundColumn>
                                                </Columns>
                                                <NoRecordsTemplate>
                                                    <asp:Label ID="lblNoTotalsRecords" runat="server" CssClass="LabelBold" Text="No records for the filtering selections you have chosen."></asp:Label>
                                                </NoRecordsTemplate>
                                            </MasterTableView>
                                        </telerik:RadGrid>            
                   </ItemTemplate>
  
                <ItemSeparatorTemplate>
                    <span style="color: Blue; font-weight: bold;">   ::   </span>
                </ItemSeparatorTemplate> 
  
           </telerik:RadListView>
  
          <asp:PlaceHolder ID="Addresses" runat="server"></asp:PlaceHolder>
      
  
</asp:Content>
using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
  
using System.Net.Mail;
using System.Collections.Generic;
using System.Text;
  
using JDEReporting.Code;
using Marlin.Utilities;
  
using System.Reflection;
  
namespace JDE.Reporting
{
    // Remember to change the name of the class here to be the same value as is used
    // in the inherit on the .aspx page.
    public partial class AddressBook : System.Web.UI.Page
    {
//      protected System.Web.UI.WebControls.Label lblTable;
        Marlin.JDE.AddressBook.cAddressBooks mcAddressBooks;
  
        protected void Page_Load(object sender, System.EventArgs e)
        {
  
            this.MaintainScrollPositionOnPostBack = true;
  
            if (!IsPostBack)
            {
                // Get the name of the routine we are currently running.
                MethodBase lmth = MethodBase.GetCurrentMethod();
                string lsRoutineName = lmth.DeclaringType + "." + lmth.Name;
  
                string lsReportName = MiscDBFuncs.GetReportTitle(Request.Url.Segments[Request.Url.Segments.Length - 1]);
                lblReportHeader.Text = lsReportName;
                Page.Title = lsReportName;
  
                mcAddressBooks = new Marlin.JDE.AddressBook.cAddressBooks(345183, Session["UserName"].ToString().Trim());
             }   
        }
  
        protected void RLV_Address_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
        {
            RLV_Address.DataSource = mcAddressBooks;
        }
  
        void RLV_Address_Item_ItemDataBound(object sender, RadListViewItemEventArgs e)
        {
            if (e.Item is RadListViewDataItem)
            {
                var grid = (RadGrid)e.Item.FindControl("RG_Contacts");
                grid.Rebind();
            }
        }
  
  
        protected void RG_Contacts_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            var parentItem = RLV_Address.NamingContainer as RadListViewDataItem;
  
            if (parentItem.DataItem == null)
                return;
              
            int intID = (int)parentItem.GetDataKeyValue("CustomerNumber");
  
            RadGrid rg_Contacts = (RadGrid)source;
            rg_Contacts.DataSource = mcAddressBooks[intID].AddressBookContacts;
        }
         


The error occurs in the Need Data source of the grid.   When I try to set the parentiem, it is set to a value of null, or nothing.
I wind up with an error at the if(parentItem.DataItem == null) section of the code telling me that parentiem is null. 

So, the code works for everything but this part, if I had code the intID to 0, and simply set the rg_Contacts.DataSource to mcAddressBooks[0].AddressBookContacts  I get it to display, but simply with the 0 index of the class.

I would appreciate any help.
Jack Voss
Top achievements
Rank 1
 answered on 31 Jan 2011
4 answers
1.1K+ views
I created a custom edit form, and I have a raddatepicker which I'd like to bind to a date type field in my database. 

 <telerik:RadDatePicker ID="dtStart" runat="server" Width="200px" SelectedDate='<%# Bind("StartDate") %>'/>

when I try to access th edit form I receive this "Specified cast is not valid" error. Some of the values int he database are Null. I don't know if that has anything to do with it. Please advise.
Jerry T.
Top achievements
Rank 1
 answered on 31 Jan 2011
2 answers
261 views
I've the following DataList:
<asp:DataList ID="dataListPhoto" runat="server" RepeatColumns="7" RepeatDirection="Horizontal" OnItemDataBound="dataListPhoto_ItemDataBound">
                <ItemTemplate>
                    <asp:Image ID="imgButton" runat="server" ImageUrl='<%# Eval("ImageUrl") %>' Width="32"
                        Height="32" userName='<%# Eval("User") %>' />
                </ItemTemplate>
            </asp:DataList>

And want to show a tooltip on each Image (imgButton):

<telerik:RadToolTipManager ID="ttm" Height="200px" Width="350px" HideEvent="LeaveTargetAndToolTip"
    RelativeTo="Element" Position="TopCenter" runat="server" Skin="Telerik" EnableShadow="true"
    Animation="Fade" ShowDelay="1000">
    <WebServiceSettings Method="GetHoveringText" Path="LinkHoveringAuthor.asmx"  />
</telerik:RadToolTipManager>

In my code-behind I try to add each Images to RadToolTipManager's TargetCollections:

protected void dataListPhoto_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        Image c = (Image) e.Item.FindControl("imgButton");
        string value = c.Attributes["userName"];
        ttm.TargetControls.Add(c.UniqueID, value, false);
    }

But the Tooltip is only displayed for the first Image....

2nd question: in my LinkHoveringAuthor.GetHoveringText method I try retrieve the userName:
var contextDictionary = (IDictionary<string, object>)context;
            if (contextDictionary["Value"] != null)
            {
                string name = contextDictionary["Value"].ToString();
...

It works, but backslashes are omitted... :-|
For example, here:
ttm.TargetControls.Add(c.UniqueID, value, false); 
if value="dom\user", in the webmethod, the "name" variable equals to "domuser"...
jc mag
Top achievements
Rank 1
 answered on 31 Jan 2011
5 answers
128 views
In this forum thread we're told that an appointment is 'All day' if the appointment starts at 12AM one day and ends at 12AM the next.

If I go to the Scheduler First Look demo and add an appointment in the all day section, the appointment is created with its start and end at 12AM on the SAME day. But if I edit one of the existing all day appointments, it is set up to start and end at 12AM on consecutive days.

What's right?

-- 
Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 31 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?