Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
180 views
Here is my scenario:

 - The user is on an order page - enters a new order
 - Upon completion, a RadWindow is displayed confirming your order was entered
 - From this first RadWindow you can click on a button to apply payment
 - This opens a second RadWindow which asks for Payment Information
 - If you select to pay via Credit Card, this opens a third RadWindow to collect the CC details from an external site inside an iFrame

At this point all is good.

Now, when you are done processing the CC payment in the third RadWindow
, the processor's page fires a refresh target=_self, which ends up being the third RadWindow, appending a value to the query string to indicate that it has finished.  I then can read out some variables from Request.Params to see if the payment took, etc.

The Problem:

When I first open the RadWindow, I can call the GetRadWindow() function and I get the reference to the Third RadWindow.  BUT when the processor page (which is in an iFrame) refreshes the RadWindow --  GetRadWindow() goes null.  This is a problem, because now I cannot close the Window!  

Any ideas on how to persist or re-initiate the RadWindow object so that I can close my popup? 

John
Top achievements
Rank 1
 answered on 15 Mar 2013
4 answers
258 views
Hello,

I have a RadGrid, used for data entry that has a DatePicker column and a TimePicker column, each having the associated icon to click for the correct pop-up Picker.  There are several rows, so that the grid has to be scrolled vertically on occasion. When this is the case, the calendar and clock icons do not scroll correctly in IE6. See attached images of the grid scrolled up and scrolled down.

I am using the latest version of the ASP.NET AJAX controls: 2013.1.220.40

I have seen some older forum threads mention similar problems can be fixed by adding "position: relative" to the style of the container of the problem elements.  The icons are in RadGrid generated table cells with no class definition (second td in code below), so I'm not sure how to add the relative position style to that cell. I've tried setting position:relative for class rcCalPopup. I've tried setting position:relative for rcTable td. Neither worked. 

Could you please tell me how to fix the problem?
<table cellspacing="0" class="rcTable rcSingle" summary="Table holding date picker control for selection of dates." style="width:100%;">
                <caption style="display:none;">
                    RadDatePicker
                </caption><thead style="display:none;">
                    <tr>
                        <th scope="col"></th>
                    </tr>
                </thead><tbody>
                    <tr>
                        <td class="rcInputCell" style="width:100%;"><span id="ctl00_BC_G1_GD_ctl00_ctl06_RDIPDate_dateInput_wrapper" class="riSingle RadInput " style="display:block;width:100%;"><input id="ctl00_BC_G1_GD_ctl00_ctl06_RDIPDate_dateInput" name="ctl00$BC$G1$GD$ctl00$ctl06$RDIPDate$dateInput" class="riTextBox riEnabled" type="text" /><input id="ctl00_BC_G1_GD_ctl00_ctl06_RDIPDate_dateInput_ClientState" name="ctl00_BC_G1_GD_ctl00_ctl06_RDIPDate_dateInput_ClientState" type="hidden" /></span></td>
                        <td><a title="Open the calendar popup." href="#" id="ctl00_BC_G1_GD_ctl00_ctl06_RDIPDate_popupButton" class="rcCalPopup">Open the calendar popup.</a></td>
                    </tr>
                </tbody>
            </table>
Kya
Top achievements
Rank 1
 answered on 14 Mar 2013
4 answers
169 views
Hi all,

I have a RadGrid1_ItemCommand where at an e.CommandName == "PerformInsert" after inserting I use the e.Canceled = true to hide the insert template, but it nevers hide. What I'm doing wrong please. Here is the code. The update part does work and hides the <EditFormSettings EditFormType="Template">

protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == "PerformInsert" || e.CommandName == "Update")
            {
                //some code block
                    if (Session["idSess"] == null)
                    {
                        objBz.Insert(objEntity);
                        e.Canceled = false;
                    }
                    else
                    {
                        objBz.Update(objEntity);
                        RadGrid1.MasterTableView.ClearEditItems();
                    }
            }

Rawl
Top achievements
Rank 1
 answered on 14 Mar 2013
5 answers
432 views
I have a grid which has the CarrierID specified as the "DataKeyNames" which is also an invisible property in the grid.

I have a hyperlink column that when clicked should pass the value of the CarrierNetID (the keyvalue for that dataitem) into my codebehind so I can then pass it to another page to bring up a record for editng based on that key value.

