Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
130 views
I have a calendar with MultiviewColumns = "2". I need to be able to select dates using javascript. 

selectDate() works properly when there is only one calendar. But when I have MultiviewColumns="2", select date does not properly select the "same" dates in both calendars.

For instance.. the July calendar will also show Aug 1, 2, 3, 4, 5, 6, 7 etc. If I call selectDate on an August Date, it will select the date on the first calendar but not the second (which is the August Calendar). So basically the dates appear on both the july and august calendar but they only get selected on the july calendar. How do I fix this? I basically have a loop that selects a date range via javascript that Vlad has been helping me with. 

Thanks!


Maria Ilieva
Telerik team
 answered on 13 Jul 2010
0 answers
295 views
Hi,

I created a customized date-range slider (screenshot attached) in one of my projects that I would like to share and get feedback.

aspx markup:
<telerik:RadScriptBlock ID="radScriptBlock1" runat="server">
<script type="text/javascript">
function onClientValueChanging(sender, args)
    {
        if(!isSliding) return;
           //OADate origin is midnight, 30 December 1899                             
        var date = new Date('December 30,1899 00:00:00');
        date.setDate(date.getDate()+parseInt(args.get_newValue()));
        var tooltip = $find("<%= radToolTipSlider.ClientID %>");
        resetToolTipLocation(tooltip);
        var day  = date.getDate();
        var month = date.getMonth() + 1;
        var year = date.getFullYear();
        tooltip.set_text(day+'.'+month+'.'+year); // finnish-localized date format
    }
var isSliding = false;
function onClientSlideStart(sender, args)
    {
        isSliding = true;
 
        var tooltip = $find("<%= radToolTipSlider.ClientID %>");
        showRadToolTip(tooltip, sender);
    }
function onClientSlide(sender, args)
    {
        var tooltip = $find("<%= radToolTipSlider.ClientID %>");
        showRadToolTip(tooltip, sender);
    }
function onClientSlideEnd(sender, args)
    {
        isSliding = false;
 
        var tooltip = $find("<%= radToolTipSlider.ClientID %>");
        tooltip.hide();
    }
function showRadToolTip(tooltip, slider)
    {
        var activeHandle = slider.get_activeHandle();
        if(!activeHandle) return;
                    
        tooltip.set_targetControl(activeHandle);
        resetToolTipLocation(tooltip);
    }
function resetToolTipLocation(tooltip)
    {
        if (!tooltip.isVisible())
            tooltip.show();
        else
            tooltip.updateLocation();
    }
</script>
</telerik:RadScriptBlock>
<telerik:RadAjaxManager ID="radAjaxManager" runat="server">
<AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="radSliderDates">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="lblSliderStartDate" UpdatePanelRenderMode="Inline" />
            <telerik:AjaxUpdatedControl ControlID="lblSliderEndDate" UpdatePanelRenderMode="Inline" />
        </UpdatedControls>
    </telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="radAjaxLoadingPanel1" runat="server" />
<telerik:RadToolTip  ID="radToolTipSlider" runat="server" Position="TopCenter" OffsetY="3"
            ShowCallout="false" Height="20px" ShowEvent="FromCode" HideEvent="FromCode"></telerik:RadToolTip>
<div>
    <fieldset style="width:700px">
        <legend>Slider</legend>
        <table border="0" cellpadding="2" cellspacing="0">
            <tr>
                <td><asp:Label ID="lblSliderStartDate" runat="server" /></td>
                <td>
                    <telerik:RadSlider runat="server" ID="radSliderDates" IsSelectionRangeEnabled="true" Width="370"
                        AutoPostBack="true" ShowDecreaseHandle="false" ShowIncreaseHandle="false"
                         OnClientValueChanging="onClientValueChanging" OnClientSlideStart="onClientSlideStart" OnClientSlideEnd="onClientSlideEnd" OnClientSlide="onClientSlide" />
                </td>
                <td><asp:Label ID="lblSliderEndDate" runat="server" /></td>
            </tr>
        </table>
    </fieldset>
