Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
108 views
Hi teleik Team

I'm using Rad Scheduler but I faced a problem when the page loaded it gives me the following runtime error message

Valid values are between 1 and 9666, inclusive.
Parameter name: year

the culture that Im using is "AR-SA"  and I set it for the scheduler correctly

the page culture is also "Ar-SA"

Enviroment

rad controls for asp.net ajax q3 2008.
Internet explorer 8.
Microsoft Vista Operating system and the date format is "hijri date".
Microsoft Sql Serve 2005.
asp.net with framework 3.5.

Thanks in advance

Hamdy
Top achievements
Rank 1
 answered on 23 Mar 2010
6 answers
706 views
Date time when the language from computer environment Arabic the control not work when click on the 12:00 AM (ص) or PM (م)
can you help me this problem

AM Mean (ص)    and  PM Mean   (م)
see the image below

Hamdy
Top achievements
Rank 1
 answered on 23 Mar 2010
1 answer
182 views
Hi

I have a RadToolbar and a RadEditor on the same page. The toolbar has a dropdown in it. If I click on the dropdown button and the dropdown displays, and then click directly into the RadEditor, the dropdown remains open instead of automatically collapsing. Is there any way to force it to collapse?
Yana
Telerik team
 answered on 23 Mar 2010
1 answer
93 views
I am adding rows as columns after getting value from dropdown, i page is posted back i am not able to getting the textboxes in template columns, after selecting dropdown value storing in to the session and redirecting to the same page. if do like that ,columns keep on adding when page is posted back every time. can u provide me any solutions..


