Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
389 views

hi

I have to use the Scheduler in a farsi(persian) website,to change the calendar from georgian to persian I have written the following codes:

     System.Globalization.CultureInfo culture = new System.Globalization.CultureInfo("fa-IR");
        System.Globalization.DateTimeFormatInfo info = culture.DateTimeFormat;
        info.AbbreviatedDayNames = new string[] { "ی", "د", "س", "چ", "پ", "ج", "ش" };
        info.DayNames = new string[] { "یکشنبه", "دوشنبه", "ﺳﻪشنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه" };
        info.AbbreviatedMonthNames = new string[] { "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند", "" };
        info.MonthNames = new string[] { "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند", "" };
        info.AMDesignator = "ق.ظ";
        info.PMDesignator = "ب.ظ";
        info.ShortDatePattern = "yyyy/MM/dd";
        info.FirstDayOfWeek = DayOfWeek.Saturday;
        System.Globalization.PersianCalendar cal = new System.Globalization.PersianCalendar();

        typeof(System.Globalization.DateTimeFormatInfo).GetField(
            "calendar", System.Reflection.BindingFlags.Public |
            System.Reflection.BindingFlags.Instance |
            System.Reflection.BindingFlags.NonPublic).SetValue(info, cal);

        object obj = typeof(System.Globalization.DateTimeFormatInfo).GetField(
            "m_cultureTableRecord", System.Reflection.BindingFlags.Public |
            System.Reflection.BindingFlags.Instance |
            System.Reflection.BindingFlags.NonPublic).GetValue(info);

        obj.GetType().GetMethod("UseCurrentCalendar",
           System.Reflection.BindingFlags.NonPublic |
           System.Reflection.BindingFlags.Instance).Invoke(obj,
           new object[] { cal.GetType().GetProperty("ID",
   System.Reflection.BindingFlags.Instance |
   System.Reflection.BindingFlags.NonPublic).GetValue(cal, null) });

        typeof(System.Globalization.CultureInfo).GetField("calendar",
            System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance |
            System.Reflection.BindingFlags.NonPublic).SetValue(culture, cal);

        System.Threading.Thread.CurrentThread.CurrentCulture = culture;

        RadScheduler1.Culture = culture;
        RadScheduler1.SelectedDate = DateTime.Now.Date;
        TimeSpan ts = new TimeSpan(3, 30, 00);
        RadScheduler1.TimeZoneOffset = ts;
        RadScheduler1.FirstDayOfWeek = DayOfWeek.Saturday;
        RadScheduler1.Localization.HeaderDay = "روز";
        RadScheduler1.Localization.HeaderToday = "امروز";

 

the result is strange,the dayview & weekview is ok but in the monthview and also in the calendar at the corner of the page(when navigating from current month to next or previuos month ) day conversions are incorrect

I have shown the problems in the picture at the following url

http://upload.iranblog.com/7/1247614585.jpg

 

can anyone help me chang the calender implemented in aspxScheduler from georgian to persian please??

Mohamad Javad
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 08 Apr 2015
1 answer
95 views

hi

I need  telerik Demo menu in Picture below.

I need simple code page with telerik menu and without every thing in.

 

thanks

Mohamad Javad
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 08 Apr 2015
6 answers
699 views
Hi Telerik team,

I'm using Radgrid to build a tree structure with source of objects with parent and child relationship, 
and the configuration of the grid as below:

MasterTableView.HierarchyLoadMode = GridChildLoadMode.Client;
MasterTableView.HierarchyDefaultExpanded = false;
MasterTableView.SelfHierarchySettings.KeyName = "xxx";
MasterTableView.SelfHierarchySettings.ParentKeyName = "yyy";
 
ClientSettings.AllowExpandCollapse = true;
ClientSettings.AllowColumnsReorder = false;
ClientSettings.ReorderColumnsOnClient = true;

Everything works fine until when one of the node is expanded to more that 1 level, and refresh the page (based on some criteria so that the data source now has changed), the following error appears:

Specified argument was out of the range of valid values. Parameter name: ItemHierarchicalIndex

Some additional info on the error:

