Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
143 views
<telerik:RadTreeView ID="rtvResources" runat="server" OnClientNodeClicked="rtvResources_OnClientNodeClicked"
                        OnClientContextMenuItemClicking="rtvResources_OnClientContextMenuItemClicking"
                        OnClientContextMenuShowing="rtvResources_OnClientContextMenuShowing" OnClientNodePopulationFailed="function(o,e){}" >
                        <Nodes>
                            <telerik:RadTreeNode runat="server" Text="Public" AllowDrop="false" CssClass="PUBLIC"
                                ImageUrl="~/Images/folder-icon.png" Selected="true">
                            </telerik:RadTreeNode>
                            <telerik:RadTreeNode runat="server" Text="My Resources" AllowDrop="false" CssClass="USER"
                                ImageUrl="~/Images/folder-icon.png">
                            </telerik:RadTreeNode>
                            <telerik:RadTreeNode runat="server" Text="Search Folders" AllowDrop="false" CssClass="SEARCH"
                                ImageUrl="~/Images/search-folder-icon.png" Value="SEARCH">
                            </telerik:RadTreeNode>
                        </Nodes>
                        <ClientNodeTemplate><span id="#=Value#_span">#=Text#</span> <input type="text" value="#=Text#" style="display:none;width:100px;" id="#=Value#_txtEdit" onblur="javascript:Rename();"></input>
                        </ClientNodeTemplate>
                        <WebServiceSettings Path="ManageResources.aspx" Method="wmGetResources"  />
</telerik:RadTreeView>
This is working fine .
But if I get exception in webservice it throws exption message using alert popup.
I try to handle with OnClientNodePopulationFailed="function(o,e){}"  but still it shows expetion message in window .Please provide way to handle it.

Thanks ,
Somnath

Ivana
Telerik team
 answered on 03 Oct 2012
5 answers
157 views
I currently have a GridDateTimeColumn with PickerType = DateTimePicker. I want to change the timeview to display in 2 columns instead of the default 3. I've searched the forums and found what I thought should be solutions but the code seems to have no effect. 
(http://www.telerik.com/community/forums/aspnet-ajax/grid/many-grid-questions.aspx ; http://www.telerik.com/community/forums/aspnet-ajax/grid/how-to-localize-datetimepicker-s-tooltip-in-filter-menu.aspx )


In the RadGrid1_ItemDataBound event I have the following code:

GridEditableItem item = (GridEditableItem)e.Item;
 
RadDateTimePicker expiresTimePicker = (RadDateTimePicker)item["Expires"].Controls[0];
expiresTimePicker.TimeView.Columns = 2;
 
GridDateTimeColumnEditor colEd = (item.EditManager.GetColumnEditor("Expires") as GridDateTimeColumnEditor);
(colEd.PickerControl as RadDateTimePicker).TimeView.Columns = 2;

The column is declared as: 
<telerik:GridDateTimeColumn DataField="Expires" DataFormatString="{0:g}" ReadOnly="false"  PickerType="DateTimePicker"
      HeaderText="Expires" UniqueName="Expires" SortExpression="Expires" AllowFiltering="false" ConvertEmptyStringToNull="true" >
</telerik:GridDateTimeColumn>


While debugging, these statements do get executed and the Columns value is updated to 2. When I test the result in the browser the TimeView still pops up with a 3 column layout - so the code appears to have had no effect.

Is the itemDataBound event the wrong event for such a change? I've tried to add similar code to the ItemCreated event but not been able to access the editor there at all. 


Kostadin
Telerik team
 answered on 03 Oct 2012
1 answer
37 views
I have created a modalpop while we click on the calender.
That means When we click on the calender the schedule r wil hide and calender will coming(enable.).After click on thedate the scheduler will be enable.
Its working nice.Thank u telerik team
They helped me lot

http://www.telerik.com/community/forums/aspnet-ajax/scheduler/scheduler-calender-control-customization.aspx

See the attach image(Image1)

BUT THIS IS NOT WORKING IN IE7 and IE8-Compat mode and IE9-Copat Mode.

in ie8,IE9,FF and CHROm ther is no issue....:)

Any Idea?See the attached image

Thanks
Hari




Plamen
Telerik team
 answered on 03 Oct 2012
9 answers
198 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
346 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
79 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
175 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
89 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
55 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?