Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
171 views
I have a RadDateTimePicker and by default it shows "12:00AM". So I can not pick 12:00AM and have to pick other time to fire the event.

Check it in this example http://demos.telerik.com/aspnet-ajax/calendar/examples/datetimepicker/clientsideevents/defaultcs.aspx

How can I pick 12:00AM and fire the event ?
Smiely
Top achievements
Rank 1
 answered on 22 Dec 2010
2 answers
152 views
I have a date column and have a From dateTime To dateTime filter on that. I got that working but now it doesn't work with another column filters. If I select another filter for a specific dateTime rage, the dateTime selection is gone and dates are displayed as per the another filter.
Please help...

<FilterTemplate>
                        From
 <telerik:RadDateTimePicker ID="FromOrderDatePicker" runat="server" Width="185px"
 MinDate="01-01-2010" MaxDate="12-31-2010" FocusedDate="12-15-2010" DbSelectedDate='<%# startDate1 %>'>
<TimeView ID="TimeView1" OnClientTimeSelected="DateSelected" runat="server">
 </TimeView>
 </telerik:RadDateTimePicker>
                        to
 <telerik:RadDateTimePicker ID="ToOrderDatePicker" runat="server" Width="185px" MinDate="01-01-2010"
MaxDate="12-31-2010" FocusedDate="12-15-2010" DbSelectedDate='<%# endDate1 %>'>
 <TimeView ID="TimeView2" OnClientTimeSelected="DateSelected" runat="server">
 </TimeView>
 </telerik:RadDateTimePicker>
 <telerik:RadScriptBlock ID="RadScriptBlock111" runat="server">
  
  <script type="text/javascript">
 function DateSelected(sender, args) {
     var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
     tableView.filter("DateCreated", "", "Between");
                                }
                                  
   </script> </telerik:RadScriptBlock>
  </FilterTemplate>

And Code behind is...

protected void taskGrid_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == RadGrid.FilterCommandName)
            {
                Pair filterPair = (Pair)e.CommandArgument;
  
                switch (filterPair.Second.ToString())
                {
          case "DateCreated":
e.Canceled = true;
this.startDate1 = ((e.Item as GridFilteringItem)[filterPair.Second.ToString()].FindControl("FromOrderDatePicker") as RadDateTimePicker).SelectedDate;
                          
this.endDate1 = ((e.Item as GridFilteringItem)[filterPair.Second.ToString()].FindControl("ToOrderDatePicker") as RadDateTimePicker).SelectedDate;
                          
taskGrid.MasterTableView.FilterExpression = "('" + startDate1.Value.ToString("MM/dd/yyyy HH:mm:ss") + "' <= [DateCreated] AND [DateCreated] <= '" + endDate1.Value.ToString("MM/dd/yyyy HH:mm:ss") + "')";
taskGrid.MasterTableView.Rebind();
                break;
                    default:
                        break;
                }
            }
Tsvetina
Telerik team
 answered on 22 Dec 2010
1 answer
209 views
hi,
I am using RadAjaxManager Q1 2009 version. If i use Ajaxcontrol toolkit control I am getting javascript error with RadAjaxManager. i copied error below. when i remove RadAjaxManager i am not seeing any errors. why?

when i use RadAjaxManager i shouldn't use Ajaxcontrol toolkit controls..?? can anyone suggests..

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: Mon, 20 Dec 2010 15:02:35 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

<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="radddlcust">
         <UpdatedControls>
           <rad:AjaxUpdatedControl ControlID = "radddlcust"  />      
            <rad:AjaxUpdatedControl ControlID = "txtfromdate"  />       
         </UpdatedControls>              
        </rad:AjaxSetting>
       </AjaxSettings>
      </rad:RadAjaxManager>
<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> 
            <div>
                <ajax:FilteredTextBoxExtender ID="ftxtextFromDate" runat="server"
                TargetControlID="txtfromdate" FilterType="custom"
                ValidChars="acdelSht0123456789//- " ></ajax:FilteredTextBoxExtender>
                <ajax:FilteredTextBoxExtender ID="ftxtextToDate" runat="server"
                TargetControlID="txttodate" FilterType="custom"
                ValidChars="acdelSht0123456789//- " ></ajax:FilteredTextBoxExtender>
                <asp:RangeValidator  ID="RangeValidator1"  runat="server"
                ControlToValidate="txtfromdate"
                Type="Date" Display="Dynamic" />
                <asp:RangeValidator  ID="RangeValidator2"  runat="server"
                ControlToValidate="txttodate"
                Type="Date" Display="Dynamic" />
              </div>             
           </asp:Panel> 
           </td>
           </tr>

 

Tsvetina
Telerik team
 answered on 22 Dec 2010
1 answer
172 views
onbeforepaste does not seem to work when attatched (client side) at the OnClientLoad_RadEditor event.  If I change 'onbeforepaste' to 'onclick' it works. My goal is to eventually prevent when certain conditions exist.

function OnBeforePaste_Editor(e){
    debugger;
    alert("paste attempted");
    e.returnValue=false; /* disable pasting to test*/
}
function OnClientLoad_RadEditor(editor, args) {
    editor.attachEventHandler("onbeforepaste", OnBeforePaste_Editor);
    ...
}

Relevant links
onbeforepaste event
all dhmtl events
radeditor example on attatching onkeypress event


Thanks in advance,

John
Dobromir
Telerik team
 answered on 22 Dec 2010
2 answers
314 views
Hi,
 We are using RADCalendar Control AJAX (Dot Net FW 2.0) in one of the page. In the very first time its loaded successfully.  But the problem is after loaded this page "Session_End" event fired automatically in the "Global.asax". So we are facing problem to get the pre-defined session values in the post back events(button click event).

So guide me and resolve our propblem.

Thank you.
Maria Ilieva
Telerik team
 answered on 22 Dec 2010
3 answers
228 views
Hi,

I have a multiple row grid, where I want its initial state to be all inline editable.  The user can then immediately start entering the details into the fields.

When the user saves the grid, all fields are saved, and any field that has been provided with valid data, becomes a plain text link (which will link to something else on click) - IE its no longer an editable field but a plain text link.

Therefore I start with a fully inline editable grid, which becomes a mixture of inline editable and plain text fields, depending on what has been entered.

Could you advise how this could be acomplished with telerik grids as I can't see anything like this in a demo.

Thanks
Iana Tsolova
Telerik team
 answered on 22 Dec 2010
2 answers
80 views
Hi all,
I've a radgrid with scrolling enabled, and I should drag a row to a radtreeview. Everything works fine except dragging to a node located south-west (or south) of the grid. In this case, drag and drop works well, but during dragging radgrid starts scrolling until I drop the row.
Any ideas to solve this?
Thanks
Keiichi-kun
Top achievements
Rank 1
 answered on 22 Dec 2010
1 answer
721 views
Is there a way to show and hide the ajax loading panel on a page from the client side?

Thanks
Iana Tsolova
Telerik team
 answered on 22 Dec 2010
1 answer
177 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
89 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?