</div>

Code-behind (VB)
Private Sub InitDates()
        ' dtStart and dtEnd are fetched from db
        Dim dtStart As Date = CDate(getStartDate()).ToShortDateString
        Dim dtEnd As Date = CDate(getEndDate()).ToShortDateString
        lblSliderStartDate.Text = dtStart.ToShortDateString
        lblSliderEndDate.Text = dtEnd.ToShortDateString
        radSliderDates.MinimumValue = CInt(dtStart.ToOADate)
        radSliderDates.MaximumValue = CInt(dtEnd.ToOADate)
        radSliderDates.SelectionStart = CInt(dtStart.ToOADate)
        radSliderDates.SelectionEnd = CInt(dtEnd.ToOADate)
        radSliderDates.SmallChange = 1
    End Sub
 
Protected Sub radSliderDates_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles radSliderDates.ValueChanged
        Dim dtStart As Date = Date.FromOADate(radSliderDates.SelectionStart.ToString)
        Dim dtEnd As Date = Date.FromOADate(radSliderDates.SelectionEnd.ToString)
        lblSliderStartDate.Text = dtStart.ToShortDateString
        lblSliderEndDate.Text = dtEnd.ToShortDateString
    End Sub


In the project, the slider is used as a filter for ajaxified grid.
There might be some glitches in the code snippets due to the copy-paste-modify from the project. Sorry for that..

Telerik dll - 2010.1.309.35
Tested on FF 3.6.6, IE 8, Chrome 5, Safari 5

Comments are most welcome!

br,
eyal
eyal
Top achievements
Rank 1
 asked on 13 Jul 2010
6 answers
147 views
Hi,
 We've finally purchased the full version and have a license for the Rad Editor for Sharepoint - Yayy!

 I've gone through the upgrade instructions here and I'm still having a few problems with the web part being allowed through the safecontrols entries that I've added back into the web.config file. The error I'm getting is :-

Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe.
[UnsafeControlException: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe.]
  at Microsoft.SharePoint.ApplicationRuntime.SafeControls.GetTypeFromGuid(Guid guid)
  at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CreateWebPartsFromRowSetData(Boolean onlyInitializeClosedWebParts)


 On trying to correct this I've added all of the old safe controls lines into the web.config file as they were previously. Does it matter if they are after the new versions? The lines I've added back in are :-

<SafeControl Assembly="RadEditorSharePoint, Version=4.5.6.0, Culture=neutral, PublicKeyToken=1f131a624888eeed" Namespace="Telerik.SharePoint" TypeName="*" Safe="True" />
      <SafeControl Assembly="RadEditorSharePoint, Version=4.5.6.0, Culture=neutral, PublicKeyToken=1f131a624888eeed" Namespace="Telerik.SharePoint.FieldEditor" TypeName="*" Safe="True" />
      <SafeControl Assembly="RadEditorSharePoint, Version=4.5.6.0, Culture=neutral, PublicKeyToken=1f131a624888eeed" Namespace="Telerik.SharePoint.ListFieldEditor" TypeName="*" Safe="True" />

 I'm a bit unsure about what the instructions refer to in option 3, so I'm not sure if I'm missing a stage here or something. Can you advise please?

Thanks,
Jason.
Stanimir
Telerik team
 answered on 13 Jul 2010
1 answer
131 views
Hello. I want to place RadPanelBar in the popup of RadGrid Item.
Until i use simple tables i can get the RadGrid Item Values by

<%# DataBinder.Eval( Container, "DataItem.MyFieldName" ) %>


But once i try to access fields values from inside the RadPanelBar - i cant get them no more

