Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
60 views
Hi,
We puchased a license for RadControls for ASP.NET AJAX recently. Does that imply that all previous versions of the product are also licensed to us in the same.

Thanks.
Rumen
Telerik team
 answered on 25 Apr 2011
2 answers
148 views
Hi there,

I am having some difficulties getting the functionality I desired using the RadMenu widget.

Here is the functionality I would like to achieve:
1) I have a repeater for each "row" of information
2) Each row has 1 menu item with 6 sub menu items
3) Clicking the 1 menu item, it expands the 6 sub menu items
4) When selecting a sub menu item, it validates some input and calls a server side method.  If the validation fails, it stays on the page.

Pretty simple, however, I am running into the case where I have everything mentioned but I can click and expand multiple menu items.

//to not expand on mouse over
function
OnClientMouseOverHandler(sender, eventArgs) {
    if (eventArgs.get_item().get_text() == 'Add') {
        sender.set_clicked(false);
    }
}

//to close the menu only if a sub menu is clicked
function
OnClientItemClickedHandler(sender, eventArgs) {
     var item = eventArgs.get_item();
     if (item.get_text() == 'Add') {
         eventArgs.set_cancel(true);
     } else {
        sender.close();
     }
}
 
//if sub menu is clicked, validate the field or if menu is clicked, expand the sub menu
//if input is invalid or menu is clicked, set cancel to stop a postback
function
OnClientItemClickingHandler(sender, eventArgs) {
    var item = eventArgs.get_item();
    if (item.get_text() != 'Add') {
        ResetQuantityStyles(sender._element);
        var parent = sender._element.parentNode;
 
        while (parent.nodeName != 'TR') {
            parent = parent.parentNode;
        }
        var list = parent.getElementsByTagName('input');
        var i = 0;
        for (i = 0; i < list.length; i++) {
            var txtQuantity = list[i];
            if (txtQuantity.id.indexOf('txtQuantity') > -1) {
                if (txtQuantity.value == '') {
                    txtQuantity.style.background = 'pink';
                    sender.close();
                    eventArgs.set_cancel(true);
                }
                break;
            }
        }
    }
    else
    {
        item.open();
        eventArgs.set_cancel(true);
    }
}
 
function ResetQuantityStyles(element) {
    var parent = element.parentNode;
 
    while (parent.nodeName != 'TABLE') {
        parent = parent.parentNode;
    }
    var list = parent.getElementsByTagName('input');
    var i = 0;
    for (i = 0; i < list.length; i++) {
        var txtQuantity = list[i];
        if (txtQuantity.id.indexOf('txtQuantity') > -1) {
            txtQuantity.style.background = '';
        }
    }
}

And my tag looks like this

<telerik:RadMenu runat="server" ID="rmAddIngredient" Visible="false"
    OnClientItemClicking="OnClientItemClickingHandler"
    OnClientMouseOver="OnClientMouseOverHandler"
    OnClientItemClicked="OnClientItemClickedHandler"
    OnItemClick="rmAddIngredient_Click" ClickToOpen="true">
    <Items>
        <telerik:RadMenuItem Text="Add">
            <Items>
                <telerik:RadMenuItem runat="server" Text="Breakfast" Value="1"></telerik:RadMenuItem>
                <telerik:RadMenuItem runat="server" Text="Morning Snack" Value="2"></telerik:RadMenuItem>
                <telerik:RadMenuItem runat="server" Text="Lunch" Value="3"></telerik:RadMenuItem>
                <telerik:RadMenuItem runat="server" Text="Afternoon Snack" Value="4"></telerik:RadMenuItem>
                <telerik:RadMenuItem runat="server" Text="Dinner" Value="5"></telerik:RadMenuItem>
                <telerik:RadMenuItem runat="server" Text="Evening Snack" Value="6"></telerik:RadMenuItem>
            </Items>
        </telerik:RadMenuItem>
    </Items>
</telerik:RadMenu>
John
Top achievements
Rank 1
 answered on 25 Apr 2011
1 answer
29 views
hi

Based on your example http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourceavailability/defaultcs.aspx

