Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
131 views
How to hide select button in radasyncupload? 
Ehsan
Top achievements
Rank 1
 answered on 12 Jan 2013
2 answers
74 views
Hi,

sorry to create another Load On Demand post but it seems I cant find my issue in the previous ones Ive searched in. In my case, when trying to implement Load On Demand on my RadTabStrip, Ive noticed a weird behavior in the code.

When clicking on the tabs in the order they are presented and I skip one, then when I click on that skipped tab, its RadMultiPage's PageViewCreated dont get called. By looking at the tab's OnClientTabSelecting client-side function, it seems the tab already has a pageview assigned and it's id is the same then the tab we click when doing the skipping.

Here's the code to replicate the problem with 4 tabs:
<%@ Page Language="C#" AutoEventWireup="True" Inherits="PL.Test" Codebehind="Test.aspx.cs" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd">
 
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
 
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function onTabSelecting(sender, args) {
 
                if (args.get_tab().get_pageView()) {
                    if (args.get_tab().get_pageView().get_id()) {
                        alert("pageview of ID: " + args.get_tab().get_pageView().get_id() + " already loaded");
                        args.get_tab().set_postBack(false);
                    }
                }
            }
                    
        </script>
    </telerik:RadCodeBlock>
 
    <form id="form1" runat="server">
 
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
 
 
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
                  <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="RadTabStrip1">
                                </telerik:AjaxUpdatedControl>
                                <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="RadAjaxLoadingPanel1">
                                </telerik:AjaxUpdatedControl>
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        <telerik:AjaxSetting AjaxControlID="RadMultiPage1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="RadAjaxLoadingPanel1">
                                </telerik:AjaxUpdatedControl>
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                         <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" LoadingPanelID="RadAjaxLoadingPanel1">
                                </telerik:AjaxUpdatedControl>
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="WebBlue" />
              
 
                    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" AutoPostBack="false" Skin="WebBlue" EnableDragToReorder="true"  MultiPageID="RadMultiPage1" Orientation="HorizontalTop"
                    SelectedIndex="0" OnTabClick="RadTabStrip1_TabClick" OnClientTabSelecting="onTabSelecting" >
                    </telerik:RadTabStrip>
 
                     
 
                    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" OnPageViewCreated="RadMultiPage1_PageViewCreated">
                    </telerik:RadMultiPage>
           
 
    </form>
</body>
</html>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace PL
{
    public partial class Test : System.Web.UI.Page
    {
 
 
        protected void Page_Load(object sender, EventArgs e)
        {
 
            if (!IsPostBack)
            {
                CreateTabs();
            }
 
        }
 
 
        private void CreateTabs()
        {
            AddNewTab(1);
            AddNewTab(2);
            AddNewTab(3);
            AddNewTab(4);
 
            RadTabStrip1.DataBind();
        }
 
        
        private void AddNewTab(int intTabIndex)
        {
            RadTab rootTab = null;
            RadPageView pv = null;
 
            rootTab = new RadTab();
            RadTabStrip1.Tabs.Add(rootTab);
 
 
            rootTab.Text = "Tab" + " " + intTabIndex.ToString();
            rootTab.Value = "Tab_" + intTabIndex.ToString();
 
 
            if (intTabIndex == 1)
            {
                pv = new RadPageView();
                pv.ID = rootTab.Value;
                RadMultiPage1.PageViews.Add(pv);
 
 
                RadTabStrip1.Tabs[RadTabStrip1.Tabs.Count - 1].Selected = true;
                RadMultiPage1.PageViews[RadMultiPage1.PageViews.Count - 1].Selected = true;
 
                 
            }
 
            
 
        }
 
        protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)
        {
            Console.WriteLine(e.PageView.ID);
        }
 
        
 
        protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
        {
            AddPageView(e.Tab);
            e.Tab.PageView.Selected = true;
        }
 
        private void AddPageView(RadTab tab)
        {
            RadPageView pv = new RadPageView();
            pv.ID = tab.Value;
            RadMultiPage1.PageViews.Add(pv);
            tab.PageViewID = pv.ID;
 
        }
 
 
         
    }
}

Page will start and create Tab 1. If you click on Tab 3 then Tab 2, you'll notice that Tab 2 pageview ID is already known and that "RadMultiPage1_PageViewCreated" doesnt get called. Same if you refresh and click Tab 2, then Tab 4 and then Tab 3. If you go 2, 3 and 4, all is fine. Is something wrong in my code?

TIA

Martin

Martin Roussel
Top achievements
Rank 1
 answered on 11 Jan 2013
1 answer
71 views
Hi,

We have requirement to display the RadChart control with plotarea only in one of the column of a Radgrid control. when implemented this requirement,  we found that displays the empty space of chartarea, plot area. so the radchart control is not adapted to the column of a grid.
When tried to remove this empty space, (as mentioned in one of the forum, AutoLayout property set to false) it removes only the empty space of plot area. but it does not remove the empty space of chartarea (like title, xaxis, yaxis, legend) even if those visibility is set to false.

please assist to achieve this.

Regards,
Meenakshi


MightyQuinn
Top achievements
Rank 1
 answered on 11 Jan 2013
4 answers
315 views
Hello,

