Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
138 views
Hi everyone

I need to create a custom pager to radgrid.

I need to use a slider with page size.

I tried the example  -- Grid/Pager Template  , i change the
<PagerStyle Mode="NumericPages" PageButtonCount="10" />
to
<PagerStyle Mode="Slider"/> 
but i can“t see the slider.

Can you help me please with a little example.

Thanks in advance.

Jolynice.
Iana Tsolova
Telerik team
 answered on 22 Dec 2010
6 answers
54 views
Hi ,
I am using q1 2009 rad controls & Ajax manger also.
I am trying to add RadAjaxmange in my pages to avoid postback operation on my page. But when i add RadAjaxManger for Rad dropdown list. After adding RadAjaxmanger when i select item from dropdown its showing javascript error. please see my Javascript error below.

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; MS-RTC LM 8; .NET4.0C; .NET4.0E)
Timestamp: Wed, 8 Dec 2010 22:05:30 UTC

Message: Sys.InvalidOperationException: Two components with the same id 'ctl00_Cph1_CalendarExtender1' can't be added to the application.
Line: 3654
Char: 59
Code: 0
URI:
http://localhost:2065/NDIWeb/ScriptResource.axd?d=jO6lj8d7MPtcjhVtE5RwyJDsREURMbGvovQRWfOSAflo-_iG0Te3w-aVNsEkrrZRjAdsxnEEatXuPpVt_SY0GgFT0hbY8eF7SfQvNW8DPG_QZKnBMDFKG07_snOYIQdEaZtF58fuzoFD3n-aXSkAuR4s8zL_EG1I1sDKTWcFIDU6GIKg0&t=634172965859113573

see my code below, For RadAjaxMAnge i set Ajax controlID -> Update panel ID. if i made a mistake please respond to my post.

<%@ MasterType VirtualPath="~/NDIMaster.master" %>
//added script manger in MAster page.
<%@ Register Assembly="RadComboBox.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<%@ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
  