I'm having trouble getting the attached error:

My markup is as follows: You can see that the lnkPLMN is the hyperlink. Everything is coming out on the grid just fine, I just can't seem to pass the value.
<telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1" ShowStatusBar="true"
        runat="server" AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True"
        AutoGenerateColumns="false" ClientSettings-Resizing-AllowColumnResize="true"
        DataKeyNames="CarrierNetID" OnItemDataBound="RadGrid_ItemDataBound">
        <MasterTableView PageSize="10" Width="100%">
            <Columns>
                <telerik:GridBoundColumn DataField="CarrierNetID" Visible="false" UniqueName="CarrierNetID" ItemStyle-HorizontalAlign="Left"
                    HeaderStyle-HorizontalAlign="Left">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Name" HeaderText="Carrier Name" UniqueName="Name"
                    SortExpression="Name" ReadOnly="true" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Region" HeaderText="Region" UniqueName="Region"
                    AllowFiltering="true" SortExpression="Region" ReadOnly="true" ItemStyle-HorizontalAlign="Left"
                    HeaderStyle-HorizontalAlign="Left">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Country" HeaderText="Country" UniqueName="Country"
                    SortExpression="Country" ReadOnly="true" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                </telerik:GridBoundColumn>
                <telerik:GridTemplateColumn HeaderText="PLMN" UniqueName="PLMN">
                    <ItemTemplate>
                        <asp:HyperLink ID="lnkPLMN" runat="server" Target="_blank" ForeColor="Blue">
                        </asp:HyperLink>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="TechnologyTypeCode" HeaderText="Technology" UniqueName="TechnologyTypeCode"
                    SortExpression="TechnologyTypeCode" ReadOnly="true" ItemStyle-HorizontalAlign="Left"
                    HeaderStyle-HorizontalAlign="Left">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="SMSMORate" HeaderText="SSMSO Rate" UniqueName="SMSMORate"
                    AllowFiltering="false" SortExpression="SMSMORate" ReadOnly="true" ItemStyle-HorizontalAlign="Right"
                    HeaderStyle-HorizontalAlign="Right" DataFormatString="{0:G}">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="SMSMTRate" HeaderText="SMSMT Rate" UniqueName="SMSMTRate"
                    AllowFiltering="false" SortExpression="SMSMTRate" ReadOnly="true" ItemStyle-HorizontalAlign="Right"
                    HeaderStyle-HorizontalAlign="Right" DataFormatString="{0:G}">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DataRate" HeaderText="Data Rate" UniqueName="DataRate"
                    AllowFiltering="false" SortExpression="DataRate" ReadOnly="true" ItemStyle-HorizontalAlign="Right"
                    HeaderStyle-HorizontalAlign="Right" DataFormatString="{0:G}">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="MOCRate" HeaderText="MOC Rate" UniqueName="MOCRate"
                    AllowFiltering="false" SortExpression="MOCRate" ReadOnly="true" ItemStyle-HorizontalAlign="Right"
                    HeaderStyle-HorizontalAlign="Right" DataFormatString="{0:G}">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="MTCRate" HeaderText="MTC Rate" UniqueName="MTCRate"
                    AllowFiltering="false" SortExpression="MTCRate" ReadOnly="true" ItemStyle-HorizontalAlign="Right"
                    HeaderStyle-HorizontalAlign="Right" DataFormatString="{0:G}">
                </telerik:GridBoundColumn>
                <telerik:GridCheckBoxColumn DataField="FlatRate" HeaderText="Flat Rate" UniqueName="FlatRate"
                    SortExpression="FlatRate" ReadOnly="true" ItemStyle-HorizontalAlign="Center"
                    HeaderStyle-HorizontalAlign="Center">
                </telerik:GridCheckBoxColumn>
                <telerik:GridCheckBoxColumn DataField="Discount" HeaderText="Discount" UniqueName="Discount"
                    SortExpression="Discount" ReadOnly="true" ItemStyle-HorizontalAlign="Center"
                    HeaderStyle-HorizontalAlign="Center">
                </telerik:GridCheckBoxColumn>
                <telerik:GridCheckBoxColumn DataField="ActiveFlag" HeaderText="Active" UniqueName="ActiveFlag"
                    SortExpression="ActiveFlag" ReadOnly="true" ItemStyle-HorizontalAlign="Center"
                    HeaderStyle-HorizontalAlign="Center">
                </telerik:GridCheckBoxColumn>
            </Columns>
        </MasterTableView>
        <ClientSettings EnableRowHoverStyle="true">
        </ClientSettings>
        <PagerStyle Mode="NumericPages"></PagerStyle>
    </telerik:RadGrid>