I have the following code:
 function OnClientSelectedIndexChanging(sender, eventArgs) 
     { 
      
       var vItem = eventArgs.get_item(); 
        
       if (vItem.get_value() == "..."
       { 
            alert('bad value'); 
            return false//cancel post back. 
       } 
        
     } 

I get the alert box, but what do i need to do to cancel the post back?

TIA
Aarsh
Top achievements
Rank 1
 answered on 11 Jan 2013
0 answers
72 views
how to create the forum reply box using asp.net c#
Michael
Top achievements
Rank 1
 asked on 11 Jan 2013
3 answers
124 views
I have been trying to use a date range filter for a RadGrid with manual filter in code behind.  I understand that it is a string expression, however no matter what I try it keeps getting an error that it is not a valid boolean expression.  Here is the aspx and code behind.  What am I missing? Thanks in advance.
<telerik:RadGrid ID="TimeGrid" AllowPaging="true" DataSourceID="DetailSource" runat="server" GridLines="None" AllowSorting="false" EnableLinqExpressions="false">
               <MasterTableView>
                    <Columns>
                        <telerik:GridBoundColumn DataField="WorkDate" HeaderText="Date" UniqueName="WDate" DataFormatString="{0:MM/dd/yy}" ItemStyle-Width="75px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Shift" HeaderText="Shift" ItemStyle-Width="25px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Reg" HeaderText="Reg" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="ShftHrs" HeaderText="ShftHrs" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="OT" HeaderText="OT" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Vac40" HeaderText="Vac 40 Hrs" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Vac48" HeaderText="Vac 48 Hrs" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Vac36" HeaderText="Vac 36 Hrs" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Sick40" HeaderText="Sick 40 Hrs" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Sick48" HeaderText="Sick 48 Hrs" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Sick36" HeaderText="Sick 36 Hrs" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Exc_Absence" HeaderText="Exc Abs Hrs" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Holiday_Worked" HeaderText="Holiday Worked" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Holiday_Not_Worked" HeaderText="Holiday Not Worked" ItemStyle-Width="35px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Comments" HeaderText="Comment" ItemStyle-Width="135px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Additional_Comment" HeaderText="Additional Comment" ItemStyle-Width="135px"></telerik:GridBoundColumn>
                        <telerik:GridCheckBoxColumn DataField="Five" HeaderText="5%"></telerik:GridCheckBoxColumn>
                        <telerik:GridCheckBoxColumn DataField="Ten" HeaderText="10%"></telerik:GridCheckBoxColumn>
                    </Columns>
               </MasterTableView>
            </telerik:RadGrid>
**Server side
Partial Class Administration_TimesheetUserControl2
    Inherits System.Web.UI.UserControl
 
    Protected Sub PayDatesDDL_SelectedIndexChanged(sender As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles PayDatesDDL.SelectedIndexChanged
        Dim strFilterExpression As String
        strFilterExpression = "(([WORKDATE] >= '" + e.Value + "') AND ([WORKDATE] <= '" + Calc_PP_EndDate(e.Value) + "'))"
        TimeGrid.MasterTableView.FilterExpression = strFilterExpression
        TimeGrid.MasterTableView.Rebind()
    End Sub
    Public Shared Function Calc_PP_EndDate(ByVal strBeginDate As String) As String
        Dim dtmEndDate As Date
        Dim dtBeginDate As Date = Date.Parse(strBeginDate)
        Dim strEndDate As String
 
        If Day(dtBeginDate) = 1 Then
            dtmEndDate = DateSerial(Year(dtBeginDate), Month(dtBeginDate), 15)
        Else
            dtmEndDate = DateSerial(Year(dtBeginDate), Month(dtBeginDate) + 1, 1 - 1)
        End If
 
        strEndDate = CType(dtmEndDate, String)
        Return (strEndDate)
    End Function
End Class

Elliott
Top achievements
Rank 2
 answered on 11 Jan 2013
5 answers
93 views
I am having strange results with the combo box.  For some reason it is rebindig after I bind it.  
My first issue was u was trying to remove an item from the list if it was not selected.  Since it was doing this word reminding,  I had to remove it on the ondataload method. The next problem was that the selected value was not remaining. I set the value.  I step through the code and I see it being set.  Then when the page is displayed the value is no longer set.  How can I track these behind the scenes processes. 
John Giblin
Top achievements
Rank 1
 answered on 11 Jan 2013
1 answer
83 views
In my Chart I have around 16-20 Legends and they are taking very much space. I want to show only top 8 Legends and hide the rest. How can I do it? A code sample would be appreciated. Thanks.
Missing User
 answered on 11 Jan 2013
1 answer
193 views
I am trying to prevent a tab stop on an entire RadGrid control, but I have not been able to accomplish this.  I have tried setting the TabIndex property equal to -1 and also tried surrounding the grid with a panel with a TabIndex of -1.  Neither of these attempts were successful.
Can anyone provide any assistance with this issue?
MightyQuinn
Top achievements
Rank 1
 answered on 11 Jan 2013
1 answer
142 views
Hi there

I have a consistent but intermittent (maybe 50:50) problem with the image for a radCaptcha control not being displayed, showing instead only the grey box on the occasions that the rendering fails. I know about using the HttpHandlerUrl property to explicitly provide the location of Telerik.Web.UI.axd, and the fact that the image is loaded from the Cache by default, so I am wondering if this is some issue with a cache management conflict caused by some other javascript functions I am running on page load?

Could anybody point me in a good direction about how to troubleshoot this issue, as I have run out of ideas! Is there any client-side API for radCaptcha that might allow me to examine what is going on with the captcha control as the client side script runs? Failing that, is there a recommended location for setting the HttpHandlerUrl property back at the server-side processing? I have tried the init handlers for both the page and the control itself, but nothing makes any difference to the problem.

Thanks if you can advise

Slav
Telerik team
 answered on 11 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?