Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
139 views
Hello,

some days before I faced a strange behavior. I tried to show a radAlert window, from a modal radWindow, on top of all windows, so I set its z-index clientside like this:

_radalert.get_popupElement().style.zIndex = 100000;

The problem was that the radAlert was shown on top, but the gray-color panel was placed behind the radWindow, so the radWindow remained active, not disabled.

Finally I found a solution, setting this property, too:

_radalert.get_popupElement().style.zIndex = 100001;
_radalert._modalExtender._backgroundElement.style.zIndex = 100000;


What I would like to know is if there is a public property or a 'get' method to access the private object "_modalExtender"

Thanks in advance.
Marin Bratanov
Telerik team
 answered on 14 Mar 2012
2 answers
105 views
Hi All,
I am using ragdrid with 7 columns,in this grid for name column, i am using filter option(ShowFilterIcon="True"),for this column,if i click on filter option,i am getting 17 filter options.But my requirement is, i want to show only 4 options.
Is it possible or not ?

Thanks in advance

Regards,
Sekhar.
Purnasekhar
Top achievements
Rank 1
 answered on 14 Mar 2012
1 answer
390 views
Hello,

I use RadGrid and have javascript function that calls fireCommand for adding new rows. It works only when I the grid is not empty. When the gird havs 0 rows, it still fires Page_Load, but not the event handler for ItemCommand event. It used to work before the last 2 updates.

See the example below:

Main.aspx:
<%@ Page EnableViewState="true" Language="C#" AutoEventWireup="true" CodeBehind="Main.aspx.cs"
    Inherits="Pages.MainPage" MasterPageFile="~/Main.master" %>
 
<asp:Content ContentPlaceHolderID="Head" runat="server">
    <script type="text/javascript">
        function AddNewRow(idGrid) {
            var masterTable = $find(idGrid).get_masterTableView();
            masterTable.fireCommand("NewRow");
        }
    </script>
</asp:Content>
<asp:Content ContentPlaceHolderID="Content" runat="server">
    <telerik:RadGrid runat="server" ID="grid" OnNeedDataSource="grid_NeedDatasource"
        OnItemCommand="grid_ItemCommand" AutoGenerateColumns="false" Width="300">
        <MasterTableView ShowFooter="true" EnableViewState="true" DataKeyNames="Value">
            <Columns>
                <telerik:GridTemplateColumn>
                    <ItemTemplate>
                        <%# Eval( "Value" ) %>
                    </ItemTemplate>
                    <FooterTemplate>
                        <telerik:RadNumericTextBox runat="server" ID="tbValue" Value="0" />
                    </FooterTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="ColumnOperation">                      
                    <FooterTemplate>
                        <a href="javascript:void(0)">
                            <img src='<%# Telerik.Web.SkinRegistrar.GetWebResourceUrl(Page,typeof(RadGrid), "Telerik.Web.UI.Skins.WebBlue.Grid.AddRecord.gif") %>'
                                onclick="AddNewRow('<%# Container.OwnerTableView.Parent.ClientID %>');"
                                alt="Add" /></a>
                    </FooterTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridButtonColumn UniqueName="ColumnDelete" CommandName="Delete" ButtonType="ImageButton" />
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
</asp:Content>

Main.aspx.cs:
using System;
using System.Web.UI;
using System.Collections.Generic;
using System.Linq;
using Telerik.Web.UI;
 
namespace Pages
{
    public partial class MainPage : Page
    {      
        public void Page_Load( object sender, EventArgs e )
        {
            if ( !IsPostBack )
            {
                m_values = new List<Double>() { 1, 2, 3 };
            }
        }
 
 
        protected void grid_NeedDatasource( Object sender, GridNeedDataSourceEventArgs e )
        {
            grid.DataSource = m_values.Select( x => new { Value = x } );
        }
 
 
        protected void grid_ItemCommand( object sender, GridCommandEventArgs e )
        {
            switch ( e.CommandName )
            {
                case "NewRow":
                    var item = grid.MasterTableView.GetItems( GridItemType.Footer )[ 0 ];
                    var tbValue = item.FindControl( "tbValue" ) as RadNumericTextBox;
 
                    m_values.Add( tbValue.Value.Value );
 
                    grid.Rebind();
                    break;
 
                case "Delete":
                    var value = (Double)( e.Item as GridDataItem ).GetDataKeyValue( "Value" );
                    m_values.Remove( value );
                     
                    grid.Rebind();
                    break;
            }
        }
 
 
        private List<Double> m_values
        {
            get
            {
                return ViewState[ "values" ] as List<Double>;
            }
            set
            {
                ViewState[ "values" ] = value;
            }
        }
    }
}
Richard
Top achievements
Rank 1
 answered on 14 Mar 2012
1 answer
185 views
Hello!

