Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
188 views
I am trying to change the point marks in my spline chart to an image with no success. Is this possible?

I have made a simple program to show what I mean:

<telerik:RadChart ID="RadChart1" runat="server"> 
        <Series> 
            <telerik:ChartSeries Type="Spline"> 
                <Appearance> 
                    <TextAppearance TextProperties-Font="Arial, 8.25pt" /> 
                    <PointMark Visible="True" Dimensions-AutoSize="false" Dimensions-Height="10px" Dimensions-Width="10px"> 
                        <FillStyle MainColor="#FF0000" FillType="solid"> 
                        </FillStyle> 
                    </PointMark> 
                    <LineSeriesAppearance Width="5" /> 
                    <FillStyle MainColor="#999999" FillType="Solid"> 
                    </FillStyle> 
                </Appearance> 
                <Items> 
                    <telerik:ChartSeriesItem YValue="1.3" ActiveRegion-Tooltip="test" > 
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem YValue="6"> 
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem YValue="2"> 
                    </telerik:ChartSeriesItem> 
                    <telerik:ChartSeriesItem YValue="8"> 
                    </telerik:ChartSeriesItem> 
                </Items> 
            </telerik:ChartSeries> 
        </Series> 
    </telerik:RadChart> 

I would like to change the red point marks to different images depending to the x value, probably in ItemDataBound.

Best regards,
Andreas


Quantesys IT
Top achievements
Rank 1
 answered on 21 Oct 2009
1 answer
103 views
Hello,

I followed the online documentation and have almost got the grid populating from an XML file. The problem is although the grid is finding the nodes via the DataKeyName I have set, it is not reading the child nodes of that node it has found. So I am getting 10 empty rows, which is currently the right number of Topics/XML nodes. Here is my code to try to explain further:

XML
<Topics> 
  <Topic TopicId="1"> 
    <TopicName>Test</TopicName> 
    <Categories> 
      <Category>Category 1</Category> 
      <Category>Category 2</Category> 
    </Categories> 
    <FileName>Test.html</FileName> 
  </Topic> 
</Topics> 

HTML
<telerik:RadGrid ID="gridLearningList" runat="server"> 
                    <MasterTableView AutoGenerateColumns="false" DataKeyNames="TopicId"> 
                   <Columns> 
                     <telerik:GridBoundColumn 
                        DataField="TopicName" 
                        HeaderText="Learning topic"> 
                     </telerik:GridBoundColumn> 
                     <telerik:GridBoundColumn 
                        DataField="Categories" 
                        HeaderText="Category"> 
                     </telerik:GridBoundColumn> 
                     <telerik:GridBoundColumn 
                        DataField="FileName" 
                        HeaderText="File name"> 
                     </telerik:GridBoundColumn> 
                   </Columns> 
                 </MasterTableView> 
                    </telerik:RadGrid> 
                    <asp:XmlDataSource ID="dsLearningList" runat="server" /> 

C#
private void PopulateLearningList() 
    { 
        dsLearningList.DataFile = "~/App_Data/OnlineLearningTopics.xml"; 
        gridLearningList.DataSourceID = "dsLearningList"; 
        gridLearningList.DataBind(); 
    } 

How do I bind each column to the child node (i.e. TopicName) of the node it has found (i.e. Topic). Surely it is just a case of mapping it correctly somehow?

Thanks,

Michael
Princy
Top achievements
Rank 2
 answered on 21 Oct 2009
1 answer
161 views
Hi Support,

I am using a RadGrid with a user control edit form built in.  The RadGrid is ajaxified. 
The problem is when I cancel the insert event with e.Canceled = true the user control is refreshed to its initial settings minus the defaults.  Thus, wiping out the values selected in the dropdown items.  Not only this, but I noticed on a different form with a similar set up that the controls that were programmatically hidden in the user control are shown after the insert event! 

The behavior I would like to see is for the dropdowns to remain populated as they were before the insert is attempted.  The problem is I cannot allow the insert to go forward and must display validation. the validation that I have set up on the insert event indicates that the user has not properly filled in all the fields I set e.canceled = true to stop the grid from going out of edit mode.  Yet, if i attempt to rebind the control the user control refreshes in a way that loses all the data. 

