Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
196 views
Hi,

I want some modification in the sceduler control. ie when we select the  calender control(which is integrated/child control with scheduler).
When we select the calender control the schduler should be desable.And after select the date the scheduler should be enable
Plese see the attached image

is this possible?

Thanks and regards
Harikrishnan
Plamen
Telerik team
 answered on 03 Oct 2012
1 answer
342 views
I'm trying to do Hierarchical Grid using two inner detail table, and the second table has also hierarchy.For the first hierarchy it works fine but while I'm trying to expand the second inner table it raise  Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index ,
I have put my code sample here
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
     <telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource"
           OnDetailTableDataBind="RadGrid1_DetailTableDataBind">
             <MasterTableView DataKeyNames="ID">
                 <DetailTables>
                   <telerik:GridTableView AutoGenerateColumns="True" Caption="Items" AllowSorting="false"
                     Width="100%" PageSize="7"  DataMember="Items">
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="MasterItemID" MasterKeyField="ID" />
                    </ParentTableRelation>
                    </telerik:GridTableView>
                     <telerik:GridTableView AutoGenerateColumns="True" Caption="Sub Kit" AllowSorting="false"
                     Width="100%" PageSize="7"  DataMember="Details">
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="MasterID" MasterKeyField="ID" />
                    </ParentTableRelation>
                    <DetailTables>
                     <telerik:GridTableView AutoGenerateColumns="True" Caption="sub Items" AllowSorting="false"
                     Width="100%" PageSize="7"  DataMember="SubKitItems">
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="ParentID" MasterKeyField="ID" />
                    </ParentTableRelation>
                    </telerik:GridTableView>
                     <telerik:GridTableView AutoGenerateColumns="True" Caption="Sub Kit" AllowSorting="false"
                     Width="100%" PageSize="7"  DataMember="SubKitDetails">
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="ParentID" MasterKeyField="ID" />
                    </ParentTableRelation>
                    </telerik:GridTableView>
                    </DetailTables>
                    </telerik:GridTableView>
                 </DetailTables>
                 
             </MasterTableView>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
 
public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
        if(e.IsFromDetailTable)
            return;
        RadGrid1.DataSource = MyList;
    }
 
    protected void RadGrid1_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e)
    {
        if (e.DetailTableView.DataMember == "Details")
        {
            e.DetailTableView.DataSource = MyList.Find(
                delegate(Master master)
                {
                    return master.ID == Convert.ToInt32(e.DetailTableView.ParentItem.GetDataKeyValue("ID"));
                }
                ).Details;
        }
        if (e.DetailTableView.DataMember == "Items")
        {
            int parentId = Convert.ToInt32(e.DetailTableView.ParentItem.GetDataKeyValue("ID"));
            e.DetailTableView.DataSource = MyList.Find(
                delegate(Master master)
                {
                    return master.ID == Convert.ToInt32(e.DetailTableView.ParentItem.GetDataKeyValue("ID"));
                }
                ).Items;
        }
        if (e.DetailTableView.DataMember == "SubKitDetails")
        {
            e.DetailTableView.DataSource = MyList.Find(
                delegate(Master master)
                {
                    return master.ID == Convert.ToInt32(e.DetailTableView.ParentItem.GetDataKeyValue("ID"));
                }
                ).SubKitDetails;
           
        }
 
        if (e.DetailTableView.DataMember == "SubKitItems")
        {
            e.DetailTableView.DataSource = MyList.Find(
                delegate(Master master)
                {
                    return master.ID == Convert.ToInt32(e.DetailTableView.ParentItem.GetDataKeyValue("ID"));
                }
                ).SubKitItems;
        }
    }
 
 
 
    public List<Master> MyList
    {
        get
        {
            List<Master> items = new List<Master>();
            for (int i = 0; i < 5; i++)
            {
                Master item = new Master();
                item.ID = i;
                item.Name = String.Format("Item{0}", i);
 
                List<Detail> detailList = new List<Detail>();
                List<Items> itemlist = new List<Items>();
                //sub items
                List<Detail> subKitDetails = new List<Detail>();
                List<Items> subKitItems = new List<Items>();
 
                for (int j = 0; j < 5; j++)
                {
                    Detail detailItem = new Detail();
                    Items myItem = new Items();
                    detailItem.ID = j;
                    detailItem.Name = String.Format("Item{0}", j);
                    detailItem.MasterID = i;
                    detailList.Add(detailItem);
                    myItem.ID = j;
                    myItem.Name = String.Format("Item{0},{1}", j, "Test Item");
                    myItem.MasterItemID = i;
                    itemlist.Add(myItem);
                    subKitDetails = GetSubKitDetails(i, j);
                    subKitItems = GetSubItems(i, j);
                }
 
                item.Details = detailList;
                item.Items = itemlist;
                item.SubKitDetails = subKitDetails;
                item.SubKitItems = subKitItems;
                items.Add(item);
            }
 
            return items;
        }
    }
 
    private List<Items> GetSubItems(int i, int j)
    {
        List<Items> subKitItems = new List<Items>();
        for (int k = 0; k < 5; k++)
        {
            Items myItem = new Items();
            myItem.ID = k;
            myItem.MasterItemID=i;
            myItem.Name = String.Format("Item{0},{1}", k, "Test subItem");
            myItem.ParentID = i;
            myItem.SubParentID = j;
            subKitItems.Add(myItem);
 
        }
        return subKitItems;
    }
 
    private List<Detail> GetSubKitDetails(int i, int j)
    {
        List<Detail> subKitDetails = new List<Detail>();
        for (int k = 0; k < 5; k++)
        {
            Detail detailItem = new Detail();
            detailItem.MasterID = i;
            detailItem.ID = k;
            detailItem.Name = String.Format("Item{0},{1}", k, "Test sub details");
            detailItem.ParentID = i;
            detailItem.SubParentID = j;
            subKitDetails.Add(detailItem);
 
        }
        return subKitDetails;
    }
}
    public class Master
    {
        public int ID { get; set; }
        public int ParentID { get; set; }
        public string Name { get; set; }
        public List<Detail> Details { get; set; }
        public List<Items> Items { get; set; }
        public List<Detail> SubKitDetails { get; set; }
        public List<Items> SubKitItems { get; set; }
    }
 
    public class Detail : Master
    {
        public int MasterID { get; set; }
        public int SubParentID { get; set; }    
    }
 
    public class DetailSecond : Master
    {
        public int MasterDetailID { get; set; }
        public int ParentID { get; set; }
    }
 
 
    public class Items : Master
    {
        public int MasterItemID { get; set; }
        public int SubParentID { get; set; }
 
    }
