Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
250 views
hello, 
is it possible to hide an empty row or column ?
Eyup
Telerik team
 answered on 13 Aug 2014
6 answers
164 views
Hi

We use visual studio 2008 with Telerik 2012 Q2. We are facing few minor issues with Masked Text Box. This happens only in IE. 

Masked Text Box


when we enter first letter in the masked text box. text box is hidden.



when we enter second letter in the masked text box. is shows again.



How to fix this issue? 








Manivannan
Top achievements
Rank 1
 answered on 13 Aug 2014
5 answers
598 views
I want to extend the length of this control to the entire length of the table that it's contained in.
How is the best done, javascript when it builds the calender event(s) or just using CSS.
I couldn't find any examples my code is below..

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <link href="styles/jjma_local.css" type="text/css" rel="stylesheet" />
    <title>Task Calendar View</title>
    <script type="text/javascript" >
        function showEvent(sender, eventArgs)
        {
            var id=eventArgs.get_appointment().get_id();
            var ids=id.split("%");
            if(ids.length===2)
                window.open("MainForm.aspx?type=taskDetails&LookID="+ids[0] + "&hullID=" + ids[1], "_blank");
            else
                alert("An unknown error has occurred.  The calendar will be unable to forward you to the task you have selected.");
        }
    </script>
</head>
<body class="FramedFormBodyStyle" style="margin: inherit 5px 3px inherit;">
    <form id="TaskCalendarView" runat="server">
    <asp:ScriptManager ID="scptMgr" runat="server">
    </asp:ScriptManager>
        <div>
            <telerik:RadScheduler ID="rschdTasks" runat="server" AllowDelete="False"  
                SelectedView="MonthView" ShowViewTabs="false"  OnAppointmentDataBound="rschdTasks_OnAppointmentDataBound"
                AllowEdit="False" AllowInsert="False" MonthVisibleAppointmentsPerDay="10"  ShowFooter="false"
                NumberOfHoveredRows="20" ReadOnly="True" Skin="Telerik" Height="400px" onclientappointmentclick="showEvent" 
                EnableAdvancedForm="False"  >
                <MonthView AdaptiveRowHeight="True" ReadOnly="True" VisibleAppointmentsPerDay="20" MinimumRowHeight="2" />
                <Localization AdvancedAllDayEvent="All day"></Localization>
                <AdvancedForm DateFormat="M/d/yyyy" TimeFormat="h:mm tt" Enabled="False"></AdvancedForm>
            </telerik:RadScheduler>
        </div>
    </form>
</body>
</html>


Boyan Dimitrov
Telerik team
 answered on 13 Aug 2014
1 answer
294 views
Hi, I am using RadWindowManager to raise a popup message to show some text. You can observe the attached image, I have small length message. but Popup is very big & spacious. Popup box should be comfort fit to the text in the box. CAn you please tell me, how to remove the spaces in the box & it has fit the size as per to the length of the message. I mean AutoSize. I used AutoSize but not worked. below i have given the code how I used it.


aspx:
<telerik:RadWindowManager ID="WindowManager" runat="server" AutoSize="true" AutoSizeBehaviors="Default" />

C#:
WindowManager.RadAlert("Updates were successfull",
                                          null,
                                          null,
                                         "Success Message",
                                          null);

Output:
See the Attached Image

Please let me know, how to use autosize ?

Thanks in advance.








Marin Bratanov
Telerik team
 answered on 13 Aug 2014
2 answers
205 views
Hi Guys,

I'm having a bit of a problem with my javascript not occurring after the radgrid has one item in edit mode. I'm using editforms with a custom user control to display the data needed. I've got the exact same code on several other pages and there it works 100% fine. 

My radgrid displays all the items and whenever i want to edit a item I right click and it will display the Context Menu with options to either edit, remove or enable based on the status of a item.

ASPX:

<%@ Page Title="" Language="C#" MasterPageFile="~/SystemSettings.Master" AutoEventWireup="true" CodeBehind="mergefields.aspx.cs" Inherits="CT_Administer_Website.mergefields" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script>
        function RowContextMenu(sender, eventArgs) {
            var menu = $find("<%=cmuMergeFieldsMenu.ClientID %>");
            var evt = eventArgs.get_domEvent();

            if (evt.target.tagName == "INPUT" || evt.target.tagName == "A") {
                return;
            }

            var index = eventArgs.get_itemIndexHierarchical();
            document.getElementById("<%= radGridClickedRowIndex.ClientID %>").value = index;

            sender.get_masterTableView().selectItem(sender.get_masterTableView().get_dataItems()[index].get_element(), true);

            menu.show(evt);

            evt.cancelBubble = true;
            evt.returnValue = false;

            if (evt.stopPropagation) {
                evt.stopPropagation();
                evt.preventDefault();
            }
        }



        function OnClientContextMenuShowing(sender, args) {
            var rowindex = document.getElementById("<%= radGridClickedRowIndex.ClientID %>").value;
            var DataItem = $find("<%= rgdMergeFields.ClientID %>").get_masterTableView().get_dataItems()[rowindex];
            var keyValues = DataItem.getDataKeyValue("_Active");

            document.getElementById("<%= radGridClickedRowValue.ClientID %>").value = DataItem.getDataKeyValue("_MergeFieldID");
            var nodeActiveState = keyValues;

            var menu = $find("<%= cmuMergeFieldsMenu.ClientID %>");

            if (nodeActiveState == "False") {
                menu.findItemByValue("Remove").hide();
                menu.findItemByValue("Enable").show();
            } else {
                menu.findItemByValue("Enable").hide();
                menu.findItemByValue("Remove").show();
            }
        }

        function OnClientItemClicked(sender, args) {
            var itemValue = args.get_item().get_value();
            var menu = $find("<%= cmuMergeFieldsMenu.ClientID %>");

            if (itemValue == "Remove") {
                if (confirm("Are you sure you want to remove the selected Merge Field?") == true) {

                }
                else {
                    menu.hide();
                    eventArgs.set_cancel(true);
                }
            }
            else if (itemValue == "Enable") {
                if (confirm("Are you sure you want to enable the selected Merge Field?") == true) {

                }
                else {
                    menu.hide();
                    eventArgs.set_cancel(true);
                }
            }
        }
    </script>
    <div style="position: absolute; top: 1px; left: 0px; width: 100%;">
        <telerik:RadGrid ID="rgdMergeFields" runat="server" ViewStateMode="Disabled" AutoGenerateColumns="False"
            ClientSettings-Resizing-AllowColumnResize="false" AllowPaging="True" AllowSorting="True"
            PageSize="25" ResolvedRenderMode="Classic" OnItemDataBound="rgdMergeFields_ItemDataBound"
            OnPageIndexChanged="rgdMergeFields_PageIndexChanged" OnItemCommand="rgdMergeFields_ItemCommand"
            OnNeedDataSource="rgdMergeFields_NeedDataSource" OnUpdateCommand="rgdMergeFields_UpdateCommand">
            <MasterTableView DataKeyNames="_MergeFieldID" ClientDataKeyNames="_Active, _MergeFieldID"
                AllowCustomPaging="false" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage">
                <CommandItemSettings AddNewRecordImageUrl="icon/plus.png" ShowRefreshButton="False" />
                <RowIndicatorColumn Visible="False">
                </RowIndicatorColumn>
                <ExpandCollapseColumn Created="True">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridTemplateColumn HeaderText="Status" UniqueName="_Status">
                        <HeaderStyle Width="8%" />
                        <ItemTemplate>
                            <asp:Image ID="imgStatus" runat="server" Height="16px" Width="16px" />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridBoundColumn DataField="_MergeFieldName" FilterControlAltText="Filter _MergeFieldName column"
                        HeaderText="Merge Field" SortExpression="_MergeFieldName" UniqueName="_MergeFieldName">
                        <HeaderStyle Width="60%" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="_LastUpdated" FilterControlAltText="Filter _LastUpdated column"
                        HeaderText="Last Updated" SortExpression="_LastUpdated" UniqueName="_LastUpdated">
                        <HeaderStyle Width="32%" />
                    </telerik:GridBoundColumn>
                </Columns>
                <EditFormSettings EditFormType="WebUserControl" FormStyle-BackColor="Black" UserControlName="editForms/MergeFieldsControl.ascx">
                </EditFormSettings>
            </MasterTableView>
            <ClientSettings>
                <ClientEvents OnRowContextMenu="RowContextMenu" />
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
            <PagerStyle Mode="NextPrev" PageButtonCount="5" />
        </telerik:RadGrid>
        <input type="hidden" id="radGridClickedRowIndex" name="radGridClickedRowIndex" runat="server" />
        <input type="hidden" id="radGridClickedRowValue" name="radGridClickedRowValue" runat="server" />
        <telerik:RadContextMenu ID="cmuMergeFieldsMenu" runat="server" EnableRoundedCorners="true"
            EnableShadows="true" OnClientShowing="OnClientContextMenuShowing" OnClientItemClicked="OnClientItemClicked"
            OnItemClick="cmuMergeFieldsMenu_ItemClick">
            <Items>
                <telerik:RadMenuItem Text="Edit" Value="Edit">
                </telerik:RadMenuItem>
                <telerik:RadMenuItem Text="Remove" Value="Remove">
                </telerik:RadMenuItem>
                <telerik:RadMenuItem Text="Enable" Value="Enable">
                </telerik:RadMenuItem>
            </Items>
        </telerik:RadContextMenu>
    </div>
    <telerik:RadNotification ID="rdnNotification" runat="server" Position="Center" Title="Please Note!"
        AutoCloseDelay="0" ResolvedRenderMode="Classic">
    </telerik:RadNotification>