I am pretty perplexed about this issue and don't know what to do to resolve it.  Let me know if there is any other information I can give to help.

Thanks for your help.  See code snippets below. 

Here is my RadGrid definition:
        <asp:Panel ID="pnlRadGrid" runat="server" style="table-layout:fixed" > 
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" PageSize="8" 
                AllowSorting="True" AllowPaging="True" AllowMultiRowSelection="False" 
                OnNeedDataSource="RadGrid1_NeedDataSource" 
                OnItemCommand="RadGrid1_ItemCommand"    
                OnInsertCommand="RadGrid1_InsertCommand"   
                OnUpdateCommand="RadGrid1_UpdateCommand" 
                OnItemCreated="RadGrid1_ItemCreated" 
                > 
                <PagerStyle Mode="NextPrevNumericAndAdvanced" HorizontalAlign="Center" /> 
                <MasterTableView EnableTheming="false" InsertItemPageIndexAction="ShowItemOnCurrentPage" InsertItemDisplay="Bottom" DataKeyNames="ProcessingSystemResponseKey" Width="100%" GridLines="None" AllowMultiColumnSorting="True" 
                      CommandItemDisplay="Bottom" TableLayout="Auto" ShowHeadersWhenNoRecords="true">  
                    <Columns> 
                        <telerik:GridTemplateColumn> 
                            <ItemTemplate> 
                                <asp:Button runat="server" CommandName="Edit" CssClass="rgEdit" ToolTip="Edit" /> 
                            </ItemTemplate>   
                        </telerik:GridTemplateColumn> 
                        <telerik:GridTemplateColumn  
                           DataField="ProcessingSystemResponseKey" 
                           HeaderText="Key" 
                           SortExpression="ProcessingSystemResponseKey"   
                           UniqueName="ProcessingSystemResponseKey">  
                         <ItemTemplate> 
                           <a href="javascript: void(0)" 
                              onclick="window.open('<%# GetHelpFileUrl(Eval("HelpTopicFile")) %>'); return false;">  
                           <%# Eval("ProcessingSystemResponseKey")%> 
                           </a>     
                        </ItemTemplate> 
                        </telerik:GridTemplateColumn>                           
                        <telerik:GridBoundColumn UniqueName="InpatientResultKindDesc" SortExpression="InpatientResultKindDesc" HeaderText="Inpatient Result" 
                            DataField="InpatientResultKindDesc">  
                        </telerik:GridBoundColumn>                     
                        <telerik:GridBoundColumn UniqueName="OutPatientResultKindDesc" SortExpression="OutPatientResultKindDesc" HeaderText="Outpatient Result" 
                            DataField="OutPatientResultKindDesc">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn UniqueName="Description" SortExpression="Description" 
                            HeaderText="Description" DataField="Description">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridCheckBoxColumn UniqueName="OverrideFlag" SortExpression="OverrideFlag"   
                            HeaderText="Allow MASTRRâ„¢ Agency To Change" DataField="OverrideFlag">  
                        </telerik:GridCheckBoxColumn>                        
                    </Columns> 
                    <EditFormSettings UserControlName="../AdminUC/ManageAdjudicationErrorsUC.ascx" EditFormType="WebUserControl">  
                     </EditFormSettings> 
                <CommandItemSettings AddNewRecordText=""   
                                     RefreshText="" />                       
                </MasterTableView> 
                <ClientSettings AllowKeyboardNavigation="True">    
                    <Selecting AllowRowSelect="False" />    
                </ClientSettings> 
    
        </telerik:RadGrid> 