Relevant code:
1. RadGrid markup:
<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" 
            AllowPaging="True" CssClass="RadGrid"
            AllowSorting="True" AutoGenerateColumns="False" ShowStatusBar="True" OnPreRender="RadGrid1_PreRender"
            OnNeedDataSource="RadGrid1_NeedDataSource" OnUpdateCommand="RadGrid1_UpdateCommand"
            OnInsertCommand="RadGrid1_InsertCommand" 
            OnDeleteCommand="RadGrid1_DeleteCommand" 
           AllowFilteringByColumn="True" Skin="WebBlue" 
           ondatabound="RadGrid1_DataBound" onitemdatabound="RadGrid1_ItemDataBound" 
           DataSourceID="odsQuestions" 
           ondetailtabledatabind="RadGrid1_DetailTableDataBind" 
           oneditcommand="RadGrid1_EditCommand" onitemcommand="RadGrid1_ItemCommand" onitemevent="RadGrid1_ItemEvent" 
            >
            <HeaderContextMenu EnableRoundedCorners="True">
            </HeaderContextMenu>
            <PagerStyle AlwaysVisible="True" ShowPagerText="False" />
            <MasterTableView EditMode="PopUp" Width="100%" CommandItemDisplay="Top" 
                DataKeyNames="QuestionIDunique" DataSourceID="odsQuestions" ShowHeadersWhenNoRecords="false">
                <CommandItemSettings AddNewRecordText="הוסף חדש" RefreshText="רענן" />
                <NoRecordsTemplate>אין נתונים להצגה</NoRecordsTemplate> 
                <Columns>
                    <telerik:GridBoundColumn UniqueName="QuestionIDunique" 
                        HeaderText="מס יחודי" DataField="QuestionIDunique" 
                        DataType="System.Int32" ReadOnly="True" SortExpression="QuestionIDunique">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="SerialQuestion" HeaderText="מס סידורי" 
                        DataField="SerialQuestion" DataType="System.Decimal" 
                        SortExpression="SerialQuestion">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="QuestionOfQuestionnaire" 
                        HeaderText="נוסח השאלה בשאלון" DataField="QuestionOfQuestionnaire" 
                        SortExpression="QuestionOfQuestionnaire">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="QuestionID" HeaderText="מס שאלה" 
                        DataField="QuestionID" SortExpression="QuestionID">
                    </telerik:GridBoundColumn>
                    <telerik:GridEditCommandColumn CancelText="בטל" EditText="ערוך" 
                        InsertText="הוסף" UpdateText="עדכן">
                    </telerik:GridEditCommandColumn>
                </Columns>
                <EditFormSettings CaptionDataField="QuestionIDunique" CaptionFormatString="edit: {0} " UserControlName="UC/UCQuestionsDetails.ascx" EditFormType="WebUserControl" PopUpSettings-Width="900px" PopUpSettings-Height="300px">
                    <EditColumn UniqueName="EditCommandColumn1">
                    </EditColumn>
                    <PopUpSettings Height="300px" Width="900px" modal="True"></PopUpSettings>
                </EditFormSettings>
                <PagerStyle AlwaysVisible="True" ShowPagerText="false"></PagerStyle>
            </MasterTableView>
        </telerik:RadGrid>




2. PopUp user control:
<telerik:RadPanelBar ExpandMode="SingleExpandedItem" runat="server" id="RadPanelBar1" dir="rtl" style="float: right;" Height="300px" Width="900px">
    <Items>
        <telerik:RadPanelItem Text="header1" Expanded="True" PreventCollapse="True" 
            Selected="True">
            <Items>
                <telerik:RadPanelItem >
                    <ItemTemplate>
                        <div id="divQuestionDetails">
           <asp:FormView ID="fvQuestionDetails" runat="server" DataSourceID="odsQuestionDetails" 
            DefaultMode="Edit">
            <EditItemTemplate>
    <table dir="rtl">
        <tr>
            <td>
                <table><tr>
                    <td> QuestionnaireId</td>
                    <td><asp:TextBox ID="txtQuestionnaireId" runat="server" Enabled="false" Text='<%# Bind("QuestionnaireID" ) %>'></asp:TextBox></td>
                </tr></table>
            </td>
            <td>