protected void Page_Init(object sender, EventArgs e)
        {

            string strPlant = string.Empty;
            

            if (Session["PlantVal"] != null)
            {
                strPlant = Session["PlantVal"].ToString();

                // Session["PlantVal"] = null;

                //strPlant = cPlantGroup.SelectedValue;

                if (strPlant != null && strPlant.Trim().Length > 0)
                {
                    DefineGridStructure(strPlant);
                }
            }
            
        }
        public DataTable DefineGridStructure(string strPlant)
        {
            dtRaleLoad = new DataTable();

            //RadGrid1.MasterTableView.AutoGenerateColumns = true;
            //RadGrid1.MasterTableView.EnableColumnsViewState = true;

            Plants oplant = new Plants();
            GridBoundColumn boundColumn = new GridBoundColumn();
            dtRaleLoad.Columns.Add("Date", typeof(string));
            this.RadGrid1.MasterTableView.Columns.Add(boundColumn);
            boundColumn.DataField = "Date";
            boundColumn.UniqueName = "Date";
            boundColumn.HeaderText = "Date";
            boundColumn.DataType = System.Type.GetType("System.String");


            GridBoundColumn boundColumn1;

            DataSet ds = new DataSet();
            ds = oplant.GetChildCode(strPlant);
            string strChildCode = ds.Tables[0].Rows[0][0].ToString();
            Session["ChildCode"] = strChildCode;
            DataTable dtgroup = new DataTable();
            string strgroup = strChildCode;
            dtgroup = oplant.GetPlant(strgroup);

            DataRow dtRow = null;
            if (dtgroup != null)
            {
                foreach (DataRow dr in dtgroup.Rows)
                {
                    String sPlantName = "";
                    String sPlantCode = "";
                    //sPlantName = dr["PlantName1"].ToString();                        
                    sPlantCode = dr["PlantCode"].ToString();
                    dtRaleLoad.Columns.Add(sPlantCode, typeof(string));
                    boundColumn1 = new GridBoundColumn();
                    this.RadGrid1.MasterTableView.Columns.Add(boundColumn1);
                    boundColumn1.DataField = sPlantCode;
                    boundColumn1.UniqueName = sPlantCode;
                    boundColumn1.HeaderText = sPlantCode;
                    boundColumn1.DataType = System.Type.GetType("System.String");

                }

            }

            

            string templateColumnName = "Total";
            GridTemplateColumn templateColumn = new GridTemplateColumn();
            dtRaleLoad.Columns.Add("Total", typeof(string));
            templateColumn.ItemTemplate = new MyTemplate1(templateColumnName);
            this.RadGrid1.MasterTableView.Columns.Add(templateColumn);
            templateColumn.UniqueName = "Total";
            templateColumn.DataField = "Total";
            templateColumn.HeaderText = "Total";
            templateColumn.DataType = System.Type.GetType("System.String");


            DataTable dtport = new DataTable();
            dtport = oplant.GetPortName(strgroup);
            GridTemplateColumn templateColumn1;
            if (dtport != null)
            {

                foreach (DataRow dr in dtport.Rows)
                {
                    string sPortName = "";
                    string sPortCode = "";
                    sPortName = dr["PortName"].ToString();
                    sPortCode = dr["PortCode"].ToString();


                    dtRaleLoad.Columns.Add(sPortName, typeof(string));
                    templateColumn1 = new GridTemplateColumn();

                    this.RadGrid1.MasterTableView.Columns.Add(templateColumn1);
                    templateColumn1.ItemTemplate = new TemplatePort(sPortCode);

                    templateColumn1.DataField = sPortName;
                    templateColumn1.UniqueName = sPortName;
                    templateColumn1.HeaderText = sPortName;
                    templateColumn1.DataType = System.Type.GetType("System.String");


                }
            }

            string templateColumnName2 = "UnAllot";
            GridTemplateColumn templateColumn2 = new GridTemplateColumn();
            dtRaleLoad.Columns.Add("UnAllot", typeof(string));
            templateColumn2.ItemTemplate = new MyTemplate3(templateColumnName2);            
            this.RadGrid1.MasterTableView.Columns.Add(templateColumn2);
            templateColumn2.UniqueName = "Unallot";
            templateColumn2.HeaderText = "UnAllot";
            templateColumn2.DataField = "UnAllot";
            templateColumn2.DataType = System.Type.GetType("System.String");

            string templateColumnName3 = "Rake";
            GridTemplateColumn templateColumn3 = new GridTemplateColumn();
            dtRaleLoad.Columns.Add("Rake", typeof(string));
            templateColumn3.ItemTemplate = new MyTemplate4(templateColumnName3);
            this.RadGrid1.MasterTableView.Columns.Add(templateColumn3);
            templateColumn3.DataField = "Rake";
            templateColumn3.UniqueName = "Rake";
            templateColumn3.HeaderText = "Rake";
            templateColumn3.DataField = "Rake";
            templateColumn3.DataType = System.Type.GetType("System.String");

            Session["Rake"] = dtRaleLoad;
            RadGrid1.DataSource = dtRaleLoad;
            return dtRaleLoad;

        }
        private class MyTemplate1 : ITemplate
        {
            protected TextBox txtTotal;
            private string colname1;
            public MyTemplate1(string cName)
            {
                colname1 = cName;
                txtTotal = new TextBox();
                txtTotal.ID = colname1;
                txtTotal.Visible = true;
                System.Web.UI.Control container1 = new System.Web.UI.Control();
                container1.Controls.Add(txtTotal);

            }


            public void InstantiateIn(Control container)
            {
                txtTotal = new TextBox();
                //txtTotal.ReadOnly = true;
                txtTotal.ID = colname1;
                container.Controls.Add(txtTotal);

            }


        }
        private class MyTemplate2 : ITemplate
        {
            protected TextBox txtPort;
            private string colname2;
            public MyTemplate2(string cName)
            {

                colname2 = cName;
                txtPort = new TextBox();
                txtPort.ID = colname2;
                txtPort.Visible = true;
                System.Web.UI.Control container3 = new System.Web.UI.Control();
                container3.Controls.Add(txtPort);

            }

            public void InstantiateIn(System.Web.UI.Control container)
            {
                txtPort = new TextBox();
                txtPort.ID = colname2;
                container.Controls.Add(txtPort);
            }
        }

        private class MyTemplate3 : ITemplate
        {
            protected TextBox txtUnAllot;
            private string colname3;
            public MyTemplate3(string cName)
            {

                colname3 = cName;
                txtUnAllot = new TextBox();
                txtUnAllot.ID = colname3;
                System.Web.UI.Control container4 = new System.Web.UI.Control();
                container4.Controls.Add(txtUnAllot);

            }

            public void InstantiateIn(System.Web.UI.Control container)
            {
                txtUnAllot = new TextBox();
                txtUnAllot.ID = colname3;
                container.Controls.Add(txtUnAllot);
            }
        }

        private class MyTemplate4 : ITemplate
        {
            protected TextBox txtRake;
            private string colname4;
            public MyTemplate4(string cName)
            {

                colname4 = cName;
                txtRake = new TextBox();
                txtRake.ID = colname4;
                System.Web.UI.Control container2 = new System.Web.UI.Control();
                container2.Controls.Add(txtRake);

            }

            public void InstantiateIn(System.Web.UI.Control container)
            {
                txtRake = new TextBox();
                txtRake.ID = colname4;
                container.Controls.Add(txtRake);
            }


        }
