Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
118 views
Hi there,

is it possible using either radtextbox, or radmaskedtextbox to limit the input to only one word ?

Regards,

Alan
Alan T
Top achievements
Rank 1
 answered on 25 Jul 2011
2 answers
131 views
I have found, and tried, some of the solutions for this problem in this forum.  I'm somewhat new to Telerik controls, and I'm sure this is part of my problem, but what I want to do should not be this difficult! 

I need to limit the height of a combobox when click (dropdown).
Here is the code (copied right from a lising on this forum):
//This function limits the size of the combo box dropdown size.
    function OnClientDropDownOpeningHandler(sender, eventArgs)
    {
    //set the max allowed height of the combo 
    var MAX_ALLOWED_HEIGHT = 140;
    //this is the single item's height 
    var SINGLE_ITEM_HEIGHT = 22;
    //var calculatedHeight = ctlUserCombo.get_items().get_count() * SINGLE_ITEM_HEIGHT;
    var dropDownDiv = sender.get_dropDownElement();
 
    if (calculatedHeight > MAX_ALLOWED_HEIGHT) 
    
        setTimeout (
            function () {
                dropDownDiv.firstChild.style.height = MAX_ALLOWED_HEIGHT + "px"; 
            }, 20
        );                
    
    else 
    
        setTimeout (
 
            function ()
            {
                dropDownDiv.firstChild.style.height = calculatedHeight + "px"; 
            }, 20
        );
    }
  
    }
The first time I tried this I got a runtime error when I tried to calculate calculatedHeight.  The error was that the method was "Object doesn't support this property or method".  So I just put a hard value in there to see if that would work...NOPE, go the same error on the line trying to get the dropDownDiv.

I also tried sending in the name of the control directly instead of using the SENDER parameter...same thing happens. 

This page is used in several other applications, and some of them cut off the bottom of the dropdown.  All I need is a way to limit the height so that doesn't happen and the users can scroll to the bottom.  Why is this so hard?  In the web config it appears the controls are from Q3 2008, and that cannot change. 

Can anyone see what the heck I'm doing wrong and/or point me to some documentation that actually works?

Thanks from a VERY frustrated developer.

Rich
Thad
Top achievements
Rank 2
 answered on 25 Jul 2011
2 answers
93 views
telerik Hello friends would give me a help with this problem I have is that I have the paa RadMenu in them I have new, save, edit, modify, search, example

When I click the Save button checks if I have entered the relevant data if all data entry saves the save data but when I want to display a radwindows saying "successfully saved" as that radwindows designed it myself and call it a click of a button and when I call do not call it but if you click ago called when the other buttons I hope I can help



from already thank you very much here is my example I have developed

Here my example
ROJAS
Top achievements
Rank 1
 answered on 25 Jul 2011
1 answer
76 views
Hello,

I noticed this in the latest build of Telerik, and was not present in the previous version that we were using (2010 first quarter).  We're now using: 2011.1.519.35 

I've tested this across all 3 major browsers for PC (IE8, FF 5.0, Chrome latest)

if you use the following HTML and paste it into HTML view in the Editor, switch to Design view and select a link, and ctrl-k or use the toolbar/menu to get to the link properties.. It forces you to the 2nd tab "anchor" and if you go to the first tab "hyperlink" the URL is not populated.. 


<a href="http://twitter.com" name="twitter" >twitter</a> <br />
<a href="http://facebook.com" name="facebook">facebook</a> <br />
<a href="http://linkedin.com" name="linkedin">linkedin</a> <br />
<a href="http://youtube.com" name="youtube" >youtube</a>

Brian Garson
Top achievements
Rank 2
 answered on 25 Jul 2011
2 answers
86 views
I am actually using Q2.
Where should i place my skin folder on server?
Srinivasa
Top achievements
Rank 1
 answered on 25 Jul 2011
10 answers
518 views
Is there any way to disable the return key behavior in a RadGrid? Thanks. 
Daniel Aquere
Top achievements
Rank 2
 answered on 25 Jul 2011
1 answer
77 views
Scenario:
  1. User clicks "Save" button
  2. I populate a javascript object with the form values, serialize it
  3. ???
  4. Notification is shown with the saved results

I'm unsure what to do for step 3...
saveNotificationPanel.set_value(Sys.Serialization.JavaScriptSerializer.serialize(values));

I'm setting the values, and I have it wired up to the Webservice, but I'm not getting an xmlhttpcallback happening.

