Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
118 views
Hi.
how to make a text box accept only numbers?
Shinu
Top achievements
Rank 2
 answered on 02 Dec 2013
1 answer
97 views
Hi,

When using LightWeight render mode, you get a javascript error when trying to hide a menu item from javascript code:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="menu.aspx.vb" Inherits="TestaTredjepartWeb.menu" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="s" runat="server">
        </asp:ScriptManager>
        <div>
            <table>
                <tr>
                    <td>
                        <telerik:RadMenu ID="menu" runat="server" RenderMode="Lightweight">
                            <Items>
                                <telerik:RadMenuItem Text="Test1" Value="item1"></telerik:RadMenuItem>
                                <telerik:RadMenuItem IsSeparator="true" Value="separator"></telerik:RadMenuItem>
                                <telerik:RadMenuItem Text="Test2" Value="item2"></telerik:RadMenuItem>
                            </Items>
                        </telerik:RadMenu>
                    </td>
                </tr>
                <tr>
                    <td>
                        <input type="button" onclick="var menu = $find('menu'); menu.findItemByValue('item2').hide(); menu.findItemByValue('separator').hide();" value="Click to hide" />
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>

In the example above, the Test2-item gets hidden but a javascript error occurs when hiding the separator!
Works fine when not using LightWeight...

Regards
Andreas
Boyan Dimitrov
Telerik team
 answered on 02 Dec 2013
14 answers
222 views
I have a radmenu with SiteMap source and I am trying to show the seperator in certain places. I have code and also style to show them but it's not showing property in Metro skin. It shows fine in other skin. What's going on?
protected void RadMenu1_ItemDataBound(object sender, Telerik.Web.UI.RadMenuEventArgs e)
       {
 
           if (e.Item.Level == 1 && e.Item.Value == "Units")
           {
               Telerik.Web.UI.RadMenuItem separator = new Telerik.Web.UI.RadMenuItem();
               separator.IsSeparator = true;
 
               Telerik.Web.UI.RadMenuItem itm = (Telerik.Web.UI.RadMenuItem)e.Item;
               itm.Owner.Items.Insert(e.Item.Index + 1, separator);
           }
 
       }
<style type="text/css">
        /* <Separators> */
 
 .rmSeparator  {
            height: 1px !important;
            margin: 1px 0 0 !important;
            width: 25px !important;
            background-color: #A8A8A8 !important;
        }
    </style>
Kate
Telerik team
 answered on 02 Dec 2013
3 answers
431 views

 

<telerik:RadComboBox Filter="Contains" runat="server" ID="cmbTechnicalServicePerson" Width="420px"
    MarkFirstMatch="true" DataSourceID="DSGetTechnicalServicePerson" EnableLoadOnDemand="true"
    HighlightTemplatedItems="true" OnClientItemsRequested="UpdateItemCountField"
    OnDataBound="cmbTechnicalServicePerson_DataBound" OnItemDataBound="cmbTechnicalServicePerson_ItemDataBound"
    LabelWidth="100" Label="Technical Service Name:" Skin="Office2010Black" Style="position: absolute; top: 310px; left: 21px; z-index: 6500; height: 16px;" Text="Select  a Value" TabIndex="3">
    <HeaderTemplate>
        <ul>
            <li class="col1">Name</li>
            <li class="col2">Position</li>
            <li class="col2">Unit</li>
        </ul>
    </HeaderTemplate>
    <ItemTemplate>
        <ul>
            <li class="col1">
                <%# DataBinder.Eval(Container.DataItem, "[FULLNAME]")%></li>
            <li class="col2">
                <%# DataBinder.Eval(Container.DataItem, "Position")%></li>
            <li class="col3">
                <%# DataBinder.Eval(Container.DataItem, "[Department]")%></li>
        </ul>
    </ItemTemplate>
    <FooterTemplate>
        A total of
                <asp:Literal runat="server" ID="RadComboItemsTCount" />
        items
    </FooterTemplate>
 
</telerik:RadComboBox>

This is how my combo box set up in aspx page

 

I wanted to select the value from combo box using vb.net it select the value but the selected text will always “Select  a Value” which is default value.

This is how I am change the selected value inside the code

Me.cmbTechnicalServicePerson.SelectedValue = DRProjectDetailsinfo.Item("TechnicalServicePerson")

Or Me.cmbTechnicalServicePerson.SelectedValue = 12551

But it is not selecting the text any idea

Thanks

Syed

Nencho
Telerik team
 answered on 02 Dec 2013
4 answers
327 views
Hi,

I have below  javascript  function in code-behind file for expand & collapse node:

private void SetActions()