Iana Tsolova
Telerik team
 answered on 23 Mar 2010
1 answer
361 views
Hello

I'm trying to simulate the click on the folder on a RadFileExplorer, i can find the node and select it (the value is passed from a combo box), on SelectedIndexChaged, but i cannot find the way to reload the content of the RadFileExplorer from javascript, there is any way to do this?

my javascript code is:

function

 

onSelectedIndexChanged(sender, eventArgs)

 

{

 

var item = eventArgs.get_item();

 

 

var oExplorer = $find("<%=RadFileExplorer1.ClientID%>");

 

 

var oTree = oExplorer.get_tree();

 

 

if (oTree.findNodeByText(sender.get_value()))

 

{

 

var selectedNode = oTree.findNodeByText(sender.get_value());

 

selectedNode.select();

// Here i want to simulate the node click event...
}

 

else

 

alert(

'Folder not found');

 

}

Thanks in advance.

Miquel Frances Sitja
Top achievements
Rank 1
 answered on 23 Mar 2010
7 answers
131 views
Hi,

I can't get TimeSlotContextMenus to work, I get a script error saying that "'this._weekModels.0' is null or not an object".

  <Telerik:RadScheduler runat="server" ID="uxScheduler" 
                        DataKeyField="ActivityID" DataEndField="EndDateTime" DataStartField="StartDateTime"   
                        DataSubjectField="Description" HoursPanelTimeFormat="HH:mm" 
                        DayHeaderDateFormat="yyyy-MM-dd" 
                        FirstDayOfWeek="Monday" LastDayOfWeek="Friday" Height="100%" 
                        SelectedView="DayView" ShowDateHeaders="false" ShowResourceHeaders="true" ShowHeader="false" 
                        ShowFooter="true" MinutesPerRow="30" >             
    <MultiDayView UserSelectable="false" NumberOfDays="1" /> 
    <DayView UserSelectable="false" /> 
    <WeekView UserSelectable="false" /> 
    <MonthView UserSelectable="false" /> 
    <TimelineView UserSelectable="false" /> 
    <AppointmentTemplate> 
      <IMSC:ActivityItem ID="uxActivityItem" runat="server" ActivityID='<%#Bind("ID") %>' /> 
    </AppointmentTemplate> 
    <AppointmentContextMenus> 
      <Telerik:RadSchedulerContextMenu runat="server" ID="uxAppointmentMenu">  
        <Items> 
          <Telerik:RadMenuItem runat="server" Text="Open/Edit" value="edit" /> 
          <Telerik:RadMenuItem runat="server" IsSeparator="true" /> 
          <Telerik:RadMenuItem runat="server" Text="Delete" Value="delete" /> 
          <Telerik:RadMenuItem runat="server" IsSeparator="true" /> 
          <Telerik:RadMenuItem runat="server" Text="Cut" Value="cut" /> 
          <Telerik:RadMenuItem runat="server" Text="Copy" Value="copy" /> 
        </Items> 
      </Telerik:RadSchedulerContextMenu> 
    </AppointmentContextMenus> 
    <TimeSlotContextMenus> 
      <Telerik:RadSchedulerContextMenu runat="server" ID="uxTimeSlotMenu">  
        <Items> 
          <Telerik:RadMenuItem runat="server" Text="Create Activity" Value="create" /> 
          <Telerik:RadMenuItem runat="server" IsSeparator="true" /> 
          <Telerik:RadMenuItem runat="server" Text="Paste" Value="paste" /> 
        </Items> 
      </Telerik:RadSchedulerContextMenu> 
    </TimeSlotContextMenus> 
  </Telerik:RadScheduler> 