Is there additional something I need to do to force that callback to happen?  I'm using it like the RadXmlHttpPanel where set_value does the callback, but I assume this works differently?

The idea is the values get sent to the webservice which saves them to the DB, and the result is returned to the page as Success or Fail and I'll change the panel details clientside.

Steve
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 25 Jul 2011
1 answer
125 views
Hi!  How can I go from displaying an EmptyDataTemplate to an ItemTemplate when a user clicks a button? 

Currently I have an 'Add' button in the EmptyDataTemplate of a RadListView.  I want the user to click the 'Add' button and have the ItemTemplate display (which has various fields for user input).

Here's the aspx code for the EmptyDataTemplate:
<EmptyDataTemplate>
    <table>
        <tr>
            <td>
                <fieldset style="width: 800px">
                    <legend>SubSelection</legend>No Sub-Selections available.
                </fieldset>
            </td>
            <td style="width: 25%; text-align: right;">
                <asp:Button ID="btnAdd" runat="server" Text="Add" OnClick="btnAdd_Click" CommandName="InitInsert"/>
            </td>
        </tr>
    </table>
</EmptyDataTemplate>

Here's the vb.net code for the button click event:
Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        RadListView1.InsertItemPosition = RadListViewInsertItemPosition.FirstItem
        RadListView1.Rebind()
End Sub

I can step through the code when debugging, but nothing happens when the 'Add' button is clicked.

I also have the same 'Add' button on the EditItemTemplate with a value of 'InitInsert' for the 'CommandName'.  This button works fine since the EditItemTemplate fires off the RadListView ItemCommand routine.  In the ItemCommand routine for the 'InitInsert' command I have the same 2 lines of code used for the button click.

I'm not understanding why this doesn't work for the button click event, and was wondering if someone could explain it to me or provide an alternate solution.

Thanks!
Amy
Top achievements
Rank 1
 answered on 25 Jul 2011
9 answers
493 views
hi guys
i have a problem with GridTemplateColumn
my program do this steps:
1- on the server side and on the page load i load some of data and binding the Grid to show personels image and info
        DAL.Personels ObjPersonels = new DAL.Personels();
        DataTable PersonelsDT = new DataTable();
        PersonelsDT = ObjPersonels.Personels_SELECT_BY_DepartmentID(1,true);
        RadGrid1.DataSource = PersonelsDT;
        RadGrid1.DataBind();


on this step every thing is OK and the IMG in the GridTemplateColumn  shows currectly
2-After Page Load the user can click on a Organization chart and show personels work on that node. this step must be client side
my GridTemplateColumn:
<telerik:GridTemplateColumn>
     <ItemTemplate>
         <img src='pics/personels/<%# Eval("Pic") %>'  width="60px" height="70px"/>
     </ItemTemplate>
 </telerik:GridTemplateColumn>

codes for binding client side Grid:
function OrganizationChartNode_Chicked(sender, args) {
     var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
     PageMethods.GetData(args.get_node().get_value(), false, 1, tableView.get_pageSize(), tableView.get_sortExpressions().toString(), tableView.get_filterExpressions(), updateGrid);
 }
 
 function updateGrid(result) {
     var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
     tableView.set_dataSource(result);
     tableView.dataBind();
 }

on this step all columns show correctly, but the IMG tag in the templateColumn shows the Old data,and dont refresh, like catching !!!

here is my full server side code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Web.Services;
using Telerik.Web.UI;
 