I have a question regarding programmatically created RadDock controls. I can't figure out how to wire them with server-side Command event. On creating RadDock custom controls are loaded and they do postback on click but they don't fire Command event. The problem is also that on postback custom control disappears so one more thing is how to avoid that behavior.

This is my code:

        private RadDock CreateRadDock()
        {
            int docksCount = CurrentDockStates.Count;
            int idTicket = Convert.ToInt32(rcbTicketi.SelectedValue);

            Ticket ticket = db.Ticket.SingleOrDefault(t => t.idTicket == idTicket);

            RadDock dock = new RadDock();
            dock.DockMode = DockMode.Docked;
            dock.UniqueName = Guid.NewGuid().ToString().Replace("-", "a");
            dock.ID = string.Format("RadDock{0}", dock.UniqueName);
            dock.Title = ticket.idNadredeniTicket + "-" + ticket.RedniBroj + " (" + ticket.Firma.Naziv + ")";
            dock.Text = ticket.Opis;
            dock.Width = Unit.Pixel(500);
            dock.Command += new DockCommandEventHandler(RadDock_Command);

            DockCommand close = new DockCommand();
            close.AutoPostBack = true;
            close.Text = "Zatvori incident";
            close.Name = "Zatvori";

            DockCloseCommand hide = new DockCloseCommand();
            close.AutoPostBack = true;
            close.Text = "Sakrij";

            dock.Commands.Add(hide);
            dock.Commands.Add(new DockExpandCollapseCommand());
            dock.Commands.Add(close);           

            return dock;
        }

        protected void RadDock_Command(object sender, Telerik.Web.UI.DockCommandEventArgs e)
        {
            string naziv = e.Command.Name;

            if (e.Command.Name == "Zatvori")
            {
                Response.Redirect("www.google.hr");
            }
            else if (e.Command.Name == "Close")
            {
                Response.Redirect(Request.RawUrl + "?id=1");
            }
        }


There is also one more thing that bothers me. How could I get the ID of the RadDock on fired event?

Regards,

Hrvoje
Slav
Telerik team
 answered on 14 Mar 2012
5 answers
103 views
2010.3.1109.40

I created a non recurring appointment on March 1 2011 with a start date and time of March 16 2011 at 11am.  After it was created it showed in the scheduler correctly as11am.  However, now that March 16th has come the appointment is shown in the scheduler as starting at noon (1hr ahead of what its suppose to start on).  In the database its stored as "2011-03-15 19:00:00.000", my server time zone is PST (Pacific Standard Time).  I have created my scheduler and data access as outlined here and have a load event as shown below.  Please advise on how to get my events to show properly, its much more than just this event and this is a problem in production right now. 

protected void RadScheduler1_Load(object sender, EventArgs e)
{
    TimeZone localZone = TimeZone.CurrentTimeZone;
    TimeSpan currentOffset = localZone.GetUtcOffset(DateTime.Today);
    this.RadScheduler1.TimeZoneOffset = currentOffset;
}

Peter
Telerik team
 answered on 14 Mar 2012
5 answers
346 views
I am trying to set the attributes of an edit hyperlink in a TreeList. When you click the edit hyperlink it will execute javascript to open a RadWindow. What I would like to do is to pass the "Req #" column value when you click the hyperlink. I thought the best way would be to write that value in the onclick attribute on each hyperlink created. Although I'm having trouble getting the associated "Req #" column value.

To make it easier to understand I have attached an image. Basically I want pass the "Req #" value to the RadWindow when the "view/edit" link is clicked. 

Below is my code:

ASPX

