Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
73 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
226 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
78 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
96 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
124 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.0K+ 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
205 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
71 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
1 answer
86 views
I use RadEditorMOSS_5_8_4_Dev on WSS 3.0. I changed ListToolsFile.xml file:
<configuration>
<property name="EditModes">Design</property>
<property name="Height">240px</property>
<property name="Width">100%</property>
<property name="EnableResize">false</property>
</configuration>
The RadEditor render Design and Preview mode. Could you tell why RadEditor doesn't render only Design mode?

I found the answer in this post:
http://www.telerik.com/community/forums/sharepoint-2007/full-featured-editor/cannot-remove-preview-tab.aspx
Stanimir
Telerik team
 answered on 31 Jan 2011
17 answers
753 views
Hi,

I have a RadGrid with GridDateTimeColumn as below.

<rad:GridDateTimeColumn DataField="Date1" UniqueName="Date1" EditFormColumnIndex="0" DataFormatString="{0:d}" >
</rad:GridDateTimeColumn>   

How can i check whether the entered date by user in the dateinput textbox is greater than or equal to todays date?Note user enters the date value instead of selecting from the datepicker

How can i have validations to the column during inserting and updating a record?

Regards

Jack
Iana Tsolova
Telerik team
 answered on 31 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?