Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
185 views
Hi all,

If I set RadCalendar's property EnableMultiSelect to true it select multiple dates with only "mouse click". But I want  multiple date selection with "control key hold + mouse click" and single date selection with "mouse click". 

I searched this but could not find this functionality, please guide me in this respect.


Regards, 
Kash
Kevin
Top achievements
Rank 2
 answered on 24 Nov 2011
2 answers
37 views
Hey all,

is there a way to format the date so that the first day of the month does not contain the month name? So instead of:

01 Nov

it would only display:

01

Thanks,
Dan
Dan
Top achievements
Rank 1
 answered on 24 Nov 2011
1 answer
49 views
Can anyone help me explain why when I rate my items the actual average rating is not being updated???
(I used the rating + comments demo as the foundation for this code)


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Get ratings and display on page
        Dim tbRatings As DataTable = New IMCSelect().getRatings(-1, 8, Request.QueryString("ID"), 1, 0, Application("logMaterials")).Tables(0)
        Dim Sum As Single
        For Each dr As DataRow In tbRatings.Rows
            If dr.RowState <> DataRowState.Deleted Then
                Sum += Convert.ToInt32(dr("Rating"))
            End If
        Next
  
        Dim iAvgRating As Single = 0
        If tbRatings.Rows.Count <> 0 Then
            iAvgRating = Math.Round(Sum / tbRatings.Rows.Count, 2)
            lblAvgRating.Text = iAvgRating
        End If
  
        Dim tbComments As DataTable = New IMCSelect().getRatings(-1, 8, Request.QueryString("ID"), 1, 0, Application("logPublications")).Tables(0)
        Dim comments = From r In tbComments.AsEnumerable Where r.Field(Of String)("RatingComments") <> "" Select r
        If comments.Count() <> 0 Then
            tbComments = comments.CopyToDataTable()
        Else
            tbComments.Rows.Clear()
        End If
  
        hlComments.Text = "View comments"
        hlComments.NavigateUrl = "Javascript:ViewComments(" & Request.QueryString("ID") & ");"
  
        If tbComments.Rows.Count() <> 0 Then
            divComments.Style.Add("display", "block;")
        Else
            divComments.Style.Add("display", "none;")
        End If
End Sub
  
Private Property Rating() As Dictionary(Of String, Decimal)
        Get
            Dim varRating As Dictionary(Of String, Decimal) = DirectCast(ViewState("Rating"), Dictionary(Of String, Decimal))
            If [Object].Equals(varRating, Nothing) Then
                varRating = New Dictionary(Of String, Decimal)()
                varRating("sum") = 0
                varRating("counter") = 0
            End If
            Return varRating
        End Get
        Set(ByVal value As Dictionary(Of String, Decimal))
            ViewState("Rating") = value
        End Set
    End Property
  
    Protected Sub btnPostComment_Click(ByVal sender As Object, ByVal e As EventArgs)
        Dim iRatingID As Integer
        iRatingID = New IMCInsert().addRating(RadRating1.Value, txtComments.Text, 8, Request.QueryString("ID"), Session("RBPOnline_UserID"), Application("logMaterials"))
        txtComments.Text = ""
        'Close tooltip
        Dim str As String = "CloseToolTip1();"
        ScriptManager.RegisterClientScriptBlock(Me.Page, GetType(Page), "closeTooltip", str, True)
  
    End Sub
  
    Protected Sub RadRating1_Rate(ByVal sender As Object, ByVal e As EventArgs)
        Dim currentRating As Dictionary(Of String, Decimal) = Rating
        currentRating("sum") = currentRating("sum") + RadRating1.Value
        currentRating("counter") = currentRating("counter") + 1
        Rating = currentRating
        Dim averageRating As Decimal = Math.Round(currentRating("sum") / currentRating("counter"), 1)
    End Sub
Slav
Telerik team
 answered on 24 Nov 2011
1 answer
74 views
I tried to use two level radgrid, the inner level actually get "AetherID" from the outer grid but it always has null value which means it is not passed in. I followed TELERIK's Example, so I  have no idea what goes wrong here, help please.


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadGridExportWebForm.aspx.cs"
    Inherits="RadGridExportWebForm" %>