Thanks,
Andrey
Telerik team
 answered on 03 Oct 2012
4 answers
78 views
I'm trying to use the MonthYearPicker as my control for filtering datetime. However, when I try the code below, I get:

String was not recognized as a valid DateTime.

I've tried formatting several ways with no luck. I was trying to look at the event in the code behind, but I see no arguments at all that contains my filter values themselves. Just the  column name and expression.  Any help would be appreciated. Than you!


<
FilterTemplate>
                     
                    <telerik:RadMonthYearPicker ID="RadMonthYearPicker1" runat="server" ClientEvents-OnPopupClosing="MeasurementDateChanged" />
 
                            <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">
 
                                <script type="text/javascript">
                                    function MeasurementDateChanged(sender, args) {
                                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        var year = args._picker.FocusedDate[0];
                                        var month = args._picker.FocusedDate[1];
 
                                        var fromDate = new Date(year, month-1, 1);
                                        var toDate = new Date(year, month, 0);
 
 
                                        tableView.filter("MeasurementDate", fromDate.toISOString() + " " + toDate.toISOString(), "Between");
                                    }
                                </script>
 
                            </telerik:RadScriptBlock>
                    </FilterTemplate>
Eyup
Telerik team
 answered on 03 Oct 2012
1 answer
170 views
How do I access my codigoBehind a <telerik: RadButton in a ListView.ItemTemplate?

<telerik:RadListView  ID="RadListView1" >

// content

<LayoutTemplate>

// content

 </LayoutTemplate>
<ItemTemplate>
<div style="width:100%; height:20px; margin-left:5px; float:left">
                                                         <a style="font-family: Calibri; font-weight: bold; font-size: 14px;"> <%#Eval("Name")%></a>
                                                    </div>

<telerik:RadButton ID="rbDetails" runat="server" Text="Detalhes" Skin="Office2007" CommandName="details" Visible="false" >
                                                            <Icon PrimaryIconUrl="../Images/btns/btnMostra.png"  PrimaryIconTop="2px" PrimaryIconLeft="4px" PrimaryIconWidth="30px" PrimaryIconHeight="30px" />
                                                        </telerik:RadButton>

</ItemTemplate>

</telerik:RadListView>
Eyup
Telerik team
 answered on 03 Oct 2012
0 answers
117 views

the Hotkey short text is not congruent, some of the button with the same hotkey text is displayed different, I what I mean, is that the underline is closer to the letter on some buttons and other have more space below the texts and the underline. The hotkeys are all using the same code.

I have attached a picture for clarity.
any solution or ideas.

Gregory
Gregory
Top achievements
Rank 1
 asked on 03 Oct 2012