<asp:Content ID="Content1" ContentPlaceHolderID="Cph1" Runat="Server">
<asp:UpdatePanel runat="server" ID="update1" UpdateMode="Conditional" >
    <ContentTemplate >
      <div style="text-align: center;"  id="divsearch">
      <br />      
      <rad:RadAjaxManager ID="RadAjaxManager1" runat="server">
       <AjaxSettings>
        <rad:AjaxSetting AjaxControlID="update1">
         <UpdatedControls>
           <rad:AjaxUpdatedControl ControlID ="radddlcust" />           
         </UpdatedControls>              
        </rad:AjaxSetting>
       </AjaxSettings>
      </rad:RadAjaxManager>
        
        <table border="0" width="820px"  style="text-align:center;" tit le="This table organize the page content" summary="This table organize the page content">
          <tr align="center">
           <td style="width:780px; height: 86px;" colspan="4" align="center">
             
            <asp:Panel runat="server" ID="pnlcust" Enabled="true" CssClass="borderPanel" HorizontalAlign="Center" Width="820px">
             
             <table width="820px" align="center" style="vertical-align:top;margin-bottom:3px;">
               <tr class="HeaderRowIndented">   
                 <td colspan="16"  title="AppilcationHistory" > Application History</td>
               </tr>      
               <tr align="center">
                 <td align="center"> <asp:Label runat="server"  ID="Label3" Text="Application No" ToolTip="Customer" CssClass = "label"  /> </td>
                 <td align="center"> <asp:Label runat="server" ID="Label1" Text="From Date" ToolTip="FromDate" CssClass = "label"   /> </td>
                 <td align="center"> <asp:Label runat="server" ID="Label2" Text="To Date" ToolTip="ToDate"  CssClass = "label" /> </td>
                </tr>
                <tr>
                <td>
                  <rad:RadComboBox ID="radddlcust" runat="server"  Width="200px" Skin="Vista" Height="250px"
                    SkinsPath="~/RadControls/ComboBox/Skins" 
                    AllowCustomText="true"  
                    MarkFirstMatch="true"     
                    ToolTip="Select Application Name"                         
                    AutoPostBack="true"
                    OnClientSelectedIndexChanged = "ValidateCombobox"
                    OnItemsRequested="radddlcust_ItemsRequested" 
                    OnSelectedIndexChanged="radddlcust_OnSelectedIndexChanged"   >
                    <Items>
                     <rad:RadComboBoxItem Text="- Select -" Value=""  />
                    </Items>
                   </rad:RadComboBox>      
                 </td>        
                 <td>
                   <asp:TextBox runat="server" ID="txtfromdate" CssClass="textbox"  OnChange= "Validate()" 
                   OnTextChanged="txtfromdate_OnTextChanged" ToolTip="Select date" AutoPostBack="true"  />
                   <ajax:CalendarExtender runat="server"  ID="CalendarExtender1"
                    Animated = "true" 
                    TargetControlID="txtfromdate"                  
                    Format="MM/dd/yyyy" 
                    PopupButtonID="imagefromdate"  /> 
                   <asp:ImageButton runat="server" id="imagefromdate" ImageUrl="~/images/calendar_blue.GIF"   ToolTip="select from date"  />
                   <ajax:TextBoxWatermarkExtender ID="txtwextfromdate1" runat="server" 
                    TargetControlID="txtfromdate"  BehaviorID="FromwatermarkID"
                    WatermarkText="- Select the date -"   />                           
                   </td>
                   <td
                   <asp:TextBox runat="server" ID="txttodate" CssClass="textbox" ToolTip="Select date" 
                    OnTextChanged="txttodate_OnTextChanged" AutoPostBack="true"  OnChange= "Validate()"  />
                   <ajax:CalendarExtender runat="server"  ID="CalendarExtender2" 
                     TargetControlID="txttodate" 
                     Animated = "true" 
                     Format="MM/dd/yyyy"  
                     PopupButtonID="imgtodate" PopupPosition="BottomRight" /> 
                   <asp:ImageButton runat="server" id="imgtodate" ImageUrl="~/images/calendar_blue.GIF"  ToolTip="select to date" />
                   <ajax:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" runat="server" 
                    TargetControlID="txttodate" WatermarkText="- Select the date -" />  
                  </td>   
                  <td>
                  <asp:Button runat="server" ID="btnviewresults" Text="Submit" ToolTip="ViewResults" 
                   OnClientClick = "return Validate()" CssClass="button" OnClick="btnviewresults_Click"  /> 
                  </td>
                  <td  align="right" style="width: 18px"
                  <asp:Button runat="server" ID="btncancel" Text="Cancel" ToolTip="Cancel selected values" CssClass="button"
                   OnClientClick = "return confirm('Are you sure that you wish to cancel all data?');"  OnClick="btncancel_Click"  />
                  </td>
                  <td  align="left" style="width: 0px"></td>
               </tr>
            </table
                       
           </asp:Panel
           </td>
           </tr>           
                 </table><br />                                                         </asp:Panel>
    <script type="text/javascript">
    var today = new Date();
    var dd = today.getDate();
    var mm = today.getMonth()+1;//January is 0!
    var yyyy = today.getFullYear();
    if(dd<10){dd='0'+dd;}
    if(mm<10){mm='0'+mm;}
    var todaydate = mm+'/'+dd+'/'+yyyy ;
    document.getElementById("<% =txttodate.ClientID %>").value = todaydate; 
    function Validate()
    {
        var FromDate = document.getElementById("<% =txtfromdate.ClientID %>").value; 
        var ToDate = document.getElementById("<% =txttodate.ClientID %>").value; 
        var ButtonResults = document.getElementById("<% =btnviewresults.ClientID %>");
        var ApplicationNo = <%=radddlcust.ClientID%>;
        var ApplicationNoValue = document.getElementById(ApplicationNo.InputID).value;
         
        if(ToDate > todaydate)
        {
        alert(" ToDate can not be greater than Today Date '" + todaydate + "'" ); 
        document.getElementById("<% =txttodate.ClientID %>").value = todaydate;        
        return false;
        }
        if(FromDate != "" && ToDate != "")
        {
            if(FromDate > ToDate)
            {
             alert("Please select valid Date. FromDate can not be less than ToDate.");
             $find("FromwatermarkID").set_Text("- Select the date -");
             return false;
            }
        }
        if((FromDate == "- Select the date -") && (ApplicationNoValue == "- Select/Type Application Name -") )
        {
            alert("Please select Application No/From Date.");
            return false;
        }
        if((FromDate != "- Select the date -") && (ApplicationNoValue != "- Select/Type Application Name -"))
        {
             ApplicationNo.Items[0].Select();
             document.getElementById("<% =txtfromdate.ClientID %>").value = FromDate;
             return false;          
        }
        if ((ToDate != todaydate) && (ApplicationNoValue != "- Select/Type Application Name -"))
        {
            ApplicationNo.Items[0].Select();
            document.getElementById("<% =txttodate.ClientID %>").value = ToDate;
            return false;
        }
          
        return true;
    }
 function ValidateCombobox(item)
    {
        var FromDate = document.getElementById("<% =txtfromdate.ClientID %>").value; 
        var ToDate = document.getElementById("<% =txttodate.ClientID %>").value; 
        var ApplicationNo = <%=radddlcust.ClientID%>;
        var ApplicationNoValue = document.getElementById(ApplicationNo.InputID).value;
         var ButtonResults = document.getElementById("<% =btnviewresults.ClientID %>");
        var item = ApplicationNo.Items[0].Text;
        //alert(todaydate);
        ButtonResults.disabled = false;
       // alert(ToDate);
       if(ApplicationNoValue != item)
        {
            $find("FromwatermarkID").set_Text("- Select the date -");
            document.getElementById("<%=txttodate.ClientID%>").value =todaydate;
        }
    }
    function Navigate()
    {
         javascript:window.open("~/Modules/Search Summary.aspx");
    }  
    </script>          
   </div>
  </ContentTemplate>     
 </asp:UpdatePanel>    
        
   <asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="150" DynamicLayout="true" AssociatedUpdatePanelID="update1">
     <ProgressTemplate>
        <div style="background-color:white;filter:alpha(opacity=95);position:absolute;width:100%;height:100%;top:0;left:0;z-index:50000;">
            <div style="vertical-align:middle;text-align:center;cursor:wait;position:static;top:50%;left:50%;-moz-user-select: none;z-index:50001;">        
              <users:LoadingPanel ID="uLoadingPanel1" runat="server" Visible="true" /> 
            </div>
        </div>
     </ProgressTemplate>        
  </asp:UpdateProgress>
  
