Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
115 views
Hi,

 I've a question regarding radajaxpanel and the ajaxmanager. I've used the telerik example RadScheduler with tooltip. I've extended the tooltip with a button. The ClickEvent is implemenet in the main page (code behind - used a deligate in the tooltip control). The Button works fine, but after executing the onclick event I like to update my rategrid1. It works with an updatepanel if I use UpdatePanel2.Update(). But if i use radajaxpanel the rategrid1 doesn't get updated even on rategrid1.rebind(). Also the Button on the bottom of the page, which is enabled=false should be updated. I guess I've to use the ajax manager, but I'm not sure how this works. Maybe you can tell me how to manage the updates.

Here is my new code again:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ProtelShop._Default" MasterPageFile="~/ProtelShop.Master" %> 
 
<%@ Register assembly="Telerik.OpenAccess, Version=2009.1.405.1, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342" namespace="Telerik.OpenAccess" tagprefix="telerik" %> 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik"  %> 
 
 
 
<%@ Reference Control="~/Controls/ShopBuyTooltip.ascx" %> 
 
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">  
 
  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
 <AjaxSettings>    
        <telerik:AjaxSetting AjaxControlID="RadGrid1">    
            <UpdatedControls>    
                <telerik:AjaxUpdatedControl ControlID="RadGrid1"  />    
            </UpdatedControls>    
        </telerik:AjaxSetting>    
        <telerik:AjaxSetting AjaxControlID="RadWindowManager1">    
            <UpdatedControls>    
                <telerik:AjaxUpdatedControl ControlID="RadWindowManager1"  />    
            </UpdatedControls>    
        </telerik:AjaxSetting>    
 
    </AjaxSettings>   
    </telerik:RadAjaxManager> 
 
    <div> 
      
    </div> 
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">  
      
    </telerik:RadScriptManager> 
       
    <telerik:RadWindowManager runat="server" ID="RadWindowManager1">  
    </telerik:RadWindowManager> 
    <script type="text/javascript">  
 
        //<![CDATA[
       
            function hideActiveToolTip()
            {            
                var controller = Telerik.Web.UI.RadToolTipController.getInstance();
                var tooltip = controller.get_activeToolTip();
                if (tooltip)
                {
                    tooltip.hide();
                }
            }
            
            Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequestHandler);
            function beginRequestHandler(sender, args)
            {
                var prm = Sys.WebForms.PageRequestManager.getInstance();
                if (args.get_postBackElement().id.indexOf('RadScheduler1') != -1)
                {
                    hideActiveToolTip();
                }
            }
            
            function clientBeforeShow (sender, eventArgs) {
             w = $telerik.$(window).width() / 2;
             h = $telerik.$(window).height() / 2;
               
             if ((sender._mouseX > w) && (sender._mouseY > h)) {
             sender.set_position(Telerik.Web.UI.ToolTipPosition.TopLeft);
             return;
             }
             if ((sender._mouseX < w) && (sender._mouseY > h)) {
             sender.set_position(Telerik.Web.UI.ToolTipPosition.TopRight);
             return;
             }
             if ((sender._mouseX > w) && (sender._mouseY < h)) {
             sender.set_position(Telerik.Web.UI.ToolTipPosition.BottomLeft);
             return;
             }
         sender.set_position(Telerik.Web.UI.ToolTipPosition.BottomRight);
            }
        //]]> 
        </script> 
    <telerik:OpenAccessDataSource ID="OpenAccessDataSource1" runat="server"   
        ObjectContextProvider="ProtelShop.ObjectScopeProvider1, ProtelShop"   
        TypeName="ProtelAccess.Article" ContextTypeName="" OrderBy=""   
        Where="MaxAnz &gt; 0" > 
    </telerik:OpenAccessDataSource> 
       