Here is my codebehind which gets the attached error on the following line:
HyperLink link = (HyperLink)item["PLMN"].Controls[0]; 


protected void RadGrid_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = (GridDataItem)e.Item;
            HyperLink link = (HyperLink)item["PLMN"].Controls[0];
            string value = item.GetDataKeyValue("CarrierNetID").ToString();
            link.NavigateUrl = "~/CarrierLaunchStatusForm.aspx?addRecord=0&ID=" + value;
        }
    }


Can someone please help?
Code behind:



Bill
Top achievements
Rank 2
 answered on 14 Mar 2013
1 answer
60 views
I am pretty new to the Telerik stuff (and ASP.net)... but from what I've read and seen I think what I want to do is possible... I just can't seem to make it work... 

Here is what I'm working with.. wthin my database I have a table with company information on various companies that we do business with... I also have another table for people that is basically a list of all of the people that we do business with at the various companies.  These two tables are joined together on a 1 to many relationship based on companyid.  In the companies table is a column for the primary contact.. which holds the personId of the person from the people table that is the primary contact for that company (pretty basic stuff... nothing fancy here)

What I would like to do is have a grid that list all of the companies... within that grid have a couple of columns that lists the primary contact's name and email address... and when I edit the company record, in the edit template, have a drop down list that is filtered to just show the people from the person table that are affiliated with the company record that I am editing, then when I update it, have it update the person ID of the primary contact for the company, but in the grid, update the grid row to show the new person's name and email address... 

I am stuck on the best way to accomplish this.. I hope someone can help... 

Thanks in advance.

And I almost forgot... in the drop down list in the edit template, I would like to show the people's names rather than just a personID.. 
Kostadin
Telerik team
 answered on 14 Mar 2013
1 answer
381 views

Iv'e seen examples of the telerik:AjaxSetting and telerik:RadAjaxLoadingPanel so I thought I would try it out in stead of using the standard Ajax update panel.

For the most part it works ok, even mixing it up with standard Ajax like collapse panels. I came across an issue where setting up a Control to be updated by its own onTextChanged Event,  I got a funky java script error. It doess't prevent the control form being updated it just throws an exception.

here is the tag in question:

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" >
        <AjaxSettings>
  <telerik:AjaxSetting AjaxControlID="TextBox_capacity">
                <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="TextBox_capacity" />
                </UpdatedControls>
             </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />       </telerik:AjaxSetting>

I have others of course but this one throws the exception. Not Sure why. It works just fine once you click past the exception.
Line: 157
Error: Sys.ArgumentNullException: Value cannot be null.
Parameter name: panelsCreated[12]

And when  I debug:

$type.registerClass('Sys.WebForms.InitializeRequestEventArgs', Sys.CancelEventArgs);
$type = Sys.WebForms.PageLoadedEventArgs = function PageLoadedEventArgs(panelsUpdated, panelsCreated, dataItems) {
    /// <summary locid="M:J#Sys.WebForms.PageLoadedEventArgs.#ctor">The arguments for the PageRequestManager's pageLoaded event. The pageLoaded event is raised after the DOM has been updated.</summary>
    /// <param name="panelsUpdated" type="Array">An array of UpdatePanels that were updated.</param>
    /// <param name="panelsCreated" type="Array">An array of UpdatePanels that were created.</param>
    /// <param name="dataItems" type="Object" mayBeNull="true"></param>
    var e = Function._validateParams(arguments, [
        {name: "panelsUpdated", type: Array},
        {name: "panelsCreated", type: Array},
        {name: "dataItems", type: Object, mayBeNull: true}
    ]);
    if (e) throw e;
    Sys.WebForms.PageLoadedEventArgs.initializeBase(this);

    this._panelsUpdated = panelsUpdated;
    this._panelsCreated = panelsCreated;
    this._dataItems = dataItems || new Object();
}

