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

I have a page with 3 RadGrids. Each row contains information about an order and has a LinkButton.
Once you click on the LinkButton, some code behind gives parameters and opens a RadWindow from the RadWindowManager.

It might not be the perfect way to do it but I did need to access certain values with code behind.

The problem is that when I scroll down on the list, the RadWindow opens at the top of the page (at the initial scroll position) and since I am using RadAjaxManager, the page does not postback (which is what I want). 

So if I scroll too far, I can't see the RadWindow displayed. I need to have the RadWindow opened in the middle of the current position of the screen.

Thanks !
Mark
Top achievements
Rank 1
 answered on 19 Dec 2014
3 answers
65 views
Hi Team,

I have a Radial gauge in my page whenever I set the value of the pointer, it jumps to the value but what I want is pointer move smoothly to the value.
Does anyone know how to achieve this?

Thanks
Danail Vasilev
Telerik team
 answered on 19 Dec 2014
2 answers
472 views
I would like to set my FilterControlWidth on all columns so that it equals [Column Width] - [Filter Icon Width.  The goal is to fill up the whole space above the column using the textbox and the filter icon.

Presently I am using FilterControlWidth="80%", but it's inconsistent spacing left over.

All filters are textboxes except for one which is a radCombBox
Rick
Top achievements
Rank 1
 answered on 19 Dec 2014
1 answer
161 views
Is it possible to auto-generate columns in a DataForm? In my application, I don't know which fields to bind until runtime. I not only need to be able to auto-generate fields but also loop through these fields and specify which of the fields is editable. I'd hate to resort to a DetailsView control to do this.
Konstantin Dikov
Telerik team
 answered on 19 Dec 2014
3 answers
489 views
I am trying to run this tooltip on hover of a grid cell.  The data for the tooltip is in a user control (ascx).  I am banging my head because I keep getting a client side error Sys.WebForms.PageRequestManagerParserErrorException
<%@ Page Title="" Language="C#"  MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="KioskList.aspx.cs" Inherits="PAMRewrite.KioskList" %>
<%@ Register Src="PAMStats.ascx" TagName="PAMStats" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="pagecontent" class="well">   
        <uc1:PAMStats ID="PAMStats1" runat="server" Visible="false" />   
        <h3 runat="server" id="h1">Kiosk List</h3>      
        <asp:UpdatePanel runat="server" ID="updaPnlKioskList" UpdateMode="Conditional" Visible="true">
            <ContentTemplate>   
                <telerik:RadCodeBlock runat="server" ID="rdbScripts">
                    <script type="text/javascript">
                        function openRadWin(URL) {
                            var width = 1000;
                            var height = 800;
                            var left = 600;
                            var top = 100;
                            var wnd = radopen(URL, null, width, height, left, top);
                            wnd.add_close(OnClientClose);
                        }
 
                        function OnClientClose(sender, args) {
                            window.location.reload(true);
                        }          
                    </script>
                </telerik:RadCodeBlock>
                <telerik:RadAjaxPanel runat="server">                   
                    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true"
                        Top="100" Left="600" Height="800" Width="1000" >                       
                          <Windows>                              
                               <telerik:RadWindow ID="RadWindow1" runat="server" ShowContentDuringLoad="false" Style="z-index: 8000" Title="CAO" Behaviors="Default" >
                               </telerik:RadWindow>
                          </Windows>
                     </telerik:RadWindowManager>
                </telerik:RadAjaxPanel>
                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                      <AjaxSettings>
                           <telerik:AjaxSetting AjaxControlID="RadWindowManager1">
                           </telerik:AjaxSetting>
                           <telerik:AjaxSetting AjaxControlID="gvKiosk">
                                <UpdatedControls>                                   
                                    <telerik:AjaxUpdatedControl ControlID="gvKiosk" LoadingPanelID="RadAjaxLoadingPanel1">
                                    </telerik:AjaxUpdatedControl>
                                    <telerik:AjaxUpdatedControl ControlID="RadToolTipManager1"></telerik:AjaxUpdatedControl>
                                </UpdatedControls>
                           </telerik:AjaxSetting>
                      </AjaxSettings>
                </telerik:RadAjaxManager
                <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
                </telerik:RadAjaxLoadingPanel>
                <telerik:RadToolTipManager ID="RadToolTipManager1" OffsetY="-1" HideEvent="Default" AutoCloseDelay="7000"
                      Width="325" Height="275" runat="server" OnAjaxUpdate="OnAjaxUpdate" RelativeTo="Element"
                      Position="MiddleRight">
                </telerik:RadToolTipManager>                            
                <p>This list contains Pre-Accounts that were created using the CAO Kiosk.  The Signup Step shows the current status of the Pre-Account</p>                          
                <asp:UpdatePanel runat="server" ID="upReadyToAssignSearch" UpdateMode="Conditional">
                    <ContentTemplate>
                        <telerik:RadGrid ID="gvKiosk" runat="server"
                            AutoGenerateColumns="False"
                            AllowPaging="True"
                            AllowSorting="True"
                            GridLines="None"
                            CellSpacing="0"
                            OnItemDataBound="gvKiosk_ItemDataBound"                   
                            OnItemCommand="gvKiosk_ItemCommand">                                                           
                            <SortingSettings EnableSkinSortStyles="false"></SortingSettings>
                            <GroupingSettings CaseSensitive="false" />
                            <MasterTableView DataKeyNames="Profile_ID" NoMasterRecordsText="There are no Kiosk records.">                    
                            <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="True"></PagerStyle>                                                           
                                <Columns>
                                    <telerik:GridBoundColumn DataField="PROFILE_ID" Display="false"
                                        FilterControlAltText="Filter profileid column" HeaderText="Profile ID"
                                        UniqueName="customername">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="CUSTOMERNAME"
                                        FilterControlAltText="Filter customername column" HeaderText="Customer Name"
                                        UniqueName="customername">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="EMAIL_ADDRESS"
                                        FilterControlAltText="Filter customername column" HeaderText="Email Address"
                                        UniqueName="emailaddress">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="DRIVERS_LICENSE_NO"
                                        FilterControlAltText="Filter customername column" HeaderText="DL#"
                                        UniqueName="driverslicenseno">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="BILLING_ZIP"
                                        FilterControlAltText="Filter zipcode column" HeaderText="Zip Code"
                                        UniqueName="zipcode">
                                    </telerik:GridBoundColumn
                                    <telerik:GridTemplateColumn HeaderText="Details" SortExpression="Details">
                                         <ItemTemplate>
                                              <asp:HyperLink ID="targetControl" runat="server" NavigateUrl="#" Text="Details"></asp:HyperLink>
                                         </ItemTemplate>
                                    </telerik:GridTemplateColumn>                                                              
                                    <telerik:GridTemplateColumn AllowFiltering="false"
                                        HeaderText="Details" UniqueName="DetailsColumn">
                                        <ItemTemplate>
                                            <asp:LinkButton runat="server" ID="lnkGotoAccount" Text="Go To Account"
                                                CommandName="GoToAccount"></asp:LinkButton>
                                              |  
                                            <asp:LinkButton runat="server" ID="lnkCheckIn" Text="Check In"
                                                 CommandName="CheckIn" Visible="false"></asp:LinkButton>
                                            <asp:Label ID="lblProfileID" runat="server" Visible="false" Text='<%#Eval("PROFILE_ID") %>' />
                                            <asp:Label ID="lblBillingZip" runat="server" Visible="false" Text='<%#Eval("BILLING_ZIP") %>' />
                                            <asp:Label ID="lblSignupStep" runat="server" Visible="false" Text='<%#Eval("ACCOUNT_STATUS_DESC") %>' />
                                            <asp:Label ID="lblPreAccountNo" runat="server" Visible="false" Text='<%#Eval("PRE_ACCOUNT_NO") %>' />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>                           
                                    <telerik:GridBoundColumn DataField="UserName"
                                        FilterControlAltText="Filter customername column" HeaderText="Checked Out By"
                                        UniqueName="UserName">
                                    </telerik:GridBoundColumn>        
                                </Columns>
                            </MasterTableView>
                            <EditItemStyle BorderWidth="5px" />
                        </telerik:RadGrid>                                     
                    </ContentTemplate>
                </asp:UpdatePanel>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>

using System;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PAMRewrite.PAMBiz;
using Telerik.Web.UI;
 
namespace PAMRewrite
{
    public partial class KioskList : BasePage
    {
        protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args)
        {
            this.UpdateToolTip(args.Value, args.UpdatePanel);
        }
        private void UpdateToolTip(string elementID, UpdatePanel panel)
        {
            Control ctrl = Page.LoadControl("HoverDetail.ascx");
            ctrl.ID = "ucCustomerDetails1";
            panel.ContentTemplateContainer.Controls.Add(ctrl);
            HoverDetail details = (HoverDetail)ctrl;
            details.profileID = Convert.ToInt32(elementID);
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {           
            string CheckAuth = (string)Session["Authenticated"];
 
            if ((CheckAuth == null) || (CheckAuth == "FALSE"))
            {
                Response.Redirect("Default.aspx", true);
                HttpContext.Current.ApplicationInstance.CompleteRequest();
            }
            else
            {
                //  Make sure that UserType is authenticated
                if ((Convert.ToInt32(Session["UserType"]) == Convert.ToInt32(cEnums.eUserType.EXTADMIN)) ||
                        (Convert.ToInt32(Session["UserType"]) == Convert.ToInt32(cEnums.eUserType.EXTUSER)))
                {
                    Response.Redirect("MainMenu.aspx", false);
                    HttpContext.Current.ApplicationInstance.CompleteRequest();
                }
 
                Session["Error"] = "FALSE";
 
                if (!IsPostBack)
                {
                    FillKioskListGrid();
                    Response.Cache.SetCacheability(HttpCacheability.NoCache);
                    Response.Cache.SetAllowResponseInBrowserHistory(false);
                }
                else
                {
                    //GridView does not keep its items' IDs after postback, so rebind it or else tooltip manager will not show tooltips
                    FillKioskListGrid();
                }
 
                // For Stats
                if (Session["UserType"] != null)
                {
                    if ((Int32)Session["UserType"] == Convert.ToInt32(cEnums.eUserType.SUPERADMIN) || (Int32)Session["UserType"] == Convert.ToInt32(cEnums.eUserType.INTADMIN))
                    {
                        PAMStats1.Visible = true;
                        RadPanelBar pnlBarStats = (RadPanelBar)PAMStats1.FindControl("pnlBarStats");
                        RadTabStrip tsStats = (RadTabStrip)pnlBarStats.FindItemByValue("Statistics").FindControl("RadTabstrip1");
                        RadTab tab1 = tsStats.Tabs.FindTabByText("CAO Statistics");
                        tab1.Selected = true;
                    }
                }
            }
        }
 
        //<!-- Begin Table Location Info -->
        private void FillKioskListGrid()
        {
            KioskInformation kioskInfo = new KioskInformation();
            Int32 locationCodeID = Convert.ToInt32(Session["LocationCodeID"]);
            using (DataSet dsKiosks = kioskInfo.GetExistingKioskList(locationCodeID))
            {
                dsKiosks.Tables[0].DefaultView.Sort = "CUSTOMERNAME ASC";
                gvKiosk.DataSource = dsKiosks.Tables[0].DefaultView;
                gvKiosk.DataBind();
            }
        }
 
        protected void gvKiosk_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem) //to access a row
            {
                string loginUser = Session["User"].ToString();
                LinkButton lnkCheckIn = (LinkButton)e.Item.FindControl("lnkCheckIn");
                DataRowView row = (DataRowView)e.Item.DataItem;                               
                string profileID = row["PROFILE_ID"].ToString();
                if (!string.IsNullOrEmpty(row["USERNAME"].ToString()))
                {
                    LinkButton lnkGotoAccount = (LinkButton)e.Item.FindControl("lnkGotoAccount");
 
                    if (loginUser.ToUpper() == (row["USERNAME"].ToString().ToUpper()))
                    {
                        lnkCheckIn.Visible = true;
                    }
                    else
                    {
                        lnkGotoAccount.Visible = false;
                    }
 
                    //If Current User Type is Super Admin then Check in Button is Visiable.
                    if (Convert.ToInt32(Session["UserType"]) == Convert.ToInt32(cEnums.eUserType.SUPERADMIN) || Convert.ToInt32(Session["UserType"]) == Convert.ToInt32(cEnums.eUserType.INTADMIN))
                    {
                        lnkCheckIn.Visible = true;
                    }
                }
 
                if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
                {
                    Control target = e.Item.FindControl("targetControl");
                    if (!Object.Equals(target, null))
                    {
                        if (!Object.Equals(this.RadToolTipManager1, null))
                        {
                            //Add the button (target) id to the tooltip manager
                            this.RadToolTipManager1.TargetControls.Add(target.ClientID, (e.Item as GridDataItem).GetDataKeyValue("Profile_ID").ToString(), true);
 
                        }
                    }
                }
            }
        }
 
        //<!-- End Table Location Info -->  
 
        protected void gvKiosk_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == "GoToAccount")
            {
                GridDataItem item = e.Item as GridDataItem;
 
                string domainURL = Common.GetConfigurationSetting("PAMDomainUrl");
                string caoUrl = domainURL.ToString() + Common.GetConfigurationSetting("CAOLoginURL");
                string emailAddress = item["emailaddress"].Text;               
                string dlNumber = item["driverslicenseno"].Text;               
                Label lblBillingZip = (Label)item.FindControl("lblBillingZip");
                string billingZip = lblBillingZip.Text.ToString();
                string url = caoUrl + "?email=" + emailAddress + "&dl=" + dlNumber + "&ac=" + billingZip;
 
                string scriptstring = "openRadWin('" + url + "');";
 
                // In order for this functionality to work you have to follow these steps.  Click on the "Go To Account" link.
                // You will see a window open and it should populate the username and other information automatically and log you
                // into CAO.  When you are finished working in CAO you MUST log out of CAO.
 
                ScriptManager.RegisterStartupScript(Page, Page.GetType(), "radScript", scriptstring, true);
 
 
                Label lblProfileID = (Label)item.FindControl("lblProfileID");
                Int32 profileID = Convert.ToInt32(lblProfileID.Text.ToString());
                Int32 userID = Convert.ToInt32(Session["UserID"].ToString());
 
                try
                {
                    KioskInformation kioskInfo = new KioskInformation();
                    kioskInfo.UpdateCheckOutStatus(profileID, userID);
 
                    Label lblSignup = (Label)item.FindControl("lblSignupStep");
                    string status = lblSignup.Text;
 
                    if (status == "PAYMENT APPLIED TO ACCOUNT")
                    {
                        Label lblPreAcctNo = (Label)item.FindControl("lblPreAccountNo");
                        Session["From"] = "Kiosk";          //HARD_CODED - we are coming from Kiosk
                        Session["PreAccountNo"] = lblPreAcctNo.Text;
                        Session["ProfileID"] = profileID;
                        Response.Redirect("CAOAssignTags.aspx", false);
                        HttpContext.Current.ApplicationInstance.CompleteRequest();
                    }
                    FillKioskListGrid();
                   HttpResponse.RemoveOutputCacheItem("/KioskList.aspx");
                }
                catch (Exception ex)
                {
                    //If ReturnCode Return -990 means Needs to Refresh screen some one check out
                    if (!(ex.Message.Contains("-990") || ex.Message.Contains("-991")))
                    {
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ss", "<script>alert('The tag request is currently checked out to another user.');</script>", false);
                    }
                    else
                    {
                        ErrorLogging logging = new ErrorLogging();
                        logging.callingPage = Request.Url.ToString();
                        logging.callingMethod = System.Reflection.MethodBase.GetCurrentMethod().Name;
                        ErrorLogging.LogError(ex, logging);
                    }
                }
            }
            else if (e.CommandName == "CheckIn")
            {
                GridDataItem item = e.Item as GridDataItem;
 
                Label lblProfileID = (Label)item.FindControl("lblProfileID");
                Int32 profileID = Convert.ToInt32(lblProfileID.Text.ToString());
                CAOInformation.UpdateCheckInStatus(profileID);
                FillKioskListGrid();
            }
            else if (e.CommandName == "Sort" || e.CommandName == "Page")
            {
                RadToolTipManager1.TargetControls.Clear();
            }
        }
    }
}
Please help me!