<telerik:RadSkinManager ID="RadSkinManager1" runat="server">          
        </telerik:RadSkinManager> 
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server"  DecoratedControls="All"/>  
     
                    
                  <asp:Panel ID="Panel2" runat="server" CssClass="title" > 
                   Seminar Angebote  
               </asp:Panel> 
             
               <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" > 
    <telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="EndTime"   
        DataKeyField="ArtNr" DataSourceID="OpenAccessDataSource1"   
        DataStartField="StartTime" DataSubjectField="Name" HoursPanelTimeFormat="htt"   
        ValidationGroup="RadScheduler1"  ReadOnly="true"  SelectedView="MonthView" Height="350">  
    </telerik:RadScheduler> 
    <telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" Width="320" Height="170" 
                    Animation="None" HideEvent="LeaveToolTip" Text="Loading..." 
                    OnAjaxUpdate="RadToolTipManager1_AjaxUpdate" OnClientBeforeShow="clientBeforeShow" /> 
                      
                    </telerik:RadAjaxPanel> 
                   <br /> 
         
 
 
      
            <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" > 
      
           <br /> 
               <asp:Panel ID="Panel1" runat="server" CssClass="title">  
                   Warenkorb  
               </asp:Panel> 
           <telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="true"   
                    AllowAutomaticUpdates="true" AutoGenerateColumns="true"   
                    AutoGenerateDeleteColumn="true" OnDeleteCommand="RadGrid1_DeleteCommand"  OnItemDataBound="RadGrid1_ItemDataBound" > 
                    <MasterTableView AutoGenerateColumns="False" RetrieveAllDataFields="false" ShowFooter="true">  
                        <Columns> 
                            <telerik:GridBoundColumn DataField="ArtNr" HeaderText="Artikelnummer">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="Name" HeaderText="Artikelname">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="ArtName" HeaderText="Artikelbeschreibung">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="StartTime" HeaderText="Start">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="EndTime" HeaderText="Ende">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="Quantity" HeaderText="Anzahl">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="ArtPrice" HeaderText="Preis" DataFormatString="{0:C}">  
                            </telerik:GridBoundColumn> 
                             
 
                        </Columns> 
                          
                    </MasterTableView> 
                </telerik:RadGrid> 
     
        </telerik:RadAjaxPanel> 
        <br /> 
 
    <telerik:RadAjaxPanel ID="RadAjaxPanel3" runat="server" > 
    
        <div style="text-align:right">  
    <asp:Button ID="Button1" runat="server" Text="Zur Kasse" onclick="Button1_Click" Width="100px"  /> 
    </div> 
      </telerik:RadAjaxPanel> 
 
      
 </asp:Content> 


  private void btbuy_clicked(object sender, EventArgs e)  
        {  
            AppointmentToolTip mytooltip = (AppointmentToolTip)sender;  
            TempOrder myOrder = new TempOrder();  
            int ArtID = int.Parse(mytooltip.TargetAppointment.ID.ToString());  
            int ct = 0;  
            for (int a = 0; a < myOrders.Count; a++)  
            {  
                TempOrder to = (TempOrder)myOrders[a];  
                if (to.ArtNr == ArtID)  
                    ct++;  
 
            }  
 
              
            var articlesselected = from a in cashedScope.Extent<Article>()  
                                   where a.ArtNr == ArtID  
                                   select a;  
 
              
            cashedScope.Transaction.Begin();  
 
            foreach (Article art in articlesselected)  
            {  
                if (ct + 1 > art.MaxAnz)  
                {  
 
                    string scriptstring = "radalert('<h4>Dieser Artikel ist leider nicht mehr verfügbar!</h4>', 330, 210);";    
                    ScriptManager.RegisterStartupScript(thisthis.GetType(), "radalert", scriptstring, true);    
                    return;  
                }  
                myOrder.setArticle(1, art);  
            }  
 
            cashedScope.Transaction.Commit();  
            myOrders.Add(myOrder);  
            Session["myOrders"] = myOrders;  
            if (myOrders.Count > 0)  
            {  
                Button1.Enabled = true;  
        
            }  
            TAmount += myOrder.ArtPrice;  
 
            RadGrid1.Rebind();  
            
        } 

Thanks
Pavlina
Telerik team
 answered on 30 Jun 2009
7 answers
533 views
Hi,
 I have a date picker and required field validator on a user control. The issue is if I click in the date input box and I click on the calendar popup button or even I just clicked anywhere on the page the "Error message is shown" before I click on the save button on the page.
 Is this the real behaviour? or Is there a way to solve the issue?
ascx:
telerik:RadDatePicker AutoPostBack="false" runat="server" ID="datepicker1" Skin="Web20new"
                        EnableEmbeddedSkins="false" MinDate="1900-01-01" Width="132px">
                        <DateInput runat="server" InvalidStyleDuration="100" DateFormat="MM/dd/yyyy" LabelCssClass="radLabelCss_Web20new"
                            Skin="Web20new" EnableEmbeddedSkins="False" ShortYearCenturyEnd="2039">
                            <InvalidStyle ForeColor="Red" />
                        </DateInput>
