Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
204 views

Here is my scenario

I have two grid and two buttons and layout is as follows

UI :

1. Student_Grid <Student Name, Student ID, Select Checkbox> : Student Info Grid

2. Move Button : Button which will Copy Selected Students from Student_Grid to Notice_Grid

3. Notice_Grid <Student Name, Student ID, some columns, Hobbies_dropdownlist>

4. Submit  Button : which will send data to server.

DataTable :

1. Student_data <master>

2. Hobbies_data <master>

3. Student_hobbies <relationship table>

Requirement :

User will select few students from Student_Grid and use Move button to copy those to Notice_Grid where user selects Hobbies (which is different for different students)

Problem:

I am creating datatable in aspx.vb page and then binding that data to Notice_Grid. Problem is, I m not able to populate dropdownlist datasource since, it is dynamic. I tried different ways but didnt find way to assign datasource to dropdownlist/combobox based on studentid. each row could have different list under hobbies column.

 

Thanks in advance

 

Note: I am using Radgrid with Batch mode

Konstantin Dikov
Telerik team
 answered on 08 Apr 2015
1 answer
309 views

With reference to the attached image, I would like to adjust the scrollbar to fit in better with the Metro Touch skin.

 I do not want to resort to an external plug-in, just make the color or shading more harmonious with the surrounding content.

 

 

 

Magdalena
Telerik team
 answered on 08 Apr 2015
6 answers
68 views

With the below code snippet, the text is offset to the right and down in the first RadOrgChart node, and becomes further offset in each subsequent node... rapidly disappearing completely from the node.

When exporting a table that has multiple RadGrids, the text is properly centered but the images of table borders and RadGrid cells are offset left and up. Almost as if the image ignores the PDF margins while the text does not.

Does anyone have an idea on how to get the PDF to reflect what is seen on the screen?
<div class="foo">
       <telerik:RadOrgChart ID="orgCMF" runat="server" DataFieldID="POSC" DataFieldParentID="CPMOS"
          DataTextField="POSC" DisableDefaultImage="true" OnNodeDataBound="orgCMF_NodeDataBound" Skin="Simple">
          <ItemTemplate>
              <div class="nodeText">
                  <span>Rank: <%#DataBinder.Eval(Container.DataItem, "Rank")%></span></br>
                  <span>DMOS: <%#DataBinder.Eval(Container.DataItem, "POSC")%></span>
                  <br />
                      <asp:Label ID="lblAuth" runat="server"/>
                  <br />
                      <asp:Label ID="lblAuthFem" runat="server" />
                  <br />
              </div>
          </ItemTemplate>
 
       </telerik:RadOrgChart>
</div>


Peter Filipov
Telerik team
 answered on 08 Apr 2015
1 answer
187 views
Hi, we are using the Editor to upload file to another folder outside of the website folder.
Is there a way to change the Editor's Absolute Path programmatically?

Example in http://www.abc.com/admin/

1. We set the Image Manager path using ~/client/{client_name} which is a virtual folder pointing to folder outside of the current website folder. The {client_name} is a variable depending on current user.

2. The editor will then automatically set the image path as http://www.abc.com/client/{client_name}/image.jpg.

3. Is there a way to change the absolute path to http://www.fileserverabc.com/client/{client_name}/image.jpg
    instead of http://www.abc.com/client/{client_name}/image.jpg ?

Thanks.
Danail Vasilev
Telerik team
 answered on 08 Apr 2015
5 answers
99 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
93 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
360 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
77 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
644 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
129 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?