</asp:Content>


Code Behind:

using System;
using System.Linq;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

namespace CT_Administer_Website
{
    public partial class mergefields : System.Web.UI.Page
    {
        Administer_WCFService.MergeFieldsClient wcf = new Administer_WCFService.MergeFieldsClient();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["LoginUser"] != null)
            {
                permissions.permissions p = (permissions.permissions)Session["Permissions"];
                rgdMergeFields.DataSource = wcf.DisplayMergeFields(p.ViewInactives);
                rgdMergeFields.DataBind();
            }
            else
            {
                Response.Redirect("login.aspx");
            }
        }

        protected void rgdMergeFields_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName.Equals(RadGrid.InitInsertCommandName))
            {
                e.Item.Edit = true;
                e.Item.OwnerTableView.Rebind();
            }
        }

        protected void rgdMergeFields_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            try
            {
                //Add an icon to the Grid items to show as a status
                if (e.Item is GridDataItem)
                {
                    Administer_WCFService.ct_MergeFields dataSourceRow = (Administer_WCFService.ct_MergeFields)e.Item.DataItem;
                    GridDataItem dataItem = (GridDataItem)e.Item;

                    Image newImage = dataItem.FindControl("imgStatus") as Image;
                    //tick.png for Enabled & cross.png for Disabled
                    newImage.ImageUrl = dataSourceRow._Active.Equals(true) ? "icon/tick.png" : "icon/cross.png";
                }
            }
            catch
            {
                rdnNotification.Title = Resources.MyGlobalResource.NotificationTitle_FatalError;
                rdnNotification.Show(Resources.MyGlobalResource.NotificationMessage_FatalError);
            }
        }

        protected void rgdMergeFields_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            permissions.permissions p = (permissions.permissions)Session["Permissions"];
            rgdMergeFields.DataSource = wcf.DisplayMergeFields(p.ViewInactives);
        }

        protected void rgdMergeFields_PageIndexChanged(object sender, Telerik.Web.UI.GridPageChangedEventArgs e)
        {
            try
            {
                rgdMergeFields.CurrentPageIndex = e.NewPageIndex;
            }
            catch
            {
                rdnNotification.Title = Resources.MyGlobalResource.NotificationTitle_FatalError;
                rdnNotification.Show(Resources.MyGlobalResource.NotificationMessage_FatalError);
            }
        }

        protected void rgdMergeFields_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            permissions.permissions p = (permissions.permissions)Session["Permissions"];
            rgdMergeFields.DataSource = wcf.DisplayMergeFields(p.ViewInactives);
            rgdMergeFields.DataBind();
        }

        protected void cmuMergeFieldsMenu_ItemClick(object sender, Telerik.Web.UI.RadMenuEventArgs e)
        {
            try
            {
                //Context Menu Items
                if (e.Item.Value.Equals("Edit"))
                {
                    rgdMergeFields.Items[Convert.ToInt32(radGridClickedRowIndex.Value)].Edit = true;
                    rgdMergeFields.Items[Convert.ToInt32(radGridClickedRowIndex.Value)].OwnerTableView.Rebind();
                }
                else if (e.Item.Value.Equals("Enable"))
                {
                    //Enable a Disabled Report Profile
                    wcf.ChangeMergeFieldStatus(Convert.ToInt32(radGridClickedRowValue.Value), true, Request.Cookies["LoginUser"].Values["UserName"], Convert.ToInt32(Request.Cookies["LoginUser"].Values["UserID"]));
                    permissions.permissions p = (permissions.permissions)Session["Permissions"];
                    rgdMergeFields.DataSource = wcf.DisplayMergeFields(p.ViewInactives);
                    rgdMergeFields.DataBind();
                }
                else if (e.Item.Value.Equals("Remove"))
                {
                    //Disable an Enabled Report Profile
                    int result = wcf.ChangeMergeFieldStatus(Convert.ToInt32(radGridClickedRowValue.Value), false, Request.Cookies["LoginUser"].Values["UserName"], Convert.ToInt32(Request.Cookies["LoginUser"].Values["UserID"]));
                    permissions.permissions p = (permissions.permissions)Session["Permissions"];
                    rgdMergeFields.DataSource = wcf.DisplayMergeFields(p.ViewInactives);
                    rgdMergeFields.DataBind();

                    if (result.Equals(2))
                    {
                        rdnNotification.Show("Disabled");
                    }
                    else
                    {
                        rdnNotification.Show("Removed");
                    }
                }
            }
            catch
            {
                rdnNotification.Title = Resources.MyGlobalResource.NotificationTitle_FatalError;
                rdnNotification.Show(Resources.MyGlobalResource.NotificationMessage_FatalError);
            }
        }
    }
}

