Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
97 views
How do i get selected day DataKeyField (id) on single click server side?
I use ReadOnly="true"

Plamen
Telerik team
 answered on 08 Apr 2015
7 answers
90 views
Hello Support,

We are using 2013.1.220.35 Version of telerik.

We have an issue while dragging dropping row.

When using drag/drop in grid if you right click while dragging the item you are dragging becomes stuck in place on the screen.

Attaching the snapshot.

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

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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 runat="server" ID="ScriptManager1">
    </asp:ScriptManager>
    <script type="text/javascript">
        function rowDblClick(sender, eventArgs) {
            sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
        }
    </script>
    <div>
        <telerik:RadGrid ID="rgDomo" AutoGenerateColumns="false" CellSpacing="2" MasterTableView-NoMasterRecordsText="There are no records to display"
            Skin="WebBlue" BorderStyle="Double" BorderColor="Black" Visible="true" Width="900"
            runat="server" OnRowDrop="RowDrop" AllowMultiRowEdit="True" OnItemDataBound="rgDomo_ItemDataBound"
            OnItemCreated="rgDomo_ItemCreated">
            <ClientSettings EnableAlternatingItems="false">
            </ClientSettings>
            <MasterTableView DataKeyNames="iDomoID,iOrderNo,sDomoListImage,sDomoBGImage,bIsSystemDomo,bVisibleToSideBar,sDomoName,bIsGroupDomo,iDomoType"
                EditMode="InPlace">
                <Columns>
                    <telerik:GridBoundColumn DataField="iDomoID" Visible="false" />
                    <telerik:GridBoundColumn DataField="bIsSystemDomo" Visible="false" />
                    <telerik:GridBoundColumn DataField="iOrderNo" Visible="false" />
                    <telerik:GridBoundColumn DataField="bVisibleToSideBar" Visible="false" />
                    <telerik:GridBoundColumn DataField="bIsGroupDomo" Visible="false" />
                    <telerik:GridBoundColumn DataField="iDomoType" Visible="false" />
                    <telerik:GridTemplateColumn ItemStyle-Width="34" HeaderText="Sort" UniqueName="Sort">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Bottom" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" CssClass="col1" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn DataField="sDomoListImage" Visible="false" />
                    <telerik:GridTemplateColumn ItemStyle-Width="34" HeaderText="Icon" UniqueName="Sort">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Bottom" CssClass="col2" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" CssClass="col2" />
                        <ItemTemplate>
                            <asp:ImageButton ID="btnIcon" ImageUrl='<%#HttpContext.Current.Session("imageUrl")+ Eval("sDomoListImage")%>'
                                BackColor='<%# System.Drawing.ColorTranslator.FromHtml(Eval("sDomoBGImage"))%>'
                                OnClick="btnIcon_Click" Width="34px" CssClass="iconimage" runat="server" />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn ItemStyle-Width="50" ColumnGroupName="Domo" HeaderText="Label"
                        UniqueName="sDomoName">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Bottom" CssClass="col3" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" CssClass="col3" />
                        <ItemTemplate>
                            <asp:TextBox ID="txtDomoName" runat="server" Text='<%#Eval("sDomoName")%>' BackColor="#213051"
                                ForeColor="White" CssClass="labletext" 
                                AutoPostBack="true"></asp:TextBox>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn ItemStyle-Width="50" HeaderText="Show/Hide" UniqueName="IsVisibleToSideBar">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Bottom" CssClass="col4" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" CssClass="col4" />
                        <ItemTemplate>
                            <asp:CheckBox ID="chkShowHide" runat="server"  
                                AutoPostBack="true" />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn ItemStyle-Width="50" HeaderText="Delete" UniqueName="Delete">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Bottom" CssClass="col5" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" CssClass="col5" />
                        <ItemTemplate>
                          
                            <asp:Image ID="btnDelete" ImageUrl="../Images/Buttons/delete-btn_workvine.png" 
                                runat="server" alt="Delete Domo" title="Delete Domo" Style="cursor: pointer" />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings AllowRowsDragDrop="true">
                <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                <ClientEvents OnRowDblClick="rowDblClick" />
            </ClientSettings>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>















Angel Petrov
Telerik team
 answered on 08 Apr 2015
8 answers
353 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
75 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
637 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
124 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
78 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
102 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
93 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
58 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?