What I'm doing is keeping the Schedular in DayView and create resources for each date I actually want to show, this is so that it can display dates for non-consecutive days. I don't know if this has something to do with it, but the context menu for a time slot is not coming up. This has totally halted my project and I need to get this fixed.
Peter
Telerik team
 answered on 23 Mar 2010
1 answer
111 views
Hi ,
We are using RadControls_for_ASP.NET_AJAX_2010_1_309_dev in our site. In RadGrid control we are using MultiRowSelect property and also using context menue with it. If one row is selected and on other row if we right click , then second row also get selected. We want to deselect first row and select second row on right click.
May be we are trying to deselect any number of selected rows (could be 1 or more), on right click out side of that selection group. Can you please help us that how we can resolve this problem.

Regards,
Zeeshan
Yavor
Telerik team
 answered on 23 Mar 2010
3 answers
148 views
Hi

I am trying to trigger the ShowDialog function from behind the code?

reg

D

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %> 
 
<%@ Register Assembly="RadWindow.Net2" Namespace="Telerik.WebControls" TagPrefix="radW" %> 
<!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 id="Head1" runat="server"> 
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="Form1" method="post" runat="server"> 
    <p> 
        <b>Returning multiple Values From a Dialog</b> 
        <br /> 
    </p> 
    <script type="text/javascript"> 
        //Show the window 
        function ShowDialog() { 
            var oWnd = window.radopen(null, "DialogWindow"); 
            oWnd.SetUrl(oWnd.GetUrl()); 
            return oWnd; 
        } 
         
        //Called when a window is being shown. Good for setting an argument to the window  
        function OnClientShow(radWindow) { 
            //Create a new Object to be used as an argument to the radWindow 
            var arg = new Object(); 
            //Using an Object as a argument is convenient as it allows setting many properties. 
            arg.NameValue = document.getElementById("NameArea").value; 
            arg.ProfessionValue = document.getElementById("ProfessionArea").value; 
 
            //Set the argument object to the radWindow       
            radWindow.Argument = arg; 
        } 
 
        function CallBackFunction(radWindow, returnValue) { 
            if (returnValue.NameValue) document.getElementById("NameArea").value = returnValue.NameValue; 
            if (returnValue.NameValue) document.getElementById("ProfessionArea").value = returnValue.ProfessionValue; 
        } 
 
        // Called when a window is being closed. 
        function OnClientClose(radWindow) { 
            //Another option for passing a callback value 
            //Set the radWindow.Argument property in the dialog 
            //And read it here --> var oValue = radWindow.Argument;                                      
            //Do cleanup if necessary 
        }    
                             
    </script> 
    <asp:Label ID="InjectScript" runat="server" Width="410px"></asp:Label> 
    <p> 
        Text to be modified from the dialog: 
        <br /> 
        Name: 
        <textarea id="NameArea" rows="1" cols="20">John Smith</textarea> 
        <br /> 
        Profession:<textarea id="ProfessionArea" rows="5" cols="20">VB Developer</textarea> 
        <asp:Button ID="Button1" runat="server" Text="Button" /> 
        <br /> 
        <button class="Button" style="width: 250px" onclick="ShowDialog();return false;" 
            type="button"> 
            Show dialog (force dialog refresh)</button> 
    </p> 
    <p> 
        (Open by client script) 
        <br /> 
        <radW:RadWindowManager ID="Singleton" runat="server" OnClientClose="OnClientClose" 
            OnClientShow="OnClientShow" ClientCallBackFunction="CallBackFunction" VisibleOnPageLoad="false"> 
            <Windows> 
                <radW:RadWindow ID="DialogWindow" OffsetElementId="NameArea" Left="250px" Modal="true" 
                    runat="server" Width="370px" Height="310px" Title="User List Dialog" NavigateUrl="./Dialog.aspx"> 
                </radW:RadWindow> 
            </Windows> 
        </radW:RadWindowManager> 
    </p> 
    <p> 
        &nbsp;</p> 
    <div style="width: 456px; height: 260px; text-align: justify"> 
        <p> 
            The example is based on <strong>t</strong>elerik's demo <a href="http://www.telerik.com/r.a.d.controls/Window/Examples/DialogReturnValue/DefaultCS.aspx" 
                target='_blank"'>Returning Values From A Dialog </a>and <strong>t</strong>elerik's 
            KB article <a href="http://www.telerik.com/Default.aspx?PageId=2514&amp;b454K=xg8&amp;b454T=o8c" 
                target="_blank">(ID#664) Providing an argument to a dialog. Return value from a 
                dialog, assign and invoke callback function</a>. 
        </p> 
        <p> 
            The approach is the same as explained in the KB article above and the only difference 
            is that instead of only one, we are passing two values to and from the dialog. If 
            you need more values to be passed - the logic stays the same. 
        </p> 
        <p> 
            For more information, please check the comments in the code. 
        </p> 
    </div> 
    </form> 
</body> 
</html> 
 

Imports Telerik.WebControls 
 
Partial Class Default2 
    Inherits System.Web.UI.Page 
 
     
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click 
        InjectScript.Text = "<script type='text/javascript'>ShowDialog()</" + "script>" 
    End Sub 
End Class 
 

Tsvetoslav
Telerik team
 answered on 23 Mar 2010
1 answer
133 views
Hello,

We're in the process of replacing our old tree control with a new one. We've implemented the expand mode as serversidecallback but there is a noticeable delay in comparison to the old tree (several seconds). The old tree control uses web service node expansion. Although this feature is available with the Telerik TreeView control, it is severely limited. We need to not only add the child nodes, but also register other client data/scripts. With ServerSideCallBack, we're writing our dynamic javascript to the Category field. Could you suggest how we could get similar results from WebService expand mode?

e.g.
void AddNodeForWebServiceExpand(...)
{
RadTreeNodeData n;
n.Text = "My node";
n.Value = "N0";

/* add dynamic js */
n.<some string property> = "alert('name = My node; value = N0; extra data = <some extra data>')";
}

Regards,
Paul
Veselin Vasilev
Telerik team
 answered on 23 Mar 2010
1 answer
201 views
Hi Telerik Team !


I have a two RADGRID on to my ASPX page.

I want to show the AJAX LOADING IMAGE when I perform any ACTION(sorting,reordering,filtering,selection) on to my RAD GRID.

Right now ,Iam able to do so but the problem is that Iam not able to get the full postback on to the server as a result of which

the records that is to be shown on the other GRID are not showing up.  


By the way ,

I have used the below code to ajaxify my second grid as I dont want a POST for my second GRID.

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> 
                    <AjaxSettings> 
                        <telerik:AjaxSetting AjaxControlID="PermissionListRadGrid"> 
                            <UpdatedControls> 
                                <telerik:AjaxUpdatedControl ControlID="PermissionListRadGrid" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                            </UpdatedControls> 
                        </telerik:AjaxSetting> 
                    </AjaxSettings> 
                </telerik:RadAjaxManager> 


Its working fine & I need is to show the loading image with full postback on to the server so as to get the relevant data on to the second grid based on the first grid.

How to do this ?

Anyone please help !

Lenny_shp
Top achievements
Rank 2
 answered on 23 Mar 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?