Here is my Insert Command Eventbelow:
    /// <summary>  
    /// The insert event.  Occurs when user clicks the insert button on the insert form.  
    /// </summary>  
    /// <param name="source"></param>  
    /// <param name="e"></param>  
    protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)  
    {  
        // Obtain the usercontrol from the grid's property  
        UserControl uc = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);  
 
        // Create object to store and validate   
        AdjudicationErrors adjudicationErrors = new AdjudicationErrors();  
          
        // Obtain array to iterate through to determine if inserted primary key is unique.  
        String [] gridKeys = e.Item.OwnerTableView.DataKeyNames;  
 
        // Validate and Assign values   
        if (CheckSetProperFields(uc, adjudicationErrors, gridKeys))  
        {  
            try 
            {  
                // Insert the database record  
                Boolean success = AdjudicationErrors.SaveAdjudicationErrors(adjudicationErrors);  
            }  
            catch (Exception)  
            {  
                e.Canceled = true;  
                throw;  
            }  
 
        }  
        else   
        {  
            e.Canceled = true;  
 
            // Because of the combos the user control doesn't obtain the dropdowns unless the item is   
            // re-obtained  
            GridEditableItem insertedItem = e.Item.OwnerTableView.GetInsertItem();  
 
            //Format the grid's insert form  
            SetInsertProperties(insertedItem);  
            insertedItem.OwnerTableView.Rebind();  
 
        } 

Josh
Mira
Telerik team
 answered on 21 Oct 2009
2 answers
140 views
When i check the list in debug, it is filled correctly and then it is

Here is the code:
aspx:
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <div>
    <telerik:RadMenu runat="server" ID="CategoriesMenu" Skin="Black"
    DataTextField="Title" DataFieldID="Id"
            DataSourceID="objectDS" DataFieldParentID="ParentId"
            DataNavigateUrlField="Id" DataValueField="Id" AppendDataBoundItems="True">
    </telerik:RadMenu>
    <asp:GridView runat="server" ID="TestGrid"></asp:GridView>
    </div>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server"
        ContextTypeName="IpitchitWebsiteModel.IpitchitWebsiteModelDataContext"
        Select="new (Id, ParentID, Title)" TableName="Categories">
    </asp:LinqDataSource>
    <asp:ObjectDataSource runat="server" ID="objectDS" SelectMethod="GetTreeByParent"
    TypeName="IpitchitWebsiteModel.DataRepository.CategoryRepositoy">
    <SelectParameters>
        <asp:Parameter Name="id" Type="Int32" DefaultValue="10" />
        <asp:Parameter Name="visibility" Type="Int32" DefaultValue="0" />
        <asp:Parameter Name="showRootCategory" Type="Boolean" DefaultValue="false" />
    </SelectParameters>
    </asp:ObjectDataSource>
cs:
        [DataObjectMethodAttribute(DataObjectMethodType.Select, true)]
        public List<Categories_GetTreeByParentResult> GetTreeByParent(int? id, int visibility, bool showRootCategory)
        {
            return db.Categories_GetTreeByParent(id, visibility, showRootCategory).ToList();
        }