QuestionnaireID does not get value from grid.


Please Help
Thanks
Alon
Maria Ilieva
Telerik team
 answered on 13 Jul 2010
1 answer
99 views
Hi...

How do i find out which version of rad controls i am using?

I think it's q2 2009, but i am not sure...

Many thanks for help with such a mundane question

Shinu
Top achievements
Rank 2
 answered on 13 Jul 2010
1 answer
143 views

Hi,

 


I am implementing a multicolumn radcombo and I need to access indiviual column values. I saw from the demo that this can be acheived by setting attributes. and this I am trying to do in ItemDataBound event. But in ItemDatabound event e.Item.DataItem is null, Please have a look at the below code and let me know what could be the issue. The data is getting beinded to the drodown, but datatitem is null

ASPX CODe

 

<telerik:RadComboBox ID="RadComboBox1" runat="server" Width="150px"  HighlightTemplatedItems="true" CssClass="cmb_borderstyle"
                                        OnClientSelectedIndexChanged="onClientSelectedIndexChanged" 
                                        DropDownWidth="200px" EnableEmbeddedSkins="false" Skin="NextGen" CausesValidation="false" OnItemDataBound="RadComboBox1_ItemDataBound">
                                            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                                            <ItemTemplate>                                            
                                            <div class="cmb_ltFlt" style="width:100%">
                                                <div class="cmb_rdFnt cmb_ltFlt">
                                                    <%# DataBinder.Eval(Container.DataItem, "paymentTypeDesc") %>Item1</div>
                                                <div class="cmb_rdFnt cmb_ltFlt cmb_sp20">
                                                    <%# DataBinder.Eval(Container.DataItem, "delvOptionDesc")%>Row1 Col2</div>
                                                <div class="cmb_rdFnt cmb_ltFlt cmb_sp20">
                                                    <%# DataBinder.Eval(Container.DataItem, "serviceFQN") %>Row1 Col3</div>                                            
                                                </div>
                                                  
                                            </ItemTemplate>
                                        </telerik:RadComboBox>


C# Code

public class PaymentSelectionData 
    { 
        public string paymentTypeDesc { get; set; } 
        public string delvOptionDesc { get; set; } 
        public string serviceFQN { get; set; } 
        public string refVal { get; set; } 
    }
//Below logic is implemented in some method and called form PageLoad 
List<PaymentSelectionData> lstPmtSel = new List<PaymentSelectionData>(); 
    
for (int i = 1; i <= 5; i++) 
                    { 
                        pmtSelData = new PaymentSelectionData(); 
                        pmtSelData.paymentTypeDesc = "PaymentTypeDesc" + i.ToString(); 
                        pmtSelData.delvOptionDesc = "DelvOption" + i.ToString(); 
                        pmtSelData.serviceFQN = "ServiceFQN" + i.ToString(); 
                        pmtSelData.refVal = pmtSelData.paymentTypeDesc + "#" + pmtSelData.delvOptionDesc + "#" + pmtSelData.serviceFQN; 
                        lstPmtSel.Add(pmtSelData); 
    
} 
    
RadComboBox1.DataValueField = pmtSelData.refVal; 
                    RadComboBox1.DataTextField = "paymentTypeDesc"; 
    
                    RadComboBox1.DataSource = lstPmtSel; 
                    RadComboBox1.DataBind(); 
    
protected void RadComboBox1_ItemDataBound(object sender, RadComboBoxItemEventArgs e) 
        { 
            //row is null
            System.Data.DataRowView row = e.Item.DataItem as System.Data.DataRowView; 
}

 

 

public

 

class PaymentSelectionData

 

 

 

 

 