Thanks,
Steve
Marin Bratanov
Telerik team
 answered on 19 Dec 2014
4 answers
280 views

Having setup my Autocompletebox properly and returning values, I now need to take the DataValueField and update the database when they click the update button.  However in my code-behind I am unable to reference the selectedvalue. 

<telerik:RadAutoCompleteBox ID="radEmailUser" runat="server"
    DataSourceID="SqlDataSource1"  DataTextField="Contact_Email"
    DataValueField="EmailListID" Filter="StartsWith" InputType="Text"
    Width="300px" DropDownWidth="300px" TextSettings-SelectionMode="Single">
    <DropDownItemTemplate>
    <table><tr><td>
        <%# DataBinder.Eval(Container.DataItem, "contact_Email")%> (
        <%# DataBinder.Eval(Container.DataItem, "first_name")%>  
        <%# DataBinder.Eval(Container.DataItem, "last_name")%>)
        </td></tr></table>
    </DropDownItemTemplate>
</telerik:RadAutoCompleteBox>

I would like to get the value (EmailListID) that is selected and pass that onto a stored procedure for updating.  Unable to properly reference the value.  How can I get the value?

Kurt Kluth
Top achievements
Rank 1
 answered on 19 Dec 2014
5 answers
164 views
Hello. I'm having an issue with the tooltip staying with its target control. There is some JS code that displays some hidden table cells that are above the target control for the tooltip & when this happens, the tooltip doesn't move with the target control. Below is the markup for the tooltip. Any help would be greatly appreciated.

