Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
547 views


Hi,

I want to Change the Rad Schedular Week end Days.  One of my Clients from Saudi Arabia requires that the week end should be fall in the Friday.


I try to set FirstDayOfWeek  but It's making Error.


How can I set pls let me know.


Thanks for your help


Simon
Telerik team
 answered on 14 Nov 2008
2 answers
185 views
Does anyone know why RadTreeView would take 1.5 seconds to postback in a page, when regular TreeView takes .5 seconds?  This doesn't happen in a simple demo project, just in my application page.  What might be in my page that would cause postback to get delayed?

Thanks!
Andrew
Andrew
Top achievements
Rank 1
 answered on 14 Nov 2008
1 answer
73 views

 

Hi Telerik,
i have few questions about Chart and telerik:

And Her are questions about Chart.

  • Is it possible to draw a second X Axis on the top of Chart area.
  • Is it possible to make ajax call to codebehind when the user moves the mouse over (Tick mark)points on the second X Axis.
Giuseppe
Telerik team
 answered on 14 Nov 2008
3 answers
98 views
This is for RadControls for ASP.NET AJAX Q3 2008.

I need to determine, in Javascript, if an upload is currently being processed.  Is there a method to accomplish this easily?

Thanks,

David
Erjan Gavalji
Telerik team
 answered on 14 Nov 2008
2 answers
121 views
Hi

I have a grid that containt 2 user controls in the EditTemplate, one displays some info associated in a radgrid and the other is a radupload to upload some file to the the server. Each user controls contains a RadAjaxManagerProxy and the ASPX page contains a RadAjaxManager. My problem is that in some situation like sorting the grid and moving pages, the content of my radUpload include in the other user control simply disappears, so the user need to add the files to upload again. Is there a normal things that the content always disappears of it is simply my AjaxManager proxy that is not well configured ???  How i can keep theses values in the radupload control ???

If you need more details , please let me know.

Thanks in advance for your help.

Dominic
Top achievements
Rank 2
 answered on 14 Nov 2008
1 answer
124 views
Hi
I am not able compile the project because the following errors:

Name of space for the name or type 'Uploadedfiles' can not be found. Need a using directive or a reference to number of modules (assembly)?
Validation(ASP.Net):Attribute 'LocalizationPath' is not valid attribute of element 'RadUpload'.
Validation(ASP.Net):Attribute 'SkinPath' is not valid attribute of element 'RadUpload'.

the code:

(default.aspx.cs)

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Drawing;
using Telerik.Web;
using Telerik.Web.UI.Upload;
using Telerik;
using Telerik.Charting;


public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        statusLabel.Text = "";
        errorLabel.Text = "";
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {


            if (RadUpload1.UploadedFiles.Count > 0)
            {
                string message = "<br />The following files are upload successfully <br />";
                foreach (UploadedFile file in RadUpload1.UploadedFiles)
                {
                    message += file.GetName() + "<br />";
                    file.SaveAs(@"c:\MyUploadDir\" + file.GetName(), true);
                }
                DisplayMessage(message, false);
            }

            if (RadUpload1.InvalidFiles.Count > 0)
            {
                string error = "<br />The following files are not allowed for upload<br />";
                foreach (UploadedFile ifile in RadUpload1.InvalidFiles)
                {
                    error += ifile.GetName() + "<br />";
                }

                DisplayMessage(error, true);
            }
        }

        catch (Exception ex)
        {
            DisplayMessage("Upload failed" + ex.Message, true);
        }
    }
      
    private void DisplayMessage(string text, bool isError)
        {
            if(isError)
            {
            this.errorLabel.ForeColor = Color.Red;
            this.errorLabel.Text = text;
            }
            else
            {
            this.statusLabel.ForeColor = Color.Green;
            this.statusLabel.Text = text;
            }
        }
   
    protected void RadUpload1_ValidatingFile(object sender, ValidateFileEventArgs e)
    {
        int maxZip = 10485760;//10MB
        int maxText = 4096;//4KB
        int maxJpg = 512000;//500kb

        switch(e.UploadedFile.GetExtension().ToLower())
        {
        case ".zip":
            if (e.UploadedFile.ContentLength>maxZip)
                e.IsValid=false;
            e.SkipInternalValidation=true;
            break;
        case ".txt":
            if(e.UploadedFile.ContentLength>maxText)
                e.IsValid=false;
            e.SkipInternalValidation=true;
            break;
        case ".jpg":
            if(e.UploadedFile.ContentLength>maxJpg)
                e.IsValid=false;
            e.SkipInternalValidation=true;
            break;
        }
    }
}