from dbml:
    public partial class Categories_GetTreeByParentResult 
    { 
         
        private System.Nullable<int> _Id; 
         
        private System.Nullable<int> _ParentId; 
         
        private string _Title; 
         
        private string _Description; 
         
        private System.Nullable<int> _Ordering; 
         
        private System.Nullable<System.DateTime> _CreatedDate; 
         
        private string _CreatedBy; 
         
        private System.Nullable<System.DateTime> _ModifiedDate; 
         
        private string _ModifiedBy; 
         
        private System.Nullable<bool> _IsSearchable; 
         
        private System.Nullable<byte> _VisiblityIndex; 
         
        private System.Nullable<int> _RecursionLevel; 
         
        private string _Path; 
         
        public Categories_GetTreeByParentResult() 
        { 
        } 
         
        [Column(Storage="_Id", DbType="Int")] 
        public System.Nullable<int> Id 
        { 
            get 
            { 
                return this._Id; 
            } 
            set 
            { 
                if ((this._Id != value)) 
                { 
                    this._Id = value; 
                } 
            } 
        } 
         
        [Column(Storage="_ParentId", DbType="Int")] 
        public System.Nullable<int> ParentId 
        { 
            get 
            { 
                return this._ParentId; 
            } 
            set 
            { 
                if ((this._ParentId != value)) 
                { 
                    this._ParentId = value; 
                } 
            } 
        } 
         
        [Column(Storage="_Title", DbType="NVarChar(250)")] 
        public string Title 
        { 
            get 
            { 
                return this._Title; 
            } 
            set 
            { 
                if ((this._Title != value)) 
                { 
                    this._Title = value; 
                } 
            } 
        } 
         
        [Column(Storage="_Description", DbType="NVarChar(300)")] 
        public string Description 
        { 
            get 
            { 
                return this._Description; 
            } 
            set 
            { 
                if ((this._Description != value)) 
                { 
                    this._Description = value; 
                } 
            } 
        } 
         
        [Column(Storage="_Ordering", DbType="Int")] 
        public System.Nullable<int> Ordering 
        { 
            get 
            { 
                return this._Ordering; 
            } 
            set 
            { 
                if ((this._Ordering != value)) 
                { 
                    this._Ordering = value; 
                } 
            } 
        } 
         
        [Column(Storage="_CreatedDate", DbType="SmallDateTime")] 
        public System.Nullable<System.DateTime> CreatedDate 
        { 
            get 
            { 
                return this._CreatedDate; 
            } 
            set 
            { 
                if ((this._CreatedDate != value)) 
                { 
                    this._CreatedDate = value; 
                } 
            } 
        } 
         
        [Column(Storage="_CreatedBy", DbType="NVarChar(50)")] 
        public string CreatedBy 
        { 
            get 
            { 
                return this._CreatedBy; 
            } 
            set 
            { 
                if ((this._CreatedBy != value)) 
                { 
                    this._CreatedBy = value; 
                } 
            } 
        } 
         
        [Column(Storage="_ModifiedDate", DbType="SmallDateTime")] 
        public System.Nullable<System.DateTime> ModifiedDate 
        { 
            get 
            { 
                return this._ModifiedDate; 
            } 
            set 
            { 
                if ((this._ModifiedDate != value)) 
                { 
                    this._ModifiedDate = value; 
                } 
            } 
        } 
         
        [Column(Storage="_ModifiedBy", DbType="NVarChar(50)")] 
        public string ModifiedBy 
        { 
            get 
            { 
                return this._ModifiedBy; 
            } 
            set 
            { 
                if ((this._ModifiedBy != value)) 
                { 
                    this._ModifiedBy = value; 
                } 
            } 
        } 
         
        [Column(Storage="_IsSearchable", DbType="Bit")] 
        public System.Nullable<bool> IsSearchable 
        { 
            get 
            { 
                return this._IsSearchable; 
            } 
            set 
            { 
                if ((this._IsSearchable != value)) 
                { 
                    this._IsSearchable = value; 
                } 
            } 
        } 
         
        [Column(Storage="_VisiblityIndex", DbType="TinyInt")] 
        public System.Nullable<byte> VisiblityIndex 
        { 
            get 
            { 
                return this._VisiblityIndex; 
            } 
            set 
            { 
                if ((this._VisiblityIndex != value)) 
                { 
                    this._VisiblityIndex = value; 
                } 
            } 
        } 
         
        [Column(Storage="_RecursionLevel", DbType="Int")] 
        public System.Nullable<int> RecursionLevel 
        { 
            get 
            { 
                return this._RecursionLevel; 
            } 
            set 
            { 
                if ((this._RecursionLevel != value)) 
                { 
                    this._RecursionLevel = value; 
                } 
            } 
        } 
         
        [Column(Storage="_Path", DbType="VarChar(2000)")] 
        public string Path 
        { 
            get 
            { 
                return this._Path; 
            } 
            set 
            { 
                if ((this._Path != value)) 
                { 
                    this._Path = value; 
                } 
            } 
        } 
    } 


So when i remove parentid parameter DataFieldParentID menu control will work. Otherwise not. This looks to me as bug.


Yana
Telerik team
 answered on 21 Oct 2009
1 answer
127 views

Hi ,

My team is using telerik liscenced version .
We are using telerik ajax update panel  for  telerik tab strip for better performance.
We have 3 tabs and each tab is having one rad grid.
Also we are using 
<
ClientEvents OnGridCreated = "GridCreatedAlternateIdTab" />
for fixing grid width & height in each tab grids.
As we are using 
RenderSelectedPageOnly