</asp:Content>

 

Maria Ilieva
Telerik team
 answered on 22 Dec 2010
1 answer
101 views
hi guys ,
I have radgrid and radpanelbar , i create some filter for radgrid in radpanel bar and I want when user click in filter type in panel bar grid filter by that . how can i do this ?
Tsvetina
Telerik team
 answered on 22 Dec 2010
1 answer
104 views
When I use the following RadGrid in an application designed for a Medium Trust environment, I get a Security Exception (missing Reflection permission). The exception trace is below. The version of the controls that I am using is 2009.3.1103.0. Any ideas why and how I can get around this ?

    <telerik:RadGrid ID="grdContacts" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
        AllowSorting="True" AutoGenerateColumns="False" GridLines="None">
        <MasterTableView>
            <Columns>
                <telerik:GridHyperLinkColumn Text="Edit" DataNavigateUrlFields="ID" UniqueName="Edit"
                    ItemStyle-CssClass="command-column" />
                <telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID" />
                <telerik:GridBoundColumn DataField="Status" HeaderText="Name" UniqueName="Status" />
                <telerik:GridBoundColumn DataField="Title" HeaderText="Guid" UniqueName="Title" />
                <telerik:GridBoundColumn DataField="Forename" HeaderText="Type" UniqueName="Forename" />
                <telerik:GridBoundColumn DataField="Surname" HeaderText="Surname" UniqueName="Surname" />
                <telerik:GridBoundColumn DataField="Company" HeaderText="Company" UniqueName="Company" />
                <telerik:GridBoundColumn DataField="Town" HeaderText="Town" UniqueName="Town" />
                <telerik:GridBoundColumn DataField="Postcode" HeaderText="Postcode" UniqueName="Postcode" />
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

[SecurityException: Request for the permission of type 'System.Security.Permissions.ReflectionPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Assembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed) +150
System.Security.CodeAccessSecurityEngine.ThrowSecurityException(Object assemblyOrString, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle rmh, SecurityAction action, Object demand, IPermission permThatFailed) +100
System.Security.CodeAccessSecurityEngine.CheckSetHelper(PermissionSet grants, PermissionSet refused, PermissionSet demands, RuntimeMethodHandle rmh, Object assemblyOrString, SecurityAction action, Boolean throwException) +283
System.Security.PermissionSetTriple.CheckSetDemand(PermissionSet demandSet, PermissionSet& alteredDemandset, RuntimeMethodHandle rmh) +69
System.Security.PermissionListSet.CheckSetDemand(PermissionSet pset, RuntimeMethodHandle rmh) +150
System.Security.PermissionListSet.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet) +30
System.Threading.CompressedStack.DemandFlagsOrGrantSet(Int32 flags, PermissionSet grantSet) +40
System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant, CompressedStack securityContext) +123
System.Security.CodeAccessSecurityEngine.ReflectionTargetDemandHelper(Int32 permission, PermissionSet targetGrant) +54
Iana Tsolova
Telerik team
 answered on 22 Dec 2010