{

String sString =

@"

function SaveTreeState(action)

{

var tree = $find('" + RadTreeView1.ClientID + @"');

if(tree == null) { return; }

var nodes = tree.get_allNodes();

if(action == 'expand')

{

for(var cnt=0; cnt<nodes.length; cnt++)

{

nodes[cnt].expand();

}

}

if(action == 'collapse')

{

for(var cnt=0; cnt<nodes.length; cnt++)

{

nodes[cnt].collapse();

}

}

var expandedNodes = '';

for(var cnt=0; cnt<nodes.length; cnt++)

{

if(nodes[cnt].get_expanded())

{

expandedNodes += nodes[cnt].get_value() + '|';

}

}

SaveCookie('mpnotetreestate',expandedNodes);

}

function SaveCookie(name,value,days) {

if (days) {

if (days>730) {

days=730;

}

var date = new Date();

date.setTime(date.getTime()+(days*24*60*60*1000));

var expires = '; expires='+date.toGMTString();

}

else var expires = '';

document.cookie = name+'='+value+expires+'; path=/';

}

";

ScriptManager.RegisterClientScriptBlock(this, typeof(ViewNotes), "SaveTreeStateBlock", sString, true);

ViewToolBar1.btnExpandAll.Attributes.Add("onclick", "try{SaveTreeState('expand');}catch(err){return;}return false;");

ViewToolBar1.btnCollapseAll.Attributes.Add("onclick", "try{SaveTreeState('collapse');}catch(err){return}return false;");

}



In UI I am using the below:
<cc2:MPTreeView BorderStyle="None" OnNodeDataBound="RadTreeView1_NodeDataBound" OnClientNodeCollapsed="SaveTreeState"

OnClientNodeExpanded="SaveTreeState" ShowLineImages="false" ID="RadTreeView1" runat="server">

<CollapseAnimation Duration="100" Type="None" />

<ExpandAnimation Duration="100" Type="None" />



I am not able to collapse the treeview control on button click nor able to expand ? Could u please suggest.

Thanks
Bikash
Bikash
Top achievements
Rank 1
 answered on 02 Dec 2013
2 answers
99 views
Hi,

I want to show a RadConfirm when a certain ribbon bar button is clicked (in the client-side event handler), so the user can cancel the event.
Because the RadConfirm uses a callback, I have to cancel the click event, show the RadConfirm, and in the callback I have to do a postback if the user clicked "yes".
If found this example: http://demos.telerik.com/aspnet-ajax/window/examples/confirmserverclicks/defaultcs.aspx
How can I use this approach for a RibbonBarButton?

I have so far (pseudocode):
function OnRibbonBarButtonClicking(sender, args) {
   if (args.get_button().get_value() == "delete") {
      args.set_cancel(true);
      radConfirm("Sure?", _callbackFunc);
   }
}
 
function _callbackFunc(arg) {
   if (arg) {
      // do postback, but how?
   }
}

JP
Top achievements
Rank 1
 answered on 02 Dec 2013
6 answers
701 views
Greetings,

I'm currently evaluating RadGrid as my manager considers using it in a new project.
My manager asked me to examine the batch mode. One of his requirements is that new rows should be added to the bottom of the grid instead of the current behaviour of adding to the top.

addNewRecord adds to the top by default. Can I configure the grid to change this behaviour?
And if the answer is no, can I resort to a DOM hack to add the record TR element to the bottom? Will this be safe?
أشرف
Top achievements
Rank 1
 answered on 02 Dec 2013
1 answer
266 views
How to get value form select autocomplete entrise 
Princy
Top achievements
Rank 2
 answered on 02 Dec 2013
1 answer
113 views
When you add the filter and EnableRangeFiltering is set to true it shows the to and the from on the same line, is there a way to have it right justified and on 2 lines?
Venelin
Telerik team
 answered on 02 Dec 2013
1 answer
85 views

Hi There

I have a RadComboBox

And definition look like this

<telerik:RadComboBox Filter="Contains" runat="server" ID="cmbTechnicalServicePerson" Width="420px"

        MarkFirstMatch="true" DataSourceID="DSGetTechnicalServicePerson"

        HighlightTemplatedItems="true" OnClientItemsRequested="UpdateItemCountField"

        OnDataBound="cmbTechnicalServicePerson_DataBound" OnItemDataBound="cmbTechnicalServicePerson_ItemDataBound"

        LabelWidth="100" Label="Technical Service Name:" Skin="Office2010Black" Style="position: absolute; top: 310px; left: 21px; z-index: 6500; height: 16px;" EmptyMessage="Select  a Value" TabIndex="3">

        <HeaderTemplate>

            <ul>

                <li class="col1">Name</li>

                <li class="col2">Position</li>

                <li class="col2">Unit</li>

            </ul>

        </HeaderTemplate>

        <ItemTemplate>

            <ul>

                <li class="col1">

                    <%# DataBinder.Eval(Container.DataItem, "[FULLNAME]")%></li>

                <li class="col2">

                    <%# DataBinder.Eval(Container.DataItem, "Position")%></li>

                <li class="col3">

                    <%# DataBinder.Eval(Container.DataItem, "[Department]")%></li>

            </ul>

        </ItemTemplate>

        <FooterTemplate>

            A total of

                    <asp:Literal runat="server" ID="RadComboItemsTCount" />

            items

        </FooterTemplate>

 

    </telerik:RadComboBox>

Some time user would like to un select the selected value but this setting  does not allow them. Initial the EmptyMessage="Select  a Value" appear but as soon as they select something they will not be able to unselect to the empty value

Can someone please give some suggestion?

Many thanks

Syed

Nencho
Telerik team
 answered on 02 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?