<!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></title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <ClientEvents OnRequestStart="RadAjaxManager1_RequestStart" />
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
            <script type="text/javascript">
                function gridExport() {
                    $find("<%= RadGrid1.ClientID %>").get_masterTableView().exportToExcel();
                    return false;
                }
                function RadAjaxManager1_RequestStart(sender, args) {
                    if (args.get_eventTarget() == "<%= RadGrid1.ClientID %>")
                        args.set_enableAjax(false);
                }
            </script>
        </telerik:RadScriptBlock>
        <asp:Button OnClientClick="return gridExport()" ID="Button1" runat="server" Text="Export To Excel" />
        <%-- <asp:Label ID="Label1" Font-Bold="true" Font-Italic="true" Text='<%# Eval("AetherGUID") %>'
            Visible="false" runat="server" />--%>
        <telerik:RadGrid ID="RadGrid1" OnPreRender="RadGrid1_PreRender" DataSourceID="ObjectExpDescDS"
            runat="server" AutoGenerateColumns="False" AllowSorting="True" AllowMultiRowSelection="False"
            AllowPaging="True" PageSize="10" GridLines="None" ShowGroupPanel="true" OnItemCreated="RadGrid1_ItemCreated"
            OnItemCommand="RadGrid1_ItemCommand">
            <PagerStyle Mode="NumericPages"></PagerStyle>
            <MasterTableView DataSourceID="ObjectExpDescDS"  DataKeyNames="AetherGUID" AllowMultiColumnSorting="True"
                GroupLoadMode="Server" HierarchyLoadMode="ServerOnDemand">
                <Columns>
                    <telerik:GridBoundColumn SortExpression="ExperimentDateTime" HeaderText="Experiment DateTime"
                        HeaderButtonType="TextButton" DataType="System.DateTime" DataFormatString="{0:d}"
                        AllowSorting="true" AllowFiltering="true" Groupable="true" DataField="ExperimentDateTime"
                        UniqueName="ExperimentDateTime">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="ExperimentUser" HeaderText="Experiment DateTime"
                        HeaderButtonType="TextButton" AllowSorting="true" AllowFiltering="true" Groupable="true"
                        DataField="ExperimentDateTime" UniqueName="ExperimentDateTime">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="ValidationDateStartTime" HeaderText="Validation StartTime"
                        HeaderButtonType="TextButton" AllowSorting="true" AllowFiltering="true" Groupable="true"
                        DataField="ValidationDateStartTime" UniqueName="ValidationDateStartTime">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="ValidationDateEndTime" HeaderText="Validation End Time"
                        HeaderButtonType="TextButton" AllowSorting="true" AllowFiltering="true" Groupable="true"
                        DataField="ValidationDateEndTime" UniqueName="ValidationDateEndTime">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="TrainingDateStartTime" HeaderText="Training StartTime"
                        HeaderButtonType="TextButton" AllowSorting="true" AllowFiltering="true" Groupable="true"
                        DataField="TrainingDateStartTime" UniqueName="TrainingDateStartTime">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="TrainingDateEndTime" HeaderText="Training End Time"
                        HeaderButtonType="TextButton" AllowSorting="true" AllowFiltering="true" Groupable="true"
                        DataField="TrainingDateEndTime" UniqueName="TrainingDateEndTime">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="AetherDescription" HeaderText="Description"
                        HeaderButtonType="TextButton" AllowFiltering="true" AllowSorting="true" Groupable="true"
                        DataField="AetherDescription" UniqueName="AetherDescription">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="AetherGUID" HeaderText="AetherGUID" HeaderButtonType="TextButton"
                        AllowFiltering="true" AllowSorting="true" Groupable="true" DataField="AetherGUID"
                        UniqueName="AetherGUID">
                    </telerik:GridBoundColumn>
                </Columns>
                <NestedViewSettings DataSourceID="ObjectExpMetricsDS">
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="AetherGUID" MasterKeyField="AetherGUID" />
                    </ParentTableRelation>
                </NestedViewSettings>
                <NestedViewTemplate>
                    <asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap" Visible="false">
                        <telerik:RadTabStrip runat="server" ID="TabStip1" MultiPageID="Multipage1" SelectedIndex="0">
                            <Tabs>
                                <telerik:RadTab runat="server" Text="Metrics" PageViewID="PageView1">
                                </telerik:RadTab>
                                <telerik:RadTab runat="server" Text="To be added" PageViewID="PageView2">
                                </telerik:RadTab>
                                <telerik:RadTab runat="server" Text="Chart" PageViewID="PageView3">
                                </telerik:RadTab>
                            </Tabs>
                        </telerik:RadTabStrip>
                        <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false">
                            <telerik:RadPageView runat="server" ID="PageView1">
                                <telerik:RadGrid runat="server" ID="ExpMetricsGrid" DataSourceID="ObjectExpMetricsDS"
                                    ShowFooter="true" AllowSorting="true" AutoGenerateColumns="false">
                                    <MasterTableView>
                                        <Columns>
                                            <telerik:GridBoundColumn SortExpression="Position" HeaderText="Position" HeaderButtonType="TextButton"
                                                DataField="Position" UniqueName="Position">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn SortExpression="RigProd" HeaderText="Production RIG" HeaderButtonType="TextButton"
                                                DataField="RigProd" UniqueName="Production RIG">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn SortExpression="RigExpt" HeaderText="Experiment RIG" HeaderButtonType="TextButton"
                                                DataField="RigExpt" UniqueName="Experiment RIG">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn SortExpression="RIGAdPredict" UniqueName="AdPredictor RIG"
                                                DataField="RIGAdPredict" HeaderText="AdPredictor RIG">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn SortExpression="AvgPClickProd" HeaderText="Production Average PClick"
                                                HeaderButtonType="TextButton" DataField="AvgPClickProd" UniqueName="Production Average PClick">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn SortExpression="AvgPClickExpt" HeaderText="Experiment Average PClick"
                                                HeaderButtonType="TextButton" DataField="AvgPClickExpt" UniqueName="Experiment Average PClick">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn SortExpression="Impression" HeaderText="Impressions" HeaderButtonType="TextButton"
                                                DataField="Impression" UniqueName="Impression">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn SortExpression="Clicks" HeaderText="Clicks" HeaderButtonType="TextButton"
                                                DataField="Clicks" UniqueName="Clicks">
                                            </telerik:GridBoundColumn>
                                        </Columns>
                                    </MasterTableView>
                                </telerik:RadGrid>
                                <asp:ObjectDataSource ID="ObjectExpMetricsDS" SelectMethod="GetDataByGUID" TypeName="RadControlsWebApp1.DAL.AbacusStoreTableAdapters.RigAucPairwiseJoinedViewTableAdapter"
                                    runat="server">
                                    <SelectParameters>
                                        <asp:Parameter Name="AetherGUID" DefaultValue="fe439be5-4a63-45f4-990a-e7939e31f287" Type="string" />
                                    </SelectParameters>
                                </asp:ObjectDataSource>
                            </telerik:RadPageView>
                            <telerik:RadPageView runat="server" ID="PageView2" Width="460px">
                            </telerik:RadPageView>
                            <telerik:RadPageView runat="server" ID="PageView3" Width="400px">
                            </telerik:RadPageView>
                        </telerik:RadMultiPage>
                    </asp:Panel>
                </NestedViewTemplate>
            </MasterTableView>
            <ClientSettings AllowDragToGroup="true" />
        </telerik:RadGrid>
        <asp:ObjectDataSource SelectMethod="GetData" TypeName="RadControlsWebApp1.DAL.AbacusStoreTableAdapters.ExperimentDescTableAdapter"
            ID="ObjectExpDescDS" runat="server"></asp:ObjectDataSource>
    </div>
    </form>