(default.aspx)

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="Telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
        <div>
            <table>
        <tr>
        <td>
        
        <Telerik:RadUpload ID="RadUpload1" runat="server" LocalizationPath="RadControls/Upload//Localization" SkinPath="~/RadControls/Upload/Skins" ControlObjectsVisibility="All" TargetFolder="~/MyUploadFiles" OnValidatingFile="RadUpload1_ValidatingFile" MaxFileSize="1024" />
        </td>
        <td align="right">
        <asp:Label ID="statusLabel" runat="server"></asp:Label>
        <asp:Label ID="errorLabel" runat="server"></asp:Label>
        <asp:Button ID="Button1" runat="server" Text="Upload" OnClick="Button1_Click" />
        </td>
        </tr>
       
        </table>
        
        </div>
    </form>
</body>
</html>

What is the solution?
Erjan Gavalji
Telerik team
 answered on 14 Nov 2008
2 answers
93 views
I have an edit window(pop up) that allows a user to create or edit a few fields.  Access to this window either comes from selecting a record in a grid to edit or a create new record link.

If I select a previous record to edit, close the window and then click on the Create New Record link, the previous record's data is displayed momentary and then the correct empty fields are displayed. What is the proper way to not show any previous data?



dtrumbower
Top achievements
Rank 1
 answered on 14 Nov 2008
1 answer
91 views
I need to read controld on the parent page from the radwindow page. Does anyone have a link to some sample code or another post or article on that?

Thanks
Georgi Tunev
Telerik team
 answered on 14 Nov 2008
8 answers
281 views
I found your sample for setting the cssClass by Subject but I need to set it according to one of the resource ID's.

Here is the sample code from your documentation
Protected Sub RadScheduler1_AppointmentCreated(sender As Object, e As Telerik.Web.UI.AppointmentCreatedEventArgs)
   Select Case e.Appointment.Subject
      Case "McGregor"
         e.Appointment.CssClass = "McGregorStyle"
      Case "John Doe"
         e.Appointment.CssClass = "JDStyle"
      Case "Smith"
         e.Appointment.CssClass = "SmithStyle"
      Case "Anderson"
         e.Appointment.CssClass = "AndersonStyle"
      Case Else
   End Select
End Sub 'RadScheduler1_AppointmentCreated

My Appointment table schema is the standard demo table with the following added fields
Appointment
- AppointmentID
- Subject
- StartDate
- EndDate
- RecurrenceRule
- RecurrenceParentID
- LocationID
- RoomID
- GroupID

related tables
Location
- LocationID
- LocationName

Room
-
RoomID
-
RoomName

Group
-
GroupID
-
GroupName
- GroupColor

I need to set the e.Appointment.cssClass according to the GroupID field. I tried to figure it out but my OOP skills are considerably lacking.

Ideally I want to allow in our admin for the customer to set their own color, using the RadColorPicker, for each Group they create. Since it seems the related table data is also in the scheduler hierachy would it be possible to have it set the color automatically based on a new column Group.GroupColor field?

Rubihno
Top achievements
Rank 1
 answered on 14 Nov 2008
1 answer
261 views

Hi

I have a gird, when click edit link, it will open an winodw. but the page load event run twice.
Please help.

Regards,

Paul.

DefaultT.aspx
-----------------

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="DefaultT.aspx.cs" Inherits="_DefaultT" ValidateRequest="False" EnableEventValidation="false"%>
<%@ Register TagPrefix="sds" Namespace="SessionDS" Assembly="SessionDataSource" %>
<%@ register tagprefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" %>

<!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" style="height:100%;margin:0px">
<head runat="server">
    <title></title>