Thanks in advance


Carlos
Top achievements
Rank 2
 answered on 13 Aug 2014
4 answers
222 views
Hello,

I have a page that populates a RadGrid on load.  The end user has the option to check a box within one or more grid rows.  Upon click of a button, I want to initiate concurrent Ajax requests (one for each row) and allow the page to update (each row) based on when these concurrent requests complete -- which should happen at different times, i.e., it will take varying times for the command to complete for each row.

I have increased the RequestQueueSize on my AjaxManager control to 1000 (I am reading that the real number is considerably lower, i.e, around 4).  That said, it still appears that each request is only made after the previous is complete.  Here is my javascript that makes the ajax request.  I basically iterate over the grid rows, find some relevant controls (a checkbox representing the user selection and an image to show a spinner icon) and then make the request.

        function doCommand(button, args) {
            var grid = $find('<%=myGrid.ClientID %>');
            var masterTable = grid.get_masterTableView();
            var items = masterTable.get_dataItems();

            for (var n = 0; n < items.length; n++) {
                var row = items[n];
                var chkBox = row.findElement("chkCheckStatus");
                var img = row.findElement("myImg");

                if (null != chkBox) {
                    if (chkBox.checked) {
                        var selectedID = row.getDataKeyValue("ID");
                        if (null != img) {
                            img.src = "i/loader.gif";
                        }
                        var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
                        ajaxManager.ajaxRequest("cmd/" + n + "/" + selectedID);
                    }
                }
                else {
                    window.status = "Didn't find the control!";
                }
            }
        }