Source Telerik.Web.UI
Function Telerik.Web.UI.GridDataItem get_Item(System.String)
Stack Telerik.Web.UI.GridDataItemCollection.get_Item(String hierarchicalIndex)
Telerik.Web.UI.RadGrid.LoadClientState(Dictionary`2 clientState) 
System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


myGrid_ClientState {"selectedIndexes":[],"reorderedColumns":[],"expandedItems":["1","1","0","0","1","1","0","0","1","1","0","0","0:0_10","0"],"expandedGroupItems":[],"expandedFilterItems":[],"deletedItems":[],"hidedColumns":[],"showedColumns":[],"popUpLocations":{},"draggedItemsIndexes":[]}


Apparently the problem is on client state data "expandedItems", i guess it is trying to restore the expanded items on the new data source (which has been changed and the expanded levels in client data may not be valid anymore).

I'm not quite sure about my observation, but i've tried to override the LoadClientState function in my custom grid:

protected override bool LoadClientState(Dictionary<string, object> clientState)
        {
            if (clientState.ContainsKey("expandedItems"))
                clientState["expandedItems"] = new object[] { };
            return base.LoadClientState(clientState);
        }

It does the trick and the page is successfully refreshed no matter how many level of nodes i expanded before.
However i would like to know is there any better solution for this, and why does this happen?

Thanks.





John
Top achievements
Rank 1
 answered on 07 Apr 2015
4 answers
154 views
Hi,

I'm working on a project which uses the RadGrid from the classic controls.

Basically, the scenario is this. When the user clicks on an edit button for a row of the RadGrid, the panel which contains the RadGird is made invisible, and another panel with an assortment of textboxes and comboboxes is made visible with details of that grid row item populating thos controls. There is also a delete button on that panel, which delete that item in the database when clicked.

The problem arises when the grid is reloaded after that delete. Following the delete button being clicked, the grid's panel is made visible again and the grid is rebound. If I then click on one of the edit buttons for a row in the grid, the following error is thrown:

Server Error in '/' Application.
--------------------------------------------------------------------------------

Specified argument was out of the range of valid values.
Parameter name: ItemHierarchicalIndex
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: ItemHierarchicalIndex

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace:


[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: ItemHierarchicalIndex]
   Telerik.WebControls.GridItemCollection.get_Item(String hierarchicalIndex) +103
   Telerik.WebControls.GridDataItemCollection.get_Item(String hierarchicalIndex) +37
   Telerik.WebControls.RadGrid.get_EditItems() +215
   Telerik.WebControls.RadGrid.SaveEditIndexState(String newValue) +95
   Telerik.WebControls.GridItem.set_Edit(Boolean value) +82
   Telerik.WebControls.GridCommandEventArgs.ExecuteCommand(Object source) +236
   Telerik.WebControls.RadGrid.OnBubbleEvent(Object source, EventArgs e) +191
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   Telerik.WebControls.GridItem.OnBubbleEvent(Object source, EventArgs e) +165
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.ImageButton.OnCommand(CommandEventArgs e) +111
   System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +176
   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
 
Any help would be appreciated. Previous searches of this forum show others have had the same problem and not resolved it.

Cheers
John
Top achievements
Rank 1
 answered on 07 Apr 2015
1 answer
100 views

I use radajax to my page. When button click everything working fine. But when enter key press raise follwing error

 

Unhandled exception at line 19979, column 1 in http://localhost:39853/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=;;System.Web.Extensions,+Version=4.0.0.0,+Culture=neutral,+PublicKeyToken=31bf3856ad364e35:en-US:4ae4914f-8c8e-4123-9d05-414d87b48357:ea597d4b:b25378d2;Telerik.Web.UI:en-US:42f3bd03-686e-4514-94d4-9dc03944a160:16e4e7cd:f7645509:86526ba7:7c926187:8674cba1:b7778d6c:c08e9f8a:59462f1:a51ee93e:24ee1bba:f46195d3:1e771326:6b3f73b3:78b9daca:7165f74:58366029:2003d0b8:aa288e2d:ed16cbdc0x800a138f -

JavaScript runtime error: Unable to get property 'id' of undefined or null reference

 

 

Pavlina
Telerik team
 answered on 07 Apr 2015
2 answers
133 views

I'd like to configure RadGrid as follows:

- if there are no records to display, the grid should display only the header-row and maybe "no records to display" . Consuming no other space.

-if there are records to display, just show all records.

No fixed heiht, no paging.

Is this possible with RadGrid ??

Thanks for any help.

 

 

 

 

 

Karlheinz
Top achievements
Rank 1
 answered on 07 Apr 2015
1 answer
118 views
Hi if i download my apps source code will the backend still work from telerik also can i sell my code that i create 
Pavlina
Telerik team
 answered on 07 Apr 2015
3 answers
78 views
what is elastic functionality for radinput.

I see it listed in the release history.  Not sure what it is or how to use it.

Marty
Maria Ilieva
Telerik team
 answered on 07 Apr 2015
7 answers
308 views
Dear telerik team,

How can i bind saved image to async file upload .

thanks
Ivan Danchev
Telerik team
 answered on 07 Apr 2015
8 answers
526 views
I have a RadCombobox and I use webservice datasource. Combobox could bind data and it show checkbox items.

When I click save button, I couldn't get combobox checkeditems collection. My code is here;

<telerik:RadComboBox ID="cmbNotificationUsers" runat="server" CheckBoxes="true" EnableCheckAllItemsCheckBox="true" Width="100%" OnClientItemsRequesting="OnClientItemsRequestingForUser"
                            EmptyMessage="Select" MarkFirstMatch="true" EnableLoadOnDemand="true">       
                            <WebServiceSettings Path="../../WebServices/ControlObjects/ComboBoxes.asmx" Method="GetUsersByCompany" />
                        </telerik:RadComboBox>

foreach (Telerik.Web.UI.RadComboBoxItem item in cmbNotificationUsers.CheckedItems)
            {
                messageUsers.Add(item.Value);
            }

Thanks,
Gökhan
Aman
Top achievements
Rank 1
 answered on 07 Apr 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?