</telerik:RadDatePicker>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="datepicker1" ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>

aspx:
Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
..
End Sub

 Thank you
Pavlina
Telerik team
 answered on 30 Jun 2009
6 answers
174 views
Hi,
I'm using a RadGrid inside a RadWindow (as a popup), to allow the user select a row that will be added on the main page.
I want to get the Key of the selected row and pass it to the main page, the code of the page that loads into RadWindow is:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NewsSelect.aspx.cs" Inherits="SR.News.Views.NewsSelect" 
    Title="NewsSelect"  %> 
<%@ Register Assembly="Microsoft.Practices.Web.UI.WebControls" Namespace="Microsoft.Practices.Web.UI.WebControls" 
    TagPrefix="pp" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" style="height: 100%"
<head id="Head" runat="server">  
    <script type="text/javascript">             
    function GetRadWindow() 
    { 
    var oWindow = null
    if (window.radWindow) 
     oWindow = window.radWindow; 
    else if (window.frameElement.radWindow) 
     oWindow = window.frameElement.radWindow; 
    return oWindow; 
    }    
    function OnClientRowSelected(sender, eventArgs) 
    { 
    var currentWindow = GetRadWindow();     
    var newsId = eventArgs.getDataKeyValue("NewsID") 
    currentWindow.close(newsId); 
    }      
    </script> 
    <link href="../App_Themes/Default/rightcontent.css" type="text/css" rel="stylesheet" /> 
    <title>SardegnaRicerche</title> 
</head> 
<body style="height: 100%; margin: 0 auto; overflow: hidden" scroll="no"
 
     
    <form id="form1" runat="server" style="height: 100%; width: 100%; margin: 0px"
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"  
        OutputCompression="AutoDetect"
    </telerik:RadScriptManager> 
    <pp:ObjectContainerDataSource ID="odsNews" runat="server"  
        DataObjectTypeName="SRRules.Entities.News" /> 
    <telerik:RadGrid ID="grdFiles" runat="server" AutoGenerateColumns="False"  
        GridLines="None" Skin="Office2007" DataSourceID="odsNews"
<MasterTableView DataKeyNames="NewsID" DataSourceID="odsNews"  
            ClientDataKeyNames="NewsID"
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
        <telerik:GridBoundColumn DataField="Priority" DataType="System.Int32" HeaderText="Priorità" 
                    ReadOnly="True" SortExpression="Priority" UniqueName="Priority"
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="Title"  
                    HeaderText="News" UniqueName="Title" SortExpression="Title"
                </telerik:GridBoundColumn> 
                <telerik:GridDateTimeColumn DataField="StartDatePublication"  
                    HeaderText="Data pubblicazione" SortExpression="StartDatePublication" 
                    UniqueName="StartDatePublication"  DataFormatString="{0:d}" 
                    DataType="System.DateTime"
                </telerik:GridDateTimeColumn> 
                <telerik:GridDateTimeColumn DataField="EndDatePublication"  
                    HeaderText="Data scadenza" SortExpression="EndDatePublication" 
                    UniqueName="EndDatePublication" DataFormatString="{0:d}"  
                    DataType="System.DateTime"
                </telerik:GridDateTimeColumn> 
    </Columns>     
</MasterTableView> 
 
        <ClientSettings> 
            <Selecting AllowRowSelect="True" EnableDragToSelectRows="False" /> 
            <ClientEvents OnRowSelected="OnClientRowSelected" /> 
        </ClientSettings> 
 
<FilterMenu EnableTheming="True" Skin="Office2007"
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</FilterMenu> 
    </telerik:RadGrid> 
    </form> 
</body> 
</html> 


This code work fine for IE7, however, the event doesn't get fired in Firefox3 (I tried putting a breakpoint on the function OnClientRowSelected(sender, eventArgs) (line 20) and Firefox never reaches it.

I would appreciate any help on this matter,

Regards,
Raúl Herrmann

Pavlina
Telerik team
 answered on 30 Jun 2009
7 answers
164 views
Hi Telerik Team,

We have implemented the RadGrid header localization using Grid ItemCreated event(as per mentioned in your help documentation).But here we are facing major performance issues;reason being during binding of the Grid for every record, Grid Item event is getting invoked, so calling of this event for every record is very time consuming.