</head>
<body style="margin:0px;height:100%;overflow:hidden;font-family: Tahoma;" scroll="yes" > 
    <form runat="server" id="mainForm" style="width:100%;height:100%" >
            <asp:ScriptManager id="ScriptManager" runat="server" AsyncPostBackTimeOut="600"  />           

       <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function ShowProjectEditForm(id, rowIndex) {
                    var grid = $find("<%= RadGridProj.ClientID %>");
                    //alert(id);
                    var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
                    grid.get_masterTableView().selectItem(rowControl, true);
                    //window.radopen("ProjectDetails.aspx?project_id=" + id);
                    window.radopen("test_page3.aspx");

                    return false;
                }               
            </script>
        </telerik:RadCodeBlock>
         
            <div class="frameTop">
            <div class="frameBottom">
           
            <!--<h3 class="currentFolder">Demo Site</h3>-->
            <div class="frameInner_xxx">
            <telerik:RadSplitter runat="server" width="100%" id="MainSplitter" skin="WebBlue" Height="100%" HeightOffset="65" resizemode="EndPane">

                <telerik:RadPane id="LeftPane" runat="server" width="250" MinWidth="100" Height="100%">
                             
                </telerik:RadPane>
                               
                <telerik:RadSplitBar id="RadSplitBar1" runat="server" collapsemode="Forward"></telerik:RadSplitBar>
               
                <telerik:RadPane id="MiddlePane" runat="server" scrolling="None">

                    <telerik:RadSplitter id="Content" runat="server" skin="WebBlue" orientation="Horizontal">
                                           
                        <telerik:RadPane id="Radpane3" runat="server" height="400" scrolling="Both"  MinWidth="5" MinHeight="5" >

                        
                            <telerik:RadGrid ID="RadGridProj"                               
                                AllowMultiRowSelection="true"
                                AllowMultiRowEdit="true"
                                Skin="WebBlue" runat="server"
                                AllowAutomaticDeletes="True"
                                AllowAutomaticInserts="True"
                                Width="97%" PageSize="15"
                                AllowAutomaticUpdates="True"
                                AllowPaging="True"
                                AutoGenerateColumns="False"
                                ShowStatusBar="false"                                
                                EnableAJAX="true"
                                EnableAJAXLoadingTemplate="true"
                                AllowFilteringByColumn="true"
                                LoadingTemplateTransparency="50"
                                OnItemCreated="RadGridProj_ItemCreated"
                                OnNeedDataSource="RadGridProj_NeedDataSource"
                                >                               
                            <PagerStyle NextPageText="Next" PrevPageText="Prev" Mode="NextPrevNumericAndAdvanced"></PagerStyle>
                            <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="false">
                                <Selecting AllowRowSelect="true" />
                            </ClientSettings>
                            <MasterTableView CommandItemDisplay="None" DataKeyNames="project_id"
                                AutoGenerateColumns="False" Width="100%">
                                <Columns>

                                    <telerik:GridBoundColumn DataField="project_name" HeaderText="Project Name"
                                        SortExpression="project_name" UniqueName="project_name" Visible="true" 
                                        AllowFiltering="false">
                                    </telerik:GridBoundColumn>

                                                                      
                                    <telerik:GridBoundColumn DataField="Edit_user_name" HeaderText="Edit User" SortExpression="Edit_User_name" UniqueName="Edit_user_name" Visible="false"  AllowFiltering="false"></telerik:GridBoundColumn>
                                               
                                        <telerik:GridTemplateColumn UniqueName="TemplateEditColumn"  AllowFiltering="false">
                                            <ItemTemplate>
                                                <asp:HyperLink ID="EditLink" runat="server" Text="Edit" ForeColor="Gray"></asp:HyperLink>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                       
                                    </Columns>   
                                </MasterTableView>
                            </telerik:RadGrid>                               
                                                      
                           
                        </telerik:RadPane>
                       
                        <telerik:RadSplitBar id="RadSplitBar2" runat="server" collapsemode="Both"></telerik:RadSplitBar>                                               
                   
                        <telerik:RadPane id="ContentPane" runat="server" cssclass="ContentPane" Collapsed="true" >

                            <asp:Panel id="ContentPanel" Width="95%" Height="95%" runat="server" style="PADDING-RIGHT: 4px; PADDING-LEFT: 4px; PADDING-BOTTOM: 4px; PADDING-TOP: 4px">
                            </asp:Panel>

                        </telerik:RadPane>

                    </telerik:RadSplitter>    
                </telerik:RadPane>
            </telerik:RadSplitter>
            </div>
            <!--<p class="itemsCount">xxx items</p>-->
            </div>
            </div>
            <!-- content end -->

            <telerik:RadAjaxManager id="RadAjaxManager1" runat="server" onajaxrequest="RadAjaxManager1_AjaxRequest">
                <ajaxsettings>
                   
                </ajaxsettings>
            </telerik:RadAjaxManager>

            <telerik:RadAjaxLoadingPanel id="LoadingPanel1" Runat="server" Transparency="30" BackColor="#E0E0E0">
                <asp:Image style="margin-top:20px" id="Image1" runat="server" AlternateText="Loading..." BorderWidth="0px" ImageUrl="~/img/loading.gif"></asp:Image>
            </telerik:RadAjaxLoadingPanel>
       
            <Telerik:RadWindowManager ID="RadWindowManager1"
                runat="server" Modal="true"
                ReloadOnShow="true"
                Skin="Vista" Behaviors="Resize, Pin, Maximize, Move, Reload, Close">
            </Telerik:RadWindowManager>
           
    </form>