public partial class MonthlyOutputState : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //Initializing WorkPeriodsComboBox: Start
        DAL.WorkPeriods objWorkPeriods = new DAL.WorkPeriods();       
        DataTable WorkPeriodsDT = new DataTable();
        WorkPeriodsDT = objWorkPeriods.WorkPeriods_Select_All();
 
        for (int i = 0; i < WorkPeriodsDT.Rows.Count; i++)
        {
            Telerik.Web.UI.RadComboBoxItem ComboBoxItem=new Telerik.Web.UI.RadComboBoxItem(WorkPeriodsDT.Rows[i][1].ToString(),WorkPeriodsDT.Rows[i][0].ToString());
            ComboBoxItem.Attributes.Add("Sdate", WorkPeriodsDT.Rows[i][2].ToString());
            ComboBoxItem.Attributes.Add("Edate", WorkPeriodsDT.Rows[i][3].ToString());
            RadComboBoxWorkPeriods.Items.Add(ComboBoxItem);           
        }       
        RadComboBoxWorkPeriods.FindItemByValue(objWorkPeriods.WorkPeriods_Get_Current().Rows[0][0].ToString()).Selected=true;
        //Initializing WorkPeriodsComboBox: End
        //Initializing Menu: Start
        Telerik.Web.UI.RadTreeNode Node = new Telerik.Web.UI.RadTreeNode();
        Node.Text = "چارت سازماني";
        Node.Value = "0";
        RadTreeView1.Nodes.Add(Node);
 
        DAL.departments objdepartments = new DAL.departments();
        DataTable departmentsDT = new DataTable();
        departmentsDT = objdepartments.departments_Select_All();
 
        AddSubTree(departmentsDT, Node);
        RadTreeView1.ExpandAllNodes();
        //Initializing Menu: End
        //Initializing Grid: Start
        DAL.Personels ObjPersonels = new DAL.Personels();
        DataTable PersonelsDT = new DataTable();
        PersonelsDT = ObjPersonels.Personels_SELECT_BY_DepartmentID(1,true);
        RadGrid1.DataSource = PersonelsDT;
        RadGrid1.DataBind();
        //Initializing Grid: End
    }
 
    public void AddSubTree(DataTable dt, Telerik.Web.UI.RadTreeNode Node)
    {
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            if (dt.Rows[i][1].ToString() == Node.Value)
            {
                Telerik.Web.UI.RadTreeNode Node22 = new Telerik.Web.UI.RadTreeNode();
                Node22.Value = dt.Rows[i][0].ToString();
                Node22.Text = dt.Rows[i][2].ToString();
                // Node22.NavigateUrl = ;
                //Node22.ToolTip = dt.Rows[i][3].ToString();
                //if (dt.Rows[i][7].ToString() != "")
                //   // Node22.Attributes.Add("URL", dt.Rows[i][7].ToString());
                //else
                //    Node22.Attributes.Add("URL", "NULL");
                Node.Nodes.Add(Node22);
                AddSubTree(dt, Node22);
            }
        }
    }
 
    [WebMethod]
    public static int GetCount(List<GridFilterExpression> filterExpressions)
    {
        return 0;
    }
 
    [WebMethod]
    public static List<object> GetData(int departmentID, bool SelectSubNodesPersonels, int startIndex, int maximumRows, string sortExpressions, List<GridFilterExpression> filterExpressions)
    {
        DAL.Personels ObjPersonels = new DAL.Personels();
        DataTable DT = ObjPersonels.Personels_SELECT_BY_DepartmentID(departmentID, SelectSubNodesPersonels);
 
        return ObjPersonels.Convert_DataTable_To_List_Object(DT);
    }
}

here is my Full Client side Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OutputState_Sum.aspx.cs"
    Inherits="MonthlyOutputState" %>
 