We are looking for an event where we can localize grid header at once only other than Item_Created or Column_Created Event to regain performance of the page.

Thanks,
Rajesh
Georgi Krustev
Telerik team
 answered on 30 Jun 2009
2 answers
150 views
Ever time I try to install the RadControls I get the following error:
"Another installation is in progress. You must comßplete that installation before continue this one".

This appears also after a complete reboot.
How can I discover the process which is causing this error?

Thank you,
Reinhold
Reinhold
Top achievements
Rank 1
 answered on 30 Jun 2009
1 answer
68 views
Hi,

are there any ways to remove the space that displays the chart title in order to save some space?

Thanks in advance.

Duy
Ves
Telerik team
 answered on 30 Jun 2009
1 answer
90 views

Hi

In telerik grid we are using CustomPaging for scrolling record so I have written following code.

<telerik:RadGrid ID="Grid1" runat="server" PageSize="8" AllowCustomPaging="true">

<ClientSettings>

<Scrolling AllowScroll="True" EnableVirtualScrollPaging="True" UseStaticHeaders="True" ScrollHeight ="215" SaveScrollPosition="True">

</Scrolling>

      </ClientSettings>

 

This code display record correctly but when I change page size at runtime grid not resize and also not shown all the rows on the screen.

 

Pavlina
Telerik team
 answered on 30 Jun 2009
3 answers
105 views
Hi,

RadGrid is refusing to apply the property ItemStyle HorizontalAlign="Center" / ItemStyle-HorizontalAlign="Center", no matter where I specify the property in the markup, it always ignores it and the text is still left aligned. I have also tried applying css class to gridboundcolumns with text-align:center !important; and this has no effect either.

This only appears to be happening since upgrading to 2009, does anyone know why I cannot get the dataitems to align in center? Is there a solution?

Thanks,
Matt
Pavlina
Telerik team
 answered on 30 Jun 2009
1 answer
89 views
Hi
        I am using Radgrid which has the option to export pdf. I am using commanditem template having linkbutton control.
When i click the button i hav to export the existing grid data to PDF file. But once after i click the link button the pdf file opens but it lokked like blank sheet.

if (e.Item is GridCommandItem)
        {
            if (e.CommandName == "lnkExportPDF")
            {
               RadGrid1.ExportSettings.ExportOnlyData = true;
              RadGrid1.ExportSettings.IgnorePaging = true;
               RadGrid1.ExportSettings.OpenInNewWindow = true;
               RadGrid1.ExportSettings.Pdf.Title = "Billing Report";
              RadGrid1.ExportSettings.Pdf.PageLeftMargin=Unit.Pixel(10);
              RadGrid1.ExportSettings.Pdf.PageRightMargin = Unit.Pixel(10);
               RadGrid1.ExportSettings.Pdf.PageWidth = Unit.Pixel(3500);
                this.RadGrid1.MasterTableView.ExportToPdf();

            }
        }

But the Export pdf works with ordinary button placed outside of radgrid.It shows complete data in the PDF file. But it doesnt work when i have created the link button as CommandItemTemplate.

Plz direact me as soon as possible

Regards,
Appu
Daniel
Telerik team
 answered on 30 Jun 2009
2 answers
57 views

Hi,

I have a UserControl (m_ucPolicyList) within a RadPanelBar.

<telerik:RadPanelBar runat="server" ID="m_rpbPageContent" Width="99%">
<Items>
<telerik:RadPanelItem  runat="server" Text="General Information" Width="100%" Value="General Information Panel" Expanded="true">
<ItemTemplate>
<div id="m_ldGeneralInfo" runat="server">
<tstUser:PolicyListControl ID="m_ucPolicyList" runat="server"/>
</div>
</ItemTemplate>
</telerik:RadPanelItem>
</Items>
</telerik:RadPanelBar>

is there anyway to subscribe to events raised by my usercontrol (m_ucPolicyList)?

What I'm finding is that the UserControl (any control within a RadPanelBar) is not available to me at Page_Load and I have to wait for Page_PreRender to access it via the FindItemByValue() method. However, it appears that if I try to attach the eventhandler to my control in Page_PreRender it is too late in the page lifecycle to actually work.

I thought perhaps I could attach the eventhandler in the _ItemCreated event of the RadPanelBar but that event is not firing for me.

Any suggestions?

Thanks so much,

Kennon

Kennon McCaa
Top achievements
Rank 1
 answered on 30 Jun 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?