<telerik:RadAjaxLoadingPanel ID="replenishmentLoadingPanel" runat="server" Skin="Simple" />
        <telerik:RadTabStrip ID="replenishmentTabStrip" runat="server" Skin="Simple" MultiPageID="RadMultiPage2"
            SelectedIndex="0">
            <Tabs>
                <telerik:RadTab Text="Req">
                </telerik:RadTab>
                <telerik:RadTab Text="P.O.">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="RadMultiPage2" runat="server" SelectedIndex="0" >
            <telerik:RadPageView ID="replenishmentPageView1" runat="server">
                <telerik:RadTreeList ID="requisitionTreeList" runat="server" AutoGenerateColumns="false" AllowSorting="false" AllowPaging="false"
                  OnNeedDataSource="requistions_needdata" OnPreRender="replenishment_PreRender" OnItemCreated="requisitons_ItemCreated"
                  DataKeyNames="ID" ParentDataKeyNames="PID" ShowTreeLines="false" EditMode="PopUp" >
                    <Columns>
                        <telerik:TreeListEditCommandColumn ShowEditButton="false" AddRecordText="Add" HeaderStyle-Width="30px" />
                        <telerik:TreeListBoundColumn DataField="ID" Visible="false" />
                        <telerik:TreeListBoundColumn DataField="PID" Visible="false" />
                        <telerik:TreeListBoundColumn DataField="ReqNum" HeaderText="Req #" UniqueName="ReqNum" />
                        <telerik:TreeListBoundColumn DataField="PONumber" HeaderText="PO #" />
                        <telerik:TreeListBoundColumn DataField="ReqDateTime" HeaderText="Transmit Time" />
                        <telerik:TreeListTemplateColumn UniqueName="TemplateEditColumn">
                            <ItemTemplate>
                                <asp:HyperLink ID="EditLink" runat="server" Text="View/Edit" href="#" onclick="openRadWin();"></asp:HyperLink>
                            </ItemTemplate>
                        </telerik:TreeListTemplateColumn>
                    </Columns>
                </telerik:RadTreeList>
                 
            </telerik:RadPageView>
 
            <telerik:RadPageView ID="repenishmentPageView2" runat="server">
                <telerik:RadTreeList ID="purchaseorderTreeList" runat="server" AutoGenerateColumns="false" AllowSorting="false" AllowPaging="false"
                  OnNeedDataSource="purchaseOrders_needdata" DataKeyNames="ID" ParentDataKeyNames="PID" ShowTreeLines="false" EditMode="PopUp" >
                    <Columns>
                        <telerik:TreeListEditCommandColumn ShowEditButton="false" AddRecordText="Add" HeaderStyle-Width="50px" />
                        <telerik:TreeListBoundColumn DataField="ID" Visible="false" />
                        <telerik:TreeListBoundColumn DataField="PID" Visible="false" />
                        <telerik:TreeListBoundColumn DataField="PONumber" HeaderText="PO #" />
                        <telerik:TreeListBoundColumn DataField="ReqNum" HeaderText="Req #" />
                        <telerik:TreeListBoundColumn DataField="PODateTime" HeaderText="Transmit Time" />
                    </Columns>
                </telerik:RadTreeList>
            </telerik:RadPageView>
        </telerik:RadMultiPage>


C#

protected void requisitons_ItemCreated(object sender, TreeListItemCreatedEventArgs e)
       {
           if (e.Item is TreeListDataItem)
           {     
               HyperLink editLink = (HyperLink)e.Item.FindControl("EditLink");
               editLink.Attributes["href"] = "#";
               //editLink.Attributes["onclick"] = "openRadWin(" + value + ");";
           }
       }


William
Top achievements
Rank 1
 answered on 14 Mar 2012
2 answers
200 views
We are using  Telerik.Web.UI   v. 2009.3.1208.0.

When customErrors are ON all errors come back as "There was an error in the callback.s[]_$$_"

If customErrors are turned OFF all error come back with proper messages (what was thrown from server side)

Steps to reproduce.

1) On the server side handle NodeExpand  event from the Telerik.Web.UI.RadTreeView
2) Within the method that handles the NodeExapend thrown an exception with some text "This is the error"
3) Make sure your web.config had this line  <customErrors mode="On" defaultRedirect="~/Error/ErrorPage.aspx"  redirectMode="ResponseRewrite" />
4) Click on the node and you will get an alert text box with the following text:  "There was an error in the callback.s[]_$$_"


If customErrors are turned off alert text box comes back with the right text: "This is the error.s[]_$$_" 

Please, help!
Plamen
Telerik team
 answered on 14 Mar 2012
2 answers
41 views
I noticed few issues with the newer version which I havent encountered with all other versions,
 1. When I press 'Enter' key after typing userid and password in login form it doesnt postback.
 2. When I enter values in a numeric textbox, it shows the value next to the control rather than displaying in the textbox.[See attachement]

Please let me know if I am missing something. Thanks in advance.
Dipen
Top achievements
Rank 1
 answered on 14 Mar 2012
1 answer
86 views
Hi,

Is there a way of locking certain columns (ie enabled=false) easily with the standard HeaderContextMenu columns selector sub-menu? What I need is for certain columns to be always visible and allow others to be switched on and off as required - however I can't see an easy way to do this.

Any advice would be appreciated,

Thanks

Barry
Richard
Top achievements
Rank 1
 answered on 14 Mar 2012
7 answers
303 views
Trying to change the colour of the grid row during the client-side databind event:

                function OnGridRowDataBound(oGrid, args) { 
                    var dataItem = args.get_dataItem(); 
                    var status = dataItem.Attributes["Status"]; 
                    if (status == "Locked") { 
                        var rowElement = dataItem.get_element(); 
                        rowElement.style.backgroundColor = "red"
                    } 
                } 
 

Gives me dataItem.get_element() is not a function.

Can you let me know how I can do this?

thanks,
Steve
Pero
Telerik team
 answered on 14 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?