3 answers
129 views
Hi
i use to Telerik trial version 2010.3.1109.35
I want to sample is RadGrid in User Control and User Control in OutputCache ( <%@ OutputCache Duration="10" VaryByParam="none"%>)
RadGrid is create in the code behind
I am could not find this example in the Telerik Site or Forum :(
very important :(
please regards;
Thanks.
Radoslav
Telerik team
 answered on 22 Dec 2010
3 answers
103 views
Hello,

I have a RadGrid and I have two diffrent ascx files.
I want to dynamicly load one or the other when the user press the Editbutton is this possible?

I understand that I can set a ascx to load with the

EditFormSettings-UserControlName

But that will set only one ascx for my whole grid. When the user press the Editbutton I have to check that row/item and if a specific Colum has value "1" then I want to show one ascx if it has something else I want to show the other. I tried to catch the ItemDataBound event and change the

RadGrid1.MasterTableView.EditFormSettings.UserControlName

To something else but I guess that is to late and that the usercontrol has already been loaded at this point.
Can I in some way set every row/item to have a diffrent usercontrol open when edit is pressed, or is there another event that I can catch BEFORE the control gets loaded?

Thanks in advance.
Iana Tsolova
Telerik team
 answered on 22 Dec 2010
1 answer
61 views
I can't figure out why some pages require me to have a proxy manager control, while others are AJAXified automatically...

my scenario:

masterpage: <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"/>
page: (with 2 usercontrols, uc1 affects uc2)
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="uc1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="uc2" UpdatePanelRenderMode="Inline" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
uc1: has a radgrid - need an ajaxmanagerproxy on the page with the radgrid updating itself in order for the the page to update. All controls need to be included as an ajaxsetting to update.
uc2: all controls post back within the usercontrol, no ajaxmanagerproxy needed

Any ideas on what this can be or how I can figure out what's happening?

Thanks,
Reuven
Maria Ilieva
Telerik team
 answered on 22 Dec 2010
3 answers
115 views
I have a grid on a webpage that contains one or more locations.  Ive created a popup window that allows several locations to be selected at once and placed into a table.  How can I automatically refresh the grid when the popup window closes to reflect the new locations that were added.  I dont want a full page postback, just the location grid refreshed.

Ive used this code but it doesnt work

if (Request.Form["__EVENTTARGET"] != null)
            {
                if (Request.Form["__EVENTARGUMENT"] != null)
                {
                    ProcessRequest(Request.Form["__EVENTTARGET"].ToString(), Request.Form["__EVENTARGUMENT"].ToString());
                }
 
            }

private void ProcessRequest(string target, string argument)
        {
 
            if (!String.IsNullOrEmpty(target))
            {
                if (target == "ArtistNameClick")
                {
                    if (!String.IsNullOrEmpty(argument))
                    {
                        string[] arInfo = new string[2];
                        char[] splitter = { ' ' };
                        arInfo = argument.Split(splitter);
                        if (!String.IsNullOrEmpty(arInfo[0]))
                        {
                            switch (arInfo[0])
                            {
                                case "~ArtistName":
                                    GetArtistData(arInfo[1]);
                                    break;
                            }
                        }
                    }
                }
            }
 
            if (!String.IsNullOrEmpty(target) && !String.IsNullOrEmpty(argument))
            {
                if (argument == "Rebind")
                {
                    GetArtistData(this.HiddenUserID.Value);   
                }
                else if (argument == "RebindAndNavigate")
                {
                    
 
                    this.RadGridTravelZones.MasterTableView.SortExpressions.Clear();
                    this.RadGridTravelZones.MasterTableView.GroupByExpressions.Clear();
                    this.RadGridTravelZones.MasterTableView.CurrentPageIndex = this.RadGridTravelZones.MasterTableView.PageCount - 1;
                    this.RadGridTravelZones.Rebind();
                       
                     
                }
            }
            //}
        }

Radoslav
Telerik team
 answered on 22 Dec 2010
1 answer
57 views
Hi,

Currently I am adding two series on one chart. As per functionality, I am always showing 6 bars(last 6 months) on it. So there will be always 2 bars for one month becuase of 2 series.

Now due to some reason if there is no data in series 1 and data available for series 2. However, I am not able to show data on first bar even if I have series 2 data.
e.g: If I dont have data for month of december for series 1 and have series 2 data. Graph is not showing december's bar.

So please help me out to resolve this issue or let me know any other workarround.

Thanks,
Avinash
Giuseppe
Telerik team
 answered on 22 Dec 2010
1 answer
66 views
Ok - here's the setup:

I have an .ascx in which there are two radgrids (Telerik Q1 2010). The .ascx is placed within a RadAjaxPanel of the outside .aspx.
There is a RadAjaxManager in the .ascx.

Both radgrids are placed in separate asp:Panels. The first grid is used for search, and so its enclosing panel is mostly set to hidden.

The first grid is included as one of the second grids updated controls in the RadAjaxManager, but whenever the panel of the first grid is hidden, the paging of the second grid doesn't work! The grid fades out, but returns to the same page. If the panel of the first grid is visible, then everything works as it should.

What's going on?
Tsvetoslav
Telerik team
 answered on 22 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?