<asp:TableRow>
    <asp:TableCell HorizontalAlign="right" Text="Product"></asp:TableCell>
    <asp:TableCell>
        <table>
            <tr>
                <td>
                    <asp:Label ID="Product" runat="server" CssClass="FieldValue"></asp:Label
                </td>
                <td>
                    <span id="ProductMaintenanceSpan" runat="server" style="display:none; vertical-align:middle ">
                        <telerik:RadToolTip OnClientBeforeHide="OnClientBeforeHide"  ID="ProductToolTip" HideEvent="FromCode" Position="MiddleRight" style="z-index: -1;" TargetControlID ="ProductImage" runat="server" Text="Cancelled maintenance. Requires a PO for hourly work." RelativeTo="Element"></telerik:RadToolTip>
                        <asp:Image ID="ProductImage" ImageUrl="~/images/Info.gif" runat="server" style="cursor:pointer; vertical-align:middle" ImageAlign="TextTop"/>
                    </span>
                </td>
            </tr>
        </table>                                    
    </asp:TableCell>
</asp:TableRow>
Marin Bratanov
Telerik team
 answered on 19 Dec 2014
1 answer
115 views
I have a client that uses the radeditor with the hyperlink manager. Is there a way to have the url field not have http:// as the default text?   The thing is that the users do not highlight the the prefix to override it when pasting a url. Instead they add to it and it becomes http://http://<someurl>.
Ianko
Telerik team
 answered on 19 Dec 2014
4 answers
131 views
Hi,

I am using RadClientDatasource for Radgrid. i am created WCF page for retrieving data. but while adding WCF page name into Base URL getting request failed message. please check the attachment. please let me know do we need to configure anything. please help me ASAP
Dhamodharan
Top achievements
Rank 1
 answered on 19 Dec 2014
3 answers
104 views
Currently I am allowing the users to save a template which stores the data/state of the search parameters. I have a few queries that have around 50 parameters. I have made custom code to save the text out of a textbox, check state in checkboxes, selected radiobuttons, check boxes in a telerik dropdown, date in telerik datebox, checkboxes in telerik treeviews and save the text in a database per user per query page. I have almost ever telerik control and generic .net controls.

When the user names the template and save button it also saves the state of the radgrid. he users can then select a template and click the load button and the code prepopulates all the search parameter fields and sets the grid up as is was saved.

I have played with the persistence framework and have not figured out if it is possible to save generic .net controls. I cannot find any sample code if it is possible. I have seen other component libraries do this.

Am I just missing something...
Kevin
Viktor Tachev
Telerik team
 answered on 19 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
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
Iron
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?