<!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>
    <link href="css/MainStylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <script language="javascript" type="text/javascript">
        function OrganizationChartNode_Chicked(sender, args) {
            var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
            PageMethods.GetData(args.get_node().get_value(), false, 1, tableView.get_pageSize(), tableView.get_sortExpressions().toString(), tableView.get_filterExpressions(), updateGrid);
        }
 
        function updateGrid(result) {
            var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
            tableView.set_dataSource(result);
            tableView.dataBind();
        }
 
        function OnClientContextMenuItemClicked(sender, args) {
            var menuItem = args.get_menuItem();
            var treeNode = args.get_node();
            menuItem.get_menu().hide();
            treeNode.select();
 
            switch (menuItem.get_value()) {
                case "OpenNodeWithSubs":
                    {
                        var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
                        PageMethods.GetData(args.get_node().get_value(), true, 1, tableView.get_pageSize(), tableView.get_sortExpressions().toString(), tableView.get_filterExpressions(), updateGrid);
                        //  args.get_node().get_value
                    }
                    break;
                //////////////////////////////////////////// Adding tab and page views: End       
                case "Rename":
                    treeNode.startEdit();
                    break;
            }
        }
    </script>
    <form id="form1" runat="server" dir="rtl" style="width: 100%; height: 100%">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePageMethods="True">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <div class="parent">
        <div class="FixedTop" style="height: 60px">
            <table style="width: 100%; height: 100%; vertical-align: top;" cellpadding="0px"
                cellspacing="0px">
                <tr>
                    <td>
                        <table>
                            <tr>
                                <td>
                                    دوره
                                </td>
                                <td>
                                    <telerik:RadComboBox ID="RadComboBoxWorkPeriods" runat="server" Style="z-index: 7001">
                                    </telerik:RadComboBox>
                                </td>
                                <td>
                                    گروه
                                </td>
                                <td>
                                    <telerik:RadComboBox ID="RadComboBox2" runat="server">
                                    </telerik:RadComboBox>
                                </td>
                                <td>
                                    شماره پرسنلي
                                </td>
                                <td>
                                    <input type="text" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr style="background-image: url('../UI/Pics/Icons/bar1.png');">
                    <td dir="rtl">
                        <telerik:RadMenu ID="RadMenu1" runat="server" dir="rtl" Skin="Telerik" Flow="Horizontal"
                            Style="top: 0px; right: 0px">
                            <Items>
                                <telerik:RadMenuItem runat="server" Text="محاسبه" ImageUrl="~/Pics/Icons/Calculate.gif">
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem runat="server" IsSeparator="true">
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem runat="server" Text="فيلتر" ImageUrl="~/Pics/Icons/Filter.gif">
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem runat="server" IsSeparator="true">
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem runat="server" Text="ايجاد کار" ImageUrl="~/Pics/Icons/Task.png">
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem runat="server" IsSeparator="true">
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem runat="server" Text="نمايش ريز کارها" ImageUrl="~/Pics/Icons/Filter.gif">
                                </telerik:RadMenuItem>
                            </Items>
                        </telerik:RadMenu>
                    </td>
                </tr>
            </table>
        </div>
        <div class="FullOfRemainingBody" style="top: 60px">
            <table style="width: 100%; height: 100%;">
                <tr>
                    <td id="Chart" style="width: 200px; vertical-align: top">
                        <telerik:RadTreeView ID="RadTreeView1" runat="server" Skin="Default" dir="rtl" Font-Names="KasraB Traffic"
                            Font-Bold="True" OnClientNodeClicking="OrganizationChartNode_Chicked" OnClientContextMenuItemClicked="OnClientContextMenuItemClicked">
                            <ContextMenus>
                                <telerik:RadTreeViewContextMenu ID="RadTreeViewContextMenu1" runat="server">
                                    <Items>
                                        <telerik:RadMenuItem runat="server" Text="کليه زير مجموعه ها" Value="OpenNodeWithSubs">
                                        </telerik:RadMenuItem>
                                    </Items>
                                    <Items>
                                        <telerik:RadMenuItem runat="server" Text="سرجمع براي واحدهاي يک سطح پايين تر" Value="OpenNodeWithSubs">
                                        </telerik:RadMenuItem>
                                    </Items>
                                </telerik:RadTreeViewContextMenu>
                            </ContextMenus>
                        </telerik:RadTreeView>
                    </td>
                    <td style="vertical-align: top">
                        <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Vista">
                            <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
                                <Selecting AllowRowSelect="True" />
                            </ClientSettings>
                            <MasterTableView Font-Names="KasraB Traffic" Font-Bold="true" AllowSorting="true">
                                <Columns>       
                                    <telerik:GridTemplateColumn>
                                        <ItemTemplate>
                                            <img src='pics/personels/<%# Eval("Pic") %>'  width="60px" height="70px"/>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                            </MasterTableView>
                        </telerik:RadGrid>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    </form>
</body>
</html>


I tested some methods like set DataFiels="Pic" and UniqueName="Pic" but not work, i think we cannot use this method:
<ItemTemplate>
<img src='pics/personels/<%# Eval("Pic") %>'  width="60px" height="70px"/>
</ItemTemplate>

but it works when we Bind server side,but maybe catched when binding client side
how can i program my idea?

i attached the a screen shot of my main page program.
i can attach the full project if need

thank my friends
Mohammad sadegh
Top achievements
Rank 1
 answered on 25 Jul 2011
1 answer
110 views
All,

I am using Q3 2010 ASP.NET AJAX controls, and am having a problem with the OnBlur event. I am trying to do a calculation similar to the Grid Header/Footer Calc example in the demo. What I have is as follows:

Main page grid launches a tooltip per record. The tooltip content is a user control. Inside the user control is a grid and some labels. The grid is immediately put into edit mode when the tooltip is opened, and when the user exits the editable field in a given record, I want to update the label.

I have followed the example, and had no luck. Right now I have a RadNumericTextBox with ClientEvents set OnBlur="OnBlur" and a javascript method named OnBlur() with just a alert. Nothing happens.

I have added an AjaxPanel around the entire control. No change. I have instead used OnBlur="javascript:OnBlur()". No change. I have put the script in the parent of the tooltip. No change...

Any suggestions?

All help greatly appreciated.

Thanks,
B
Bruce
Top achievements
Rank 1
 answered on 25 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?