I'm sure I'm missing something simple...........






Pablo
Top achievements
Rank 1
 answered on 14 Mar 2013
2 answers
128 views

I have this in an aspx file:

<telerik:RadGrid ID="radFinalMinutes" runat="server" AllowPaging="true" OnNeedDataSource="radFinalMinutes_NeedDataSource" PageSize="20" AllowSorting="true" ShowHeader="true"
                CellSpacing="0" EnableTheming="false" ShowStatusBar="true" EnableHeaderContextMenu="true" BorderStyle="None" OnItemCommand="radFinalMinutes_ItemCommand">
                <PagerStyle Mode="NextPrevAndNumeric" />
                <GroupingSettings CaseSensitive="false" />
                <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="false" DataKeyNames="MinuteId" AllowSorting="true" AllowMultiColumnSorting="true" AllowFilteringByColumn="true"
                    TableLayout="Auto" GridLines="Vertical">
                    <CommandItemTemplate>
                        <div class="control_heading">
                            <div style="float:left">
                                Finalized Documents <img src="help.png" alt="Help!"  />
                            </div>
                        </div>
                    </CommandItemTemplate>
                    <Columns>
                        <telerik:GridBoundColumn DataField="DivisionDescription" HeaderText="Division" UniqueName="Division" ItemStyle-HorizontalAlign="Left" />
                        <telerik:GridBoundColumn DataField="CategoryDescription" HeaderText="Category" UniqueName="Category" ItemStyle-HorizontalAlign="Left" />
                        <telerik:GridBoundColumn DataField="MeetingDescription" HeaderText="Meeting Type" UniqueName="MeetingType" ItemStyle-HorizontalAlign="Left"  />
                        <telerik:GridBoundColumn DataField="Facilitator" HeaderText="Facilitator" UniqueName="Facilitator" ItemStyle-HorizontalAlign="Left"  />
                        <telerik:GridDateTimeColumn DataField="MeetingDate" DataFormatString="{0:MMM dd, yyyy}" HeaderText="Date" UniqueName="Date" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Left"
                             AutoPostBackOnFilter="true" PickerType="DatePicker" EnableRangeFiltering="true" EnableTimeIndependentFiltering="false" CurrentFilterFunction="Between">
                            <FilterTemplate>
                                <table cellpadding="0" cellspacing="0" border="0">
                                    <tr>
                                        <td align="left">From:</td>
                                        <td align="left"><telerik:RadDatePicker ID="radFromDate" runat="server" Width="100px" ClientEvents-OnDateSelected="FromDateSelected"
                                            FocusedDate='<%# this.startDate %>' SelectedDate='<%# this.startDate %>'></telerik:RadDatePicker></td>
                                    </tr>
                                    <tr>
                                        <td align="left">To:</td>
                                        <td align="left"><telerik:RadDatePicker ID="radToDate" runat="server" Width="100px" ClientEvents-OnDateSelected="ToDateSelected"
                                            FocusedDate='<%# this.endDate %>' SelectedDate='<%# this.endDate %>'></telerik:RadDatePicker></td>
                                    </tr>
                                </table>
                                <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                                    <script type="text/javascript">
                                        function FromDateSelected(sender, args) {
                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                            var ToPicker = $find('<%# ((GridItem)Container).FindControl("radToDate").ClientID %>');
 
                                            var fromDate = FormatSelectedDate(sender);
                                            var toDate = FormatSelectedDate(ToPicker);
 
                                            tableView.filter("MeetingDate", fromDate + " " + toDate, "Between");
                                        }
                                        function ToDateSelected(sender, args) {
                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                            var FromPicker = $find('<%# ((GridItem)Container).FindControl("radFromDate").ClientID %>');
 
                                            var fromDate = FormatSelectedDate(FromPicker);
                                            var toDate = FormatSelectedDate(sender);
 
                                            tableView.filter("MeetingDate", fromDate + " " + toDate, "Between");
                                        }
                                        function FormatSelectedDate(picker) {
                                            var date = picker.get_selectedDate();
                                            var dateInput = picker.get_dateInput();
 
                                            var formattedDate = dateInput.get_dateFormatInfo().FormatDate(date, dateInput.get_displayDateFormat());
                                            return formattedDate;
                                        }
                                    </script>
                                </telerik:RadScriptBlock>
                            </FilterTemplate>
                        </telerik:GridDateTimeColumn>
                        </Columns>
                </MasterTableView>
            </telerik:RadGrid>