{

 

public string paymentTypeDesc { get; set; }

 

 

public string delvOptionDesc { get; set; }

 

 

public string serviceFQN { get; set; }

 

 

public string refVal { get; set; }

 

}

 

 

Simon
Telerik team
 answered on 13 Jul 2010
1 answer
97 views
Hi,

I am trying to load a document containing Hyperlinks into RadEditor. I have a issue here. When I place the cursor on the hyperlink, the cursor changes to a hand pointer in the Preview, and the URL is displayed in the status bar -- but when I click on the link, nothing happens. When I right click on the hyperlink and say "open", it is opening properly. And on subsequent direct clicks, the hyperlink is opening properly. How can I make this work on the first click itself?

Thanks,
Karu
Rumen
Telerik team
 answered on 13 Jul 2010
1 answer
79 views
When I try to add a word to dictionary it throws this error

Spell check Handler Server Error:500.

Rumen
Telerik team
 answered on 13 Jul 2010
5 answers
1.0K+ views
Hi,

I want to bind RadGrid from the serverside without using SQLDatasource binding. I want to bind 2 GridDropDownColumn in that RadGrid.

Thanks.
Veli
Telerik team
 answered on 13 Jul 2010
2 answers
101 views
We use Telerik's editor for EggHeadCafe's forum post editor.  When members copy/paste html from Visual Studio .NET .aspx pages, the editor inserts a bunch of unnecessary line breaks and in some cases, inserts <p> tags in appropriate places breaking up the html.

For instance, if I paste this in from our about us page, it looks fine in the editor but the html retrieved from the control is all hosed up.  You can duplicate this in your editor samples for the Q3 2009 release.  Most members won't bother to create a code snippet out of this.  Are there settings I can use to improve the results?

 

<asp:Content ID="Content4" ContentPlaceHolderID="MiddleContent" Runat="Server">

 

 

<table border="0" cellpadding="0" cellspacing="0" width="1250">

 

 

<tr><td align="left" valign="top" ><img src="/images/Neado/MasterTopBackGround.png" border="0" alt=""/></td></tr>

 

 

<tr><td align="center" valign="top" style="background: #FFFFFF url(/images/neado/homepage02.gif) repeat-y center top;">

 

 

<br />

 

 

<

 

table border="0" width="1190" cellspacing="4" cellpadding="3" align="center">

 

 

<tr><td align="left" valign="top"><b>Welcome to EggHeadCafe.com!</b></td></tr>

 

<

 

tr><td align="left">EggHeadCafe was founded in 2000 by Microsoft Visual C# MVP's Peter Bromberg and Robbe Morris.&nbsp;&nbsp;This site is dedicated to providing you with information on the latest technologies.&nbsp;&nbsp;Everything from great C#, VB.NET, SQL Server, ADO.NET, ASP.NET, ASP, and JavaScript articles to product and book reviews are available to help you become the best software developer you can be.&nbsp;&nbsp;We've also got some of the best forums around to provide immediate answers to your tough questions.&nbsp; Our own subject matter experts will attempt to answer your question if our regular members don't get to you first.</td></tr>

 

 

<tr><td align="left">We do not take technical questions via email.&nbsp;&nbsp;If you have a business related question or a comment regarding your experience at EggHeadCafe, feel free to contact us at <a href="mailto:info@eggheadcafe.com?subject=EggHeadCafe%20Site%20Inquiry&cc=pbromberg@yahoo.com">info@eggheadcafe.com</a>.</td></tr>

 

 

 

 

<tr><td align="left">If you would like to ask a technical or programming question, please feel free to visit our <asp:HyperLink ID="HyperLink33333" runat="server" NavigateUrl="~/forum.aspx" Text="messageboard" />.</td></tr>

 

 

<tr><td><br /></td></tr>

 

<

 

tr><td align="left"><b>Subject Matter Experts Needed!</b></td></tr>

 

Rumen
Telerik team
 answered on 13 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?