</body>
</html>



DefaultT.aspx.cs
-----------------------------------------------------

using System;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

using System.Data;
using System.Data.SqlClient;
using System.Data.OleDb;
using System.Drawing;

using Telerik.Web.UI;
using Telerik.QuickStart;

public partial class _DefaultT : System.Web.UI.Page
{
    private string project_id
    {
        get { return (string)ViewState["project_id"]; }
        set { ViewState["project_id"] = value; }
    }

    protected void Page_Load(object sender, System.EventArgs e)
    {
        this.project_id = "2CF4CD38-1DE1-4E9A-B0CA-51A25A1EE0F5";
        this.RadGridProj.Rebind();
    }

    protected void RadGridProj_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
            Project proj = new Project();
            DataTable dt = proj.GetProjectDetailByID(new Guid(this.project_id));
            RadGridProj.DataSource = dt;

    }

    protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
    {
        if (e.Argument == "Rebind")
        {
            RadGridProj.MasterTableView.SortExpressions.Clear();
            RadGridProj.MasterTableView.GroupByExpressions.Clear();
            RadGridProj.DataSource = null;
            RadGridProj.Rebind();
        }
    }

    protected void RadGridProj_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            HyperLink editLink = e.Item.FindControl("EditLink") as HyperLink;
            editLink.Attributes["href"] = "#";
            editLink.Attributes["onclick"] = string.Format("return ShowProjectEditForm('{0}','{1}');",
                e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["project_id"], e.Item.ItemIndex);

        }
    }

}



test_page3.aspx
----------------------

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test_page3.aspx.cs" Inherits="test_page3" %>
<%@ register tagprefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" %>

<!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>
</head>
<body>
    <form id="form1" runat="server">
    <asp:scriptmanager id="ScriptManager" runat="server" />   

            <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

            <script type="text/javascript">

              
            </script>                        

            </telerik:RadCodeBlock>  
   
    <div>   
        <asp:Label ID="id1" runat="server" Text="Page Load Count:"></asp:Label>
        <asp:TextBox ID="txt_page_load" runat="server"></asp:TextBox>
    </div>
   
            <Telerik:RadWindowManager ID="RadWindowManager1"
                runat="server" Modal="true"
                ReloadOnShow="true"
                Skin="Vista" Behaviors="Resize, Pin, Maximize, Move, Reload, Close">
                <Windows>
                </Windows>
            </Telerik:RadWindowManager>
               
    </form>
</body>
</html>



test_page3.aspx.cs
-----------------------------

using System;
using System.Collections.Generic;
//using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class test_page3 : System.Web.UI.Page
{
    protected Guid property_id;

    int page_load_count = 0;

    protected void Page_Load(object sender, EventArgs e)
    {

        if (Session["PageLoadCount"] == null)
        {
            page_load_count = 1;
            this.txt_page_load.Text = page_load_count.ToString();
            Session["PageLoadCount"] = page_load_count;
        }
        else
        {
            page_load_count = int.Parse(Session["PageLoadCount"].ToString());
            page_load_count = page_load_count + 1;
            Session["PageLoadCount"] = page_load_count;  
        }

        this.txt_page_load.Text = page_load_count.ToString();
    }

    protected void x_Click(object sender, EventArgs e)
    {
        ClientScript.RegisterStartupScript(Page.GetType(), "newkey", "ShowInsertProjectForm();", true);
    }
}

Obi-Wan Kenobi
Top achievements
Rank 1
 answered on 14 Nov 2008
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?