="true"

in multipage so  when ever we are clicking on any tab "Microsoft JScript runtime error: 'GridCreatedAlternateIdTab' is undefined " javascript error is poping up.

Meansit is not able to find OnGridCreated = "GridCreatedAlternateIdTab" javascript method.

Can you please provide a work around for this javascript error.

Below is the main tabstrip code.

<
table id="Table3" runat="server" width="100%" height="50%" style="background-color: #FFFFFF;">
<tr>
 
<td style="background-color: #FFFFFF">
 
<div id="dvMessage" style="display: none" runat="server">
 
<asp:Label ID="lblMessage" runat="server" Font-Bold="true" CssClass="ErrorMessage"

BorderStyle="None"></asp:Label>
 

</div>

</td>

</

tr>

<
td align="left">

<telerik:RadTextBox ID="radTextBoxParentId" runat="server" Skin="Office2007" InvalidStyleDuration="100"
 
Width="75%" BorderStyle="Inset">
 
</telerik:RadTextBox>

<asp:ImageButton ID="imgParentIdLookUp" CausesValidation="false" runat="server" OnClientClick="return ParentIdLookup();"

ImageUrl="../Resources/Images/lookup.png" ImageAlign="AbsMiddle" OnClick="imgParentIdLookUp_Click" />
 
</td>
 
<tr>
<td colspan="5">

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

<AjaxSettings>

<telerik:AjaxSetting AjaxControlID="radTabStrip">
 

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

<telerik:AjaxUpdatedControl ControlID="radMultiPage" LoadingPanelID="LoadingPanel1" />
 
</UpdatedControls>
 

</telerik:AjaxSetting>

<telerik:AjaxSetting AjaxControlID="radMultiPage">
 
<UpdatedControls>
 
<telerik:AjaxUpdatedControl ControlID="radMultiPage" LoadingPanelID="LoadingPanel1" />
 
</UpdatedControls>
 
</telerik:AjaxSetting>
 
</AjaxSettings>
 

</telerik:RadAjaxManager>

<telerik:RadTabStrip ID="radTabStrip" runat="server" SelectedIndex="0" Width="135%"

AutoPostBack="True" Skin="Office2007" MultiPageID="radMultiPage" CausesValidation="False"
 
OnTabClick="radTabStrip_TabClick">
 
<Tabs>
 
<telerik:RadTab runat="server" Text="Contacts" Width="7%" Enabled="true" PageViewID="radPageContact">
 
</telerik:RadTab>

<telerik:RadTab runat="server" Text="Delivery Hours" Width="9%" Enabled="true" PageViewID="radPageViewDeliveryHours">
 
</telerik:RadTab>

<telerik:RadTab runat="server" Text="Pickup Hours" Width="9%" Enabled="true" PageViewID="radPageViewPickUpHours">

</telerik:RadTab>

</Tabs>

</telerik:RadTabStrip>

<telerik:RadMultiPage ID="radMultiPage" SelectedIndex="0" runat="server" BorderWidth="2px"

BorderColor="Black" BackColor="White" RenderSelectedPageOnly="true">

<telerik:RadPageView ID="radPageContact" runat="server">
 
<asp:Panel ID="panelRadPageContact" runat="server" Width="350px">
 
<UserControl:ContactSetup ID="ucContact" runat="server" />
 
</asp:Panel>
 
</telerik:RadPageView>
 
<telerik:RadPageView ID="radPageViewDeliveryHours" runat="server">
 
<asp:Panel ID="panelRadPageDeliveryHours" runat="server">
 
<UserControl:DeliverHoursTab ID="ucDelivery" runat="server" />
 
</asp:Panel>
 
</telerik:RadPageView>
 
<telerik:RadPageView ID="radPageViewPickUpHours" runat="server">
 

<asp:Panel ID="panelradpageviewpickuphours" runat="server">
 
<UserControl:pickuphourstab id="ucpickup" runat="server" />
 
</asp:Panel>
 