And the code behind:

protected DateTime DefaultFromDate { get { return DateTime.Now.AddDays( -60 ).Date; } }
protected DateTime DefaultThruDate { get { return DateTime.Now.AddDays( 30 ); } }
protected DateTime? startDate
{
  set
  {
    ViewState["strD"] = value;
  }
  get
  {
    if ( ViewState["strD"] != null )
      return (DateTime)ViewState["strD"];
    else
      return DefaultFromDate;
  }
}
protected DateTime? endDate
{
  set
  {
    ViewState["endD"] = value;
  }
  get
  {
    if ( ViewState["endD"] != null )
      return (DateTime)ViewState["endD"];
    else
      return DefaultThruDate;
  }
}
 
  protected void Page_Load( object sender, EventArgs e )
{
  if ( !IsPostBack )
  {
    LoadInfo();
    this.startDate = DefaultFromDate;
    this.endDate = DefaultThruDate;
  }
}
 
protected void LoadInfo()
{
  //loading data here into variable "list"
  var list = Database.SetupFinalMinutes();
  list.Load();
 
  radFinalMinutes.DataSource = list.ToList();
}
 
protected void radFinalMinutes_NeedDataSource( object sender, GridNeedDataSourceEventArgs e )
{
  LoadInfo();
}
 
protected void radFinalMinutes_ItemCommand( object sender, GridCommandEventArgs e )
{
  if ( e.CommandName == RadGrid.FilterCommandName )
  {
    Pair filterPair = (Pair)e.CommandArgument;
 
    switch ( filterPair.Second.ToString() )
    {
      case "Date":
        this.startDate = ((e.Item as GridFilteringItem)[filterPair.Second.ToString()].FindControl( "radFromDate" ) as RadDatePicker).SelectedDate;
        this.endDate = ((e.Item as GridFilteringItem)[filterPair.Second.ToString()].FindControl( "radToDate" ) as RadDatePicker).SelectedDate;
        break;
      default:
        break;
    }
  }
}

Now the problem I'm having is the radFinalMinutes_ItemCommand event doesn't fire when I change the dates in my date filter.  Any ideas?  The javascript in the RadScriptBlock1 does fire, and returns the correct dates [and formatting] - but the filtering on the between dates does not happen.  All other columns do fire the ItemCommand.

Edit: should note, I followed http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filtertemplate/defaultcs.aspx

Mike
Top achievements
Rank 1
 answered on 14 Mar 2013
1 answer
62 views
Hello,

When i try to upload an image on the demo website
 (http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx)
i get the following error:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; WOW64; Trident/4.0; GTB7.4; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; .NET4.0C; .NET4.0E)
Timestamp: Wed, 13 Mar 2013 07:34:25 UTC

Message: Unspecified error.
Line: 49
Char: 5
Code: 0
URI: http://demos.telerik.com/aspnet-ajax/editor/examples/overview/Telerik.Web.UI.DialogHandler.aspx?DialogName=ImageManager&UseRSM=true&Skin=Metro&Title=Image+Manager&doid=c5466ed4-9416-4601-b991-fbf5832a3cc4&dpptn=

 

Rumen
Telerik team
 answered on 14 Mar 2013
2 answers
73 views
How do you create a new instance of a RadWindow using Javascript, I am trying to create multiple RadWindows based on the CommandName of the Button on the Ribbon. For example, a button called "Create Chart" will open a new window of a chart, and the user can click "Create Grid" to display a grid window, both of the windows should be on the page. And I am trying to do this without a postback...which is why I want to create them using Javascript.

Here is the function I am trying

function dsxRibbonBar_ButtonClicked(sender,args)
{
 var windowType = args.get_commandName();//How do I get the the button command name? 
 alert(windowType);
}


Thanks in advance.



Michael
Michael
Top achievements
Rank 1
 answered on 14 Mar 2013
1 answer
27 views
The Context popup menu which comes on right click, inside the RadEditor control is not having aligned text.
the menu text in the popup, is wrapped and not in order.
Please find attached the screenshot
Rumen
Telerik team
 answered on 14 Mar 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?