1 answer
88 views
Hi, I can not keep the state of the tree in the Master page.
This is my code
public List<string> BindNodes
{
    get
    {
        List<string> dataNodes = new List<string>();
        dataNodes.Add("item1");
        dataNodes.Add("item2");
        dataNodes.Add("item3");
        return dataNodes;
    }
}
 
protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
        BindTree();
}
 
 
private void BindTree()
{
    List<string> data= BindNodes;
    for (int i = 0; i < data.Count; i++)
        LoadRecursive(data[i], null);
}
 
private void LoadRecursive(string item, RadTreeNode parentNode)
{
    if (parentNode == null)
    {
        RadTreeNode childNode = new RadTreeNode();
        childNode.Value = "5";
        childNode.Text = item;
        childNode.Category = "category1";
        childNode.ExpandMode = TreeNodeExpandMode.ClientSide;
 
        tree.Nodes.Add(childNode);
        parentNode = childNode;
    }
    List<string> secondList= new List<string>();
    secondList.Add("sec1");
    secondList.Add("sec2");
 
    for (int i = 0; i < secondList.Count; i++)
    {
        RadTreeNode childNode = new RadTreeNode();
        childNode.Value = "5";
        childNode.Text = secondList[i];
        childNode.Category = "category2";
        childNode.ExpandMode = TreeNodeExpandMode.ClientSide;
        parentNode.Nodes.Add(childNode);
        //LoadRecursive(subSite[i], childNode);
    }
}
 
protected void tree_NodeClick(object sender, RadTreeNodeEventArgs e)
{
   switch (tree.SelectedNode.Category.ToString())
    {
        case "category1":
            Response.Redirect("~/Member/Cat1.aspx?id=" + tree.SelectedValue);
            break;
        case "category2":
            Response.Redirect("~/Member/Cat2.aspx?id=" + tree.SelectedValue);
            break;
     
    }
 
}
I looked at other similar threads in the forum, but  couldn't do it
Ivana
Telerik team
 answered on 03 Oct 2012
0 answers
52 views

the Hotkey short text is not congruent, some of the button with the same hotkey text is displayed different, I what I mean, is that the underline is closer to the letter on some buttons and other have more space below the texts and the underline. The hotkeys are all using the same code.

any solution or ideas.

Gregory
Gregory
Top achievements
Rank 1
 asked on 03 Oct 2012
1 answer
156 views
Hi there!

I am trying to use the RadSplitter with its Width and Height properties at 100% to have a full screen layout in the browser.
Before you think about this : Yes, I have read all the possible answer on this subject (the 100% on each container.) Please read further

My layout is composed of an horizontal Splitter (header, content, footer), with both header and footer having fixed sizes
and a nested vertical splitter in the content, having a sliding pane on each side and a main content pane in the middle.

I've come to setup the layout at 100% percent and everything works fine... until I make a single-classic-ASP.Net postback (synchronous).

After the postback, the Splitter takes (100% + scrollbar size) in both horizontal and vertical, and thus makes window's scrollbars to appear.
I can set the overflow:hidden on body to make them disappear, but my header and footer are still overflowing on the right and bottom, hiding some of my right aligned content.... Sad world. :(

Anyone already had this issue ? is it a bug ? am I too stupid to use a RadSplitter ?
David
Top achievements
Rank 1
 answered on 03 Oct 2012
1 answer
49 views
I have implemented EnableAutomaticLoadOnDemand and can be run perfectly locally. But when I deployed it to my staging server and access it via my local IE it freezes my IE when I start typing the first character in the drop down text box. Please advise. Following is my codes:



<telerik:RadComboBox ID="RadComboBox1" runat="server"
DataTextField="Code" Height="100px"
DataValueField="ClientID" DataSourceID="SqlDataSource1" Filter="StartsWith"
DropDownWidth="500px" ShowDropDownOnTextboxClick="False"
EnableVirtualScrolling="true" ShowMoreResultsBox="true"
HighlightTemplatedItems="True" EnableAutomaticLoadOnDemand="true"
AutoPostBack="True" EmptyMessage="Enter here"
OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged"
ItemsPerRequest="10" LoadingMessage="Searching..." MaxHeight="300px"
ShowWhileLoading="False" Width="300px" ExpandDirection="Down">
</telerik:RadComboBox>
Ivana
Telerik team
 answered on 03 Oct 2012
1 answer
39 views
Hi, I was just trying to create a demo website application (ver ASP.net AJAX Q2 2012 SP1 - latest version, as of now) website from first scratch. I added a master page and the component pages.

Added sliding zone / pane, splitter and all that stuff to the content page

Tried to run it, but could not see the master page contents :-/
Plamen
Telerik team
 answered on 03 Oct 2012
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
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
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?