</body>
</html>
Pavlina
Telerik team
 answered on 24 Nov 2011
1 answer
88 views
Hi Telerik,
    I have nested a RadTreeView loaded from a WCF Service as the contentTemplate item inside a RadPanelBar and that Item to be expanded on load.  When I expand the TreeView the vertical scroll displays and works properly.  If I switch panels and then come back to that TreeView, it is still expanded how I left it but the vertical scroll is no longer there and it never works again.  If I switch panels before I attempt to expand the TreeView, the vertical scroll never appears and the TreeView is worthless.  Any ideas on how I can fix this would be greatly appreciated.
Kate
Telerik team
 answered on 24 Nov 2011
7 answers
392 views
Hello again...
I'm trying to make my Grid's header sticky so when I scroll it down i Can see the header all the time on top of my website WITHOUT using ClientSide AllowScrolling and Static header/footer. It's not the same.... 

I'm trying to get something like on that website:
http://jsfiddle.net/jmosbech/stFcx/

any ideas?
Mira
Telerik team
 answered on 24 Nov 2011
1 answer
39 views
Hi
  I would like to know if any one has faced issue while populating/getting huge records through WCF for Radgrid?
  and is there a way out to get huge records populated/fetched through WCF.

Regards

SANDIP KUMAR
Jayesh Goyani
Top achievements
Rank 2
 answered on 24 Nov 2011