My users are login based on username and password, and their username is assign to a session variable.

How do i use this session variable in the resourcetype instead of using DataSourceID? Thanks

 <ResourceTypes>
             <telerik:ResourceType KeyField="ID" Name="User" TextField="UserName" ForeignKeyField="UserID"
                 DataSourceID="UsersDataSource" />
</ResourceTypes>
Peter
Telerik team
 answered on 25 Apr 2011
1 answer
94 views
Hi,
I want to make my dialogs (link manager ,....) right to left as is here:
http://demos.telerik.com/aspnet-ajax/editor/examples/righttoleft/defaultcs.aspx

It says refer to "RTL/RadEditor_Dialogs_RTL.css" and it doesn't share this file.
How can I get and use it?
I haven't installed telerik, I  just refer to it's dll, so it's not on my computer
Rumen
Telerik team
 answered on 25 Apr 2011
1 answer
118 views
Hi,
How can I localize rad Editor dialog windows (Hyper-link Manager and Find & Replace)?
I want to change labels (Target, Text, URL, Find, Next ...) to Persian.
Rumen
Telerik team
 answered on 25 Apr 2011
17 answers
603 views
Hi,

i read about the new AccessibilityMode and wonder if there is a possibility to always render a RadComboBox as a standard Dropdown, even if there is javascript enabled on browser.. Can this be done now or is in planning for future releases?

Thanks
Achim
Orin Book
Top achievements
Rank 1
 answered on 25 Apr 2011
2 answers
87 views
I have an XmlHttpPanel that is within an AjaxPanel.  The problem I'm having is the first time there is a postback, it does a full page refresh instead of a partial page refresh; it's as if the AjaxPanel isn't having an effect.  But on subsequent postbacks it does the partial page refresh the way I want it to.

Here's a more detailed description:

I have a user control, named RecordSelect.ascx, that contains an XmlHttpPanel.  It calls a web service that returns HTML.  It calls __doPostBack to post back to the web server.  Here is the markup of my user control:
 
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RecordSelect.ascx.cs" Inherits="RecordSelect" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
  
  
<script type="text/javascript">
    var call = 0;
    function SetValue<%=XmlHttpPanel1.ClientID %>(count) {
        var panel = $find("<%=XmlHttpPanel1.ClientID %>");
        //you can pass any kind of object to the GetHTML method
        //right now we will pass an array
        var array = [];
        if (document.getElementById('<%=txtSearchString.ClientID %>').value.length > 1 && count == call) {
            array[0] = document.getElementById('<%=txtSearchString.ClientID %>').value;
            array[1] = "<%=XmlHttpPanel1.ClientID %>";
            array[2] = document.getElementById('<%= hidANE.ClientID %>').value;
            call = 0;
            //you can pass any kind of object to the GetHTML method
            //right now we will pass an array
            panel.set_value(array);
        }
    }
  
    function GetData<%=XmlHttpPanel1.ClientID %>() {
        call++;
        setTimeout('SetValue<%=XmlHttpPanel1.ClientID %>(' + call + ')', 200);
    }
  
    function RecordClicked<%=XmlHttpPanel1.ClientID %>(Name, ID) {
        document.getElementById('<%= hidId.ClientID %>').value = ID;
        document.getElementById('<%= txtSearchString.ClientID %>').value = Name;
        var panel = $find("<%=XmlHttpPanel1.ClientID %>");
  
        // this will clear the xmlhttp panel.
        //document.getElementById('divTypeAheadOptions').parentNode.innerHTML = '';
        $find('<%= txtSearchString.ClientID %>').updateDisplayValue();
        __doPostBack('<%= cmdHid.ClientID %>','');
    }
  
    function AddNewClicked<%=XmlHttpPanel1.ClientID %>() {
        document.getElementById('<%= hidId.ClientID %>').value = -1;
        __doPostBack('<%= cmdHid.ClientID %>','');
    }
  
</script>    
  
<telerik:RadTextBox 
    ID="txtSearchString" 
    runat="server" 
    EmptyMessage="" 
    Width="300px" >