</telerik:RadPageView>
 

</telerik:RadMultiPage>

</td>
 
</tr>

<tr>

<td>

</td>

</tr>
 
</table>
 

 

 

 

Paul
Telerik team
 answered on 21 Oct 2009
1 answer
106 views
I'm trying to move a RadAjaxPanel to another element via JavaScript and while I'm able to move it around, I've noticed that once you move the RadAjaxPanel using its ClientID property (RadAjaxPanel1.ClientID) the CallBack functionality disappears and anything within it causes a PostBack.

I tooled around with the sourcecode of a rendered page and I noticed that the RadAjaxPanel wraps itself in another div, so if I get the parentNode and move it the CallBack functionality is retained. The issue here is that as soon as I select something, everything within the panel resets back to default.

Here is the relevant part of the JavaScript I'm using:
var ModalBox = new function() 
{ 
    this._PreviousParentID = null; 
    this._PreviousContentID = null; 
 
    this.DisplayAjaxContents = function(id) 
    { 
        this.TakeContent(document.getElementById(id).parentNode.id); 
    }; // DisplayAjaxContents(id) 
    this.TakeContent = function(id) 
    { 
        ModalBox._PreviousContentID = id; 
        ModalBox._PreviousParentID = document.getElementById(id).parentNode.id; 
        var c = ModalBox.GetModalContentObject(); 
        c.appendChild(document.getElementById(id).parentNode.removeChild(document.getElementById(id))); 
    }; // TakeContent(id) 
    this.ReplaceContent = function() 
    { 
        var c = ModalBox.GetModalContentObject(); 
        var pp = document.getElementById(ModalBox._PreviousParentID); 
        pp.appendChild(c.removeChild(document.getElementById(ModalBox._PreviousContentID))); 
        ModalBox._PreviousParentID = null; 
        ModalBox._PreviousContentID = null; 
    }; // ReplaceContent() 
}; 
(Note: I've also tried using element.cloneNode(true) to transfer the RadAjaxPanel, but the result is the same--callback is maintained but it just resets itself.)

The ascx control has this:
<div>I am currently <asp:HyperLink ID="hlStatus" runat="server" />.</div> 
<div id="SingleSignInOut_Self_Hidden" style="display: none;"> 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"> 
        <table style="width: 100%;"> 
            <tr> 
                <td style="width: 30%;"><b>Status</b></td> 
                <td style="width: 30%;"><b>Reason</b></td> 
                <td style="width: 40%;"><b>Details</b></td> 
            </tr> 
            <tr> 
                <td> 
                    <asp:RadioButtonList ID="rblStatus" runat="server" AutoPostBack="true" OnSelectedIndexChanged="Status_Select"> 
                        <asp:ListItem Text=" In" Value="1" /> 
                        <asp:ListItem Text=" Out" Value="2" /> 
                        <asp:ListItem Text=" Extended" Value="3" /> 
                    </asp:RadioButtonList> 
                </td> 
                <td> 
                    <asp:RadioButtonList ID="rblReason" runat="server" /> 
                </td> 
                <td> 
                 
                </td> 
            </tr> 
        </table> 
    </telerik:RadAjaxPanel> 
</div> 

The ascx codebehind has:
    protected void Page_Load(object sender, EventArgs e) 
    { 
        if (!IsPostBack) { Load_Vars(); } 
    } 
    protected void Load_Vars() 
    { 
        hlStatus.NavigateUrl = "javascript:void(ModalBox.DisplayAjaxContents('" + RadAjaxPanel1.ClientID + "'));"; 
        hlStatus.Text = "signed out"; 
    } 
 
    protected void Status_Select(object sender, EventArgs e) 
    { 
         
    } 
 

Anyone have any suggestions?
Tsvetoslav
Telerik team
 answered on 21 Oct 2009
1 answer
122 views

page that I use within a window. if I add the FormDecorator to the page, I cannot hit the enter key to force the click event.

Is there something inherent wihin the Office2007 skin that prevents the Enter key on buttons?  Or is this something with RadDecorator in general?

I am setting the global skin in the web.config.

Simple page:

 

<%

@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %>

 

 

 

<!

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<

 

html xmlns="http://www.w3.org/1999/xhtml" >

 

<

 

head runat="server">

 

 

 

 

 

<title>Untitled Page</title>

 

</

 

head>

 

<

 

body>

 

 

 

 

 

<form id="form1" runat="server">

 

 

 


<
telerik:RadScriptManager ID="RadScriptManager1" runat="server">

 

 

 

 

 

</telerik:RadScriptManager>

 

 

 

 

 

<div id="divMain">

 

 

 

 

 

<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecorationZoneID="divMain" />

 

 

 

 

 

<asp:Button ID="Button1" runat="server" Text=".net button" /></div>

 

 

 

 

 

</form>

 

</

 

body>

 

</

 

html>

 

Georgi Tunev
Telerik team
 answered on 21 Oct 2009
1 answer
517 views
Dear Telerik,

I'm trying to let one RadDateTimePicker communicate with another RadDateTimePicker; when I change the date and or time in the first control, I want to calculate the difference between the old and the new value and pass the difference to the other RadDateTimePicker, so I did the following:

In my AppFormView I created two RadDateTimePickers:

<telerik:RadDateTimePicker ID="rdtpAppointments_StartTime" SelectedDate='<%# Bind("StartedOn") %>' runat="server">  
  <DateInput> 
    <ClientEvents OnValueChanged="OnDateSelected" /> 
  </DateInput> 
</telerik:RadDateTimePicker> 

And
<telerik:RadDateTimePicker ID="rdtpAppointments_EndTime" runat="server" SelectedDate="<%# Bind('EndedOn') %>" /> 

I wrote the following Javascript code:

function OnDateSelected(sender, eventArgs) {  
    var endTimePicker = document.getElementById('<%= AppFormView.FindControl("rdtpAppointments_EndTime").ClientID%>'); ;  
 
    var newValue = new Date(eventArgs.get_newDate());  
    var oldValue = new Date(eventArgs.get_oldDate());  
    var difference = Math.round((newValue - oldValue) / 86400000);  
 
    var oldDate = new Date(endTimePicker.get_selectedDate())  
    var newDate = oldDate.setDate(oldDate.getDate()+difference);  
 
    endTimePicker.set_selectedDate() = newDate;      
  } 

In short it retrieves the old and new date for the first combobox, it calculates the difference in days and then I want to retrieve the current date selected in the RadDateTimePicker and add the same difference to it.

Only, I get the following error: endTimePicker.get_selectedDate is not a function, on the "var oldDate"-line.

What am I doing wrong?! When I look here, get_selectedDate is simply documented...


Shinu
Top achievements
Rank 2
 answered on 21 Oct 2009
10 answers
228 views
Hi there,

When using the Document Manager to insert links to documents, sometimes we want to update an existing link in the content also. When you position the cursor over a hyperlink and select a new document with the Doc Mgr, the default behaviour overwrites the entire A structure with a simple A tag. Some of our links have CSS Classes attached, an image as part of the link, etc.

Is there any solution to make this slightly more intelligent when updating an existing link?

Thanks
Gavin
Lini
Telerik team
 answered on 21 Oct 2009
2 answers
290 views
Hi there

I want to use a NestedViewTemplate in a RadGrid and then selectively display information depending on the status of a specific field.

I am working on a project where I want to display data, but depending on the type of entry (specified in a specific field) I need to show or hide some fields, or preferably templates in different panels.

e.g.

Type: Car
Engine: 2000cc
Color: Metalic Blue

Type: Bicycle
Color: Blue

Type: Motorcycle
Engine: 1000cc
Color: Red

In the second case (Type: Bicycle), the "Engine" field is not applicable, so I want to be able to hide it.

Any suggestions as to how this can be done?

One possibility is to hide the table row, another is to have different panels with a unique template in each and then show or hide the panels depending on the the value in the "Type" field.  I would prefer this kind of approach, if possible.

How can this be achieved?

Thanks.

Gerrit
Gerrit du Preez
Top achievements
Rank 1
 answered on 21 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?