1 answer
104 views
With the current edition of the RibbonBar control can you load a template item from XML? I did not see in the examples or documention of a way of doing this.

ie RibbonBar.LoadContentFile("xml file name")

where in this content file we have a template item that contains a dropdown control or various others.  The documention for the ribbonbar loading from an xml file is currently very sparse and limited and keeps me guessing as the xml element names are slightly different than the asp.net element names.

I see examples of how to do this in asp.net code but not from loading from xml.
Thanks
Nikolay Tsenkov
Telerik team
 answered on 24 Nov 2011
1 answer
91 views
Hi,
Tab Wizard (client-side)  Documentation - Javascript Code is missing tags.
http://www.telerik.com/help/aspnet-ajax/tabstrip-tab-wizard.html


Here is the code on the page.
<form id="form1" runat="server">
   <script type="text/javascript">
   function onNavigate(isMoveNext)
   
       var tabs = $find('<%= rtbstMain.ClientID %>');
       var totalNumOfTabs = tabs.get_tabs().get_count();
       if(totalNumOfTabs > 0) {
           var newTabIndex;
           var currentTabIndex = tabs.get_selectedIndex();
 
           if(isMoveNext){
               if(currentTabIndex + 1 == totalNumOfTabs) {
                   newTabIndex = 0;
               }
               else {
                   newTabIndex = currentTabIndex + 1;
               }
           }
           else{
               if(currentTabIndex - 1 < 0) {
                   newTabIndex=totalNumOfTabs - 1else {
                   newTabIndex=currentTabIndex - 1tabs.set_selectedIndex(newTabIndexscript>
   <asp:ScriptManager ID="smPageScriptManager" runat="server" />
   <telerik:RadTabStrip ID="rtbstMain" runat="server" MultiPageID="RadMultiPage1" SelectedIndex="0">
       <Tabs>
           <telerik:RadTab runat="server" Text="Root RadTab1" Selected="True">
           </telerik:RadTab>
           <telerik:RadTab runat="server" Text="Root RadTab2">
           </telerik:RadTab>
           <telerik:RadTab runat="server" Text="Root RadTab3">
           </telerik:RadTab>
       </Tabs>
   </telerik:RadTabStrip>
   <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
       <telerik:RadPageView ID="RadPageView1" runat="server">
           RadPageView1</telerik:RadPageView>
       <telerik:RadPageView ID="RadPageView2" runat="server">
           RadPageView2</telerik:RadPageView>
       <telerik:RadPageView ID="RadPageView3" runat="server">
           RadPageView3</telerik:RadPageView>
   </telerik:RadMultiPage>
   <asp:Button ID="Button1" runat="server" Text="Prev" OnClientClick="onNavigate(false); return false;" />
   <asp:Button ID="Button2" runat="server" Text="Next" OnClientClick="onNavigate(true); return false;" />
</form>

I am horrible at jQuery/Javascript but need the code. I have to make a multi-form wizard. Wanted to see if I can avoid postback since I am using Async Upload on one of the tabs. 

Any suggestion welcome.

Kate
Telerik team
 answered on 24 Nov 2011
3 answers
85 views
I am trying to use the ExportToRTF() method and I get the following error:

A critical error has occurred. The type or namespace name 'SecurityRulesAttribute' does not exist in the namespace 'System.Security' (are you missing an assembly reference?)

Any suggestions?
Rumen
Telerik team
 answered on 24 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?