</telerik:RadTextBox>
<telerik:RadXmlHttpPanel runat="server" ID="XmlHttpPanel1" 
        WebMethodPath="~/services/TypeAhead.asmx"
        WebMethodName=""
        RenderMode="Block"
        EnableClientScriptEvaluation="true">
</telerik:RadXmlHttpPanel>
<asp:HiddenField runat="server" ID="hidId"/>
<asp:HiddenField runat="server" ID="hidANE" />
<asp:Button runat="server" ID="cmdHid" CausesValidation="false" style="display: none;"/>

And here's the parent, where the RecordSelect.ascx control is declared inside a RadAjaxPanel

<telerik:RadAjaxPanel ID="radAjaxPanel1" runat="server">
          <uc1:RecordSelect runat="server" ID="selCompany" Type="Companies" EnabledAddNew="True" />
           ...

FYI -

This control is a typeahead/autocomplete type search.

The <%=XmlHttpPanel1.ClientID %> string is appended to the javascript function names so the user control can be declared multiple times on one page.  (I'm not sure if that's the proper way to do that...but it's working.)

The purpose of the cmdHid button is to prevent the __doPostBack commands from causing client-side validation, and also to associate the postbacks with the surrounding AjaxPanel, which is working for the 2nd, 3rd, 4th, etc. postbacks.  Just not the first postback.

Any help would be much appreciated.



Mike
Top achievements
Rank 1
 answered on 25 Apr 2011
2 answers
184 views
I'm getting this error: DataSourceCount is not ready at this moment
when my RadGrid initially has more than the PageSize number of records.  My PageSize="20" so I get that runtime error if the initial databind is with more than 20 rows.

Here is the declaration of the grid:

<oscarcontrols:OscarGrid runat="server" ID="grdProcessOrders" AutoGenerateColumns="false"
                            Visible="true" PageSize="20" AllowPaging="true" ShowHeader="true" Width="100%"
                            AllowSorting="true" EnableEmbeddedSkins="false" DataKeyNames="OrdID" OnPageIndexChanged="grdProcessOrders_PageIndexChanged"
                            OnPageSizeChanged="grdProcessOrders_PageSizeChanged" OnItemCommand="grdProcessOrders_ItemCommand"
                            OnSelectedIndexChanged="grdProcessOrders_SelectedIndexChanged" OnItemDataBound="grdProcessOrders_ItemDataBound"
                            OnDataBound="grdProcessOrders_DataBound" Skin="OSCARGridStyle1" OnSortCommand="grdProcessOrders_SortCommand"
                            OnItemCreated="grdProcessOrders_ItemCreated">
                            <ClientSettings EnableRowHoverStyle="true" EnableAlternatingItems="false" EnablePostBackOnRowClick="true">
                                <%--<ClientEvents OnGridCreated="ProcOrdGridCreate" /> --%>
                                <Selecting AllowRowSelect="True" />
                                <%-- <ClientEvents OnRowContextMenu="RowContextMenu" /> --%>
                            </ClientSettings>
                            <PagerStyle Position="TopAndBottom" Mode="NumericPages" Width="100%" AlwaysVisible="false" />
                            <MasterTableView OnPreRender="grdProcessOrders_PreRender" DataKeyNames="OrdID">
                                <NoRecordsTemplate>
                                    <oscarcontrols:OscarPanel runat="server" ID="pnlNoRecords" Width="100%" CssClass="procOrdersNoRecordsFound">
                                        <h2>
                                            <oscarcontrols:OscarLabel runat="server" ID="lblSorry" Text="Sorry. Try Again." /></h2>
                                        <oscarcontrols:OscarLabel runat="server" ID="lblNoRecords" Text="There were no records found that matched your search criteria." /><br />
                                        <br />
                                    </oscarcontrols:OscarPanel>
                                </NoRecordsTemplate>
                                <PagerTemplate>
                                    <table width="100%">
                                        <tr>
                                              
                                            <td style="padding-left: 5px">
                                            <oscarcontrols:OscarLabel runat="server" ID="lblResultsFoundValue" Text='<%# DataBinder.Eval(Container, "Paging.DataSourceCount")%>'
                                                    Font-Bold="true" /> 
                                                <b>
                                                    <oscarcontrols:OscarLabel runat="server" ID="lblResultsFound" Text="Results Found."
                                                        Font-Bold="true" /></b>
                                            </td>
                                            <td align="right" style="padding-right: 5px">
                                                <table>
                                                    <tr>
                                                        <td>
                                                            <oscarcontrols:OscarLabel runat="server" ID="lblResultPerPage" Text="Results per Page:" />
                                                            <oscarcontrols:OscarComboBox ID="ProcOrdRadComboBox1" DataSource="<%# new object[]{10, 20, 30, 40, 50} %>"
                                                                SelectedValue='<%# DataBinder.Eval(Container, "Paging.PageSize") %>' Style="margin-right: 20px;"
                                                                Width="40px" runat="server" OnClientSelectedIndexChanged="ProcOrdRadComboBox1_SelectedIndexChanged">
                                                            </oscarcontrols:OscarComboBox>
                                                        </td>
                                                        <td>
                                                            <oscarcontrols:OscarImageButton ID="Button1" runat="server" ImageUrl="~/Images/PagingFirst.gif"
                                                                OnClientClick="ProcOrdchangePage('first'); return false;" CommandName="Page"
                                                                CommandArgument="First" />
                                                            <oscarcontrols:OscarImageButton ID="Button2" runat="server" ImageUrl="~/Images/PagingPrev.gif"
                                                                OnClientClick="ProcOrdchangePage('prev'); return false;" CommandName="Page" CommandArgument="Prev" />
                                                        </td>
                                                        <td>
                                                            <oscarcontrols:OscarPanel runat="server" ID="NumericPagerPlaceHolder" />
                                                        </td>
                                                        <td>
                                                            <oscarcontrols:OscarImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/PagingNext.gif"
                                                                OnClientClick="ProcOrdchangePage('next'); return false;" CommandName="Page" CommandArgument="Next" />
                                                            <oscarcontrols:OscarImageButton ID="ImageButton2" runat="server" ImageUrl="~/Images/PagingLast.gif"
                                                                OnClientClick="ProcOrdchangePage('last'); return false;" CommandName="Page" CommandArgument="Last" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </PagerTemplate>

And here's the code that does the binding:
 

 

grdProcessOrders.DataSource = GetSortedOrders(false); 
grdProcessOrders.DataBind(); 

 

 

 


This code is called within the Page_Load event of my aspx page.


Mike
Top achievements
Rank 1
 answered on 25 Apr 2011
1 answer
80 views
How would I make Editor,- Hyperlink Manager that makes Links opening in a RadWindow. And what is link manager search pane or media pane. Could you add a pane called search or media as a target. Tried custom target of openRadWin or different variations.

Rumen
Telerik team
 answered on 25 Apr 2011
2 answers
107 views
In the following code, grdInProcesDetails is a child grid of  "grdInProces" parent grid, After doing the pagination of "grdInProces" grid,
in grdInProcesDetails_ItemCreated - parentItem.ChildItem is getting null, by which i am unable to find the childItem controls to add some attributes .... How do i find the child item controls  here in this case.
  protected void grdInProcesDetails_ItemCreated(object sender, GridItemEventArgs e)
        {
             if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
                GridDataItem parentItem = ((sender as RadGrid).NamingContainer as GridNestedViewItem).ParentItem as GridDataItem;
                  if (parentItem != null && parentItem.ChildItem !=null)
                {
                    string _employeeId = parentItem.GetDataKeyValue("Employee").ToString();
                    Label lblIPName = parentItem.FindControl("lblIPName") as Label;
                    Label lblReview = parentItem.ChildItem.FindControl("lblReview") as Label;
                    CheckBox chkIPReviewed = parentItem.ChildItem.FindControl("chkInProcessReviewed") as CheckBox;
               }
          }
     }
Parent grid is getting rebind as well as child grid also getting rebinding when done pagination but syill iam getting null value.

Please give a advise as soon as possible
MadhuSudhan
Top achievements
Rank 1
 answered on 25 Apr 2011
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?