I handle the ajax call in the RadAjaxManager1_AjaxRequest server side method.  All of this works.

Is there any way for me to fire off many of these requests (sequentially as I iterate the grid rows) and then see the results come in as the commands complete, e.g., row 5 might finish before row 1 because the server side processing for row 5 took longer than row 1?
Maria Ilieva
Telerik team
 answered on 13 Aug 2014
2 answers
433 views
Hi there!
we are using Telerik 2011. So I customized RadComboBox to provide ,,Select All"-feature. So when the ,,Select All"-item is selected a js function registered with OnClientItemChecked  will be called and iterates all other items and selects them. 

As a result the checkboxes of the items are being selected and the content of  input area  is a comma separeted list of texts of the items.

So my question how can I make the input area displaying only the word,,All" when the ,,Select All"-item is selected  and not a list of all items?


Thank you in advance
Yazid
Top achievements
Rank 1
 answered on 13 Aug 2014
3 answers
241 views
http://www.telerik.com/forums/water-mark-text

I have found and am a little confused by the way these examples work. This is the way my code is setup:

C# side

string reportResult = report.GetReport(**all parameters needed to make a dynamic html**);
RadEditorReportView.Content = reportResult;



.asp side

<
telerik:RadEditor ID="RadEditorReportView" Runat="server" Width="100%" EditModes="Preview" Height="100%"    ToolsWidth="0" Enabled="false">
            <Tools>
                <telerik:EditorToolGroup></telerik:EditorToolGroup>
            </Tools>
</telerik:RadEditor>

Now I am trying to add a Text Watermark as shown in this example: http://www.telerik.com/help/reporting/designing-reports-watermarks.html

So I am trying to do it 3 different ways and only 1 way needs to work listed in order by the way I prefer to do it most:

1. Code Behind. As you see I am just setting the Content to be an html string in my RadEditor. Do I need to create a System.Drawing.Image object?
2. asp side. Running asp code but it seems that it needs to create some sort of document object that I'm not doing here.
3. Designing Reports Watermarks link seems to be creating a type of Report that is not the same as what I'm trying to do here.

But it doesn't seem the Reports talked about here are an actual printed report but some sort of computer report. What I'm trying to accomplish is to add a watermark to files that we print in pdf format. The PDF files are already created. I just need to add watermarks now. How do I exactly add watermarks here? In the previous link therei s an example doing it in the asp side using OnClientLoad but we don't create an actual document here. What is the document that needs to be created to make this work? Or to do it from the code behind, I need to somehow make the html string into this object: System.Drawing.Image ???
Marin Bratanov
Telerik team
 answered on 13 Aug 2014
8 answers
458 views
Hi,

I am trying to use Rad Notification for Session Timeout application.

Rad Notification control is on my master page as I want it for session timeout.
I see that every thing is working fine except for the postion of the notification.

It is always displaying at left bottom corner of my page and doesnt move from there.
And moreover the page is getting extended when notification comes and it doesnt even show up until we scroll the page downside.

Do you think any issue.

Code is same as the sample session timeout on telerik examples for radnotification.
Marin Bratanov
Telerik team
 answered on 13 Aug 2014
10 answers
442 views
I need to add many sources in a Rad Media Player (ASP .NET AJAX). Each source is a You Tube URL. Could you help me?

Shinu
Top achievements
Rank 2
 answered on 13 Aug 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?