Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
142 views

Is there a way to access ItemsPerRequest parameter value on the client side?

Duško
Top achievements
Rank 1
 asked on 12 Jan 2018
0 answers
78 views

Hi Team,

I have RadGrid filter with timepicker. How to get value in timepicker with javascript.

My code

<asp:GridTemplateColumn UniqueName="ArrivalTime" DataField="ArrivalTime"
                                    HeaderText="Visit Date" HeaderStyle-Width="20%">
    <FilterTemplate>
                                        <asp:RadTimePicker RenderMode="Lightweight"
                                            ID="rdpArrivalTime" runat="server" Width="99%"
                                            ClientEvents-OnDateSelected="ArrivalTimeDateSelected"
                                            DbSelectedDate="<%# SetArrivalTime(Container) %>" />
                                        <asp:RadScriptBlock ID="rsbArrivalTime" runat="server">
                                            <script type="text/javascript">
                                                function ArrivalTimeDateSelected(sender, args) {
                                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                                    var date = FormatSelectedDate(sender);
                                                    tableView.filter("ArrivalTime", date, "EqualTo");
                                                }
                                                function FormatSelectedDate(picker) {
                                                    var date = picker.get_selectedDate();
                                                    var dateInput = picker.get_dateInput();
                                                    date.setHours(date.getHours() + 1);
                                                    date.setMinutes(date.getMinutes());
                                                    var formattedDate = dateInput.get_dateFormatInfo().FormatDate(date, dateInput.get_displayDateFormat());
                                                    return formattedDate;
                                                }
                                            </script>
                                        </asp:RadScriptBlock>
   </FilterTemplate>
   <ItemTemplate>
           <%# !Eval("ArrivalTime").Equals(DateTime.MinValue) ? string.Format("{0:hh:mm tt}",Eval("ArrivalTime")) : "" %>
   </ItemTemplate>
</asp:GridTemplateColumn>

Nhật
Top achievements
Rank 1
 asked on 12 Jan 2018
0 answers
66 views

<telerik:RadComboBox ID="ddlLocation" runat="server" DropDownHeight="100px" CheckedItemsTexts="DisplayAllInInput"  EnableCheckAllItemsCheckBox="true"
                                Localization-CheckAllString="All" Localization-AllItemsCheckedString="All"  onitemchecked="OnItemChecked"                                  OnCheckAllCheck="ddlLocation_CheckAllCheck" CheckBoxes="true"  EmptyMessage="--Select--" Height="200px" AutoPostBack="true"/>

I have a RadComboBox with the checkboxes active. I want to have a postback for the ItemChecked event.
The combobox also is generating a postback on closing of the dropdown which I do not want. How can I prevent this to happen.

                    

Namratha
Top achievements
Rank 1
 asked on 12 Jan 2018
0 answers
110 views

Hi,

First thanks for your great support.

Currently I want to fill RadDropDownList control with items from the client side.

I am able to add them, but I am not able to add a tool tip against them. Is it possible this to be achieved?

 

var radDropDown = $find("<%= ddlOptions.ClientID %>");
var item = new Telerik.Web.UI.DropDownListItem();
item.set_value("1");
item.set_text("Option 1");

//maybe in some way here I need to add a tooltip option

radDropDown .get_items().add(item);

 

Emo
Top achievements
Rank 1
 asked on 12 Jan 2018
0 answers
105 views

So I saw one of the old thread by Princy:

 

https://www.telerik.com/forums/find-control-within-itemtemplate-client-side

 

I tried that in my lightbox but it seems is not setting the value of the textbox in the itemtemplate of the lightbox, why ?

 

        function OpenLB() {
            var lightBox = $find('<%= LBoxEdit.ClientID %>');
            lightBox.show();
            var Text = lightBox.get_element().getElementsByClassName("rltbDescriptionBox");
            Text.LBoxEdit$txtDescripton.control.set_value("new value");
        }

 

 

            <telerik:RadLightBoxItem>
                <ItemTemplate>
                    <table style="padding: 20px; font-family: Arial">
                        <tr>
                            <td style="font-family: Arial, Helvetica, sans-serif; font-size: 18px; padding-bottom: 10px;">
                                Description
                            </td>
                        </tr>
                        <tr>
                            <td style="padding: 10px 0px 10px 20px">
                                <telerik:RadTextBox ID="txtDescripton" runat="server" CssClass="rltbDescriptionBox" Font-Size="16px" Width="400px" Height="30px">
                                </telerik:RadTextBox>
                            </td>
                        </tr>
                        <tr>
                            <td style="padding: 10px 0px 10px 20px">
                                <telerik:RadButton RenderMode="Lightweight" ID="btnFormSave" Height="30px"
                                    Text="Save" Font-Size="16px" Font-Bold="True" runat="server" Skin="Silk"></telerik:RadButton>
                            </td>
                        </tr>
                    </table>                    
                </ItemTemplate>
            </telerik:RadLightBoxItem>

Frank
Top achievements
Rank 1
 asked on 11 Jan 2018
3 answers
100 views
hi

I see this property controls whether or not you can drag and drop all fields.
I need to be able to set drag to false but only for certain fields -- it would also be nice if I could set certain field as column or row only.

Can the above be achieved?

Ta,
Dan
James
Top achievements
Rank 1
 answered on 11 Jan 2018
0 answers
85 views

So I have a a RadDatePicker declared thus: 

 

protected global::Telerik.Web.UI.RadDatePicker rdpEndDT;

 

And I am using it in code thus: 

 

                    rdpEndDT.SelectedDate = // some date;
                    rdpEndDT.MinDate = // some other date.;
                    rdpEndDT.MaxDate = // yet another date;

 

I have a stack trace error of the following form: 

 

Cause: ArgumentOutOfRangeException 
Cause Description: Value of '1/10/2018 12:00:00 AM' is not valid for 'SelectedDate'. 'SelectedDate' should be between 'MinDate' and 'MaxDate'. 
Parameter name: SelectedDate 
Cause Stack: 
at Telerik.Web.UI.RadDatePicker.set_SelectedDate(Nullable`1 value) 
at Telerik.Web.UI.RadDatePicker.set_MaxDate(DateTime value) 

 

What is this stack trace telling me? 

Is the complaint on this line: 

  rdpEndDT.MaxDate = // yet another date;

but if it is, given that I'm changing the max date, why should this exception be raised? At this point in the process max date is default of 2099; it is being set to a lower value in this code branch.  Why should max date refuse to permit itself to be changed?

Or is the complaint on this line: 

 

rdpEndDT.SelectedDate = some date

 

which would occur if I was trying to programmatically set a selected date later than the max date. But if this is so, why is set_MaxDate mentioned in the stack trace? 

 

Respectfully, 

 

Brian P. 

 


Brian
Top achievements
Rank 1
 asked on 11 Jan 2018
0 answers
34 views
Olá, estou desenvolvendo uma aplicação para agendar horários para consulta médica, preciso atualizar os horários livres e ocupados na tela sem dar reload na tela
Eduardo
Top achievements
Rank 1
 asked on 11 Jan 2018
0 answers
187 views

Due to our company policy, we had to update Telerik DLLs. 
We jumped directly from v2012.1.411.40 to v2017.3.913.40 on a huge old project. 

While testing that everything was more or less working, I noticed that RadComboBox control stopped to auto-adjust its height while is being filtered with custom text. 

I had an in-depth look at the .js code utilized by the combo in  v2012.1.411.40 in order to understand how it was working, and I noticed that the combo firstly is being filtered by the function 'RadComboBox.prototype.highlightAllMatches'  and then its height is manipulated based on how many items are displayed.  

Looking into the latest version js code, I noticed that while the procedure is more or less the same, the function highlightAllMatches will be applied asynchronously, as you can see in line 26 of the following code.

 

This causes that the function that adjusts height based on the items runs before of the filtering, resulting in a wrong height. 

 

To overcome this problem I've basically overridden the v2017 highlightAllMatches  with the v2012 one, and everything started working as intended.


Despite the workaround passed all tests,
I would know if there is a more elegant way to solve this problem.

01.var a = Telerik.Web.UI;
02.a.RadComboBox.prototype.highlightAllMatches = function(f) {
03.    if (this.get_filter() == a.RadComboBoxFilter.None) {
04.        return;
05.    }
06.    if (this.get_highlightedItem()) {
07.        this.get_highlightedItem().unHighlight();
08.    }
09.    var d = this.getLastWord(f, this._getTrimStartingSpaces());
10.    if (this._getLastSeparator(f) == f.charAt(f.length - 1)) {
11.        this._removeEmTagsFromAllItems();
12.        this.setAllItemsVisible(true);
13.        return;
14.    }
15.    var c = this.get_filter()
16.      , b = function(h, g, i) {
17.        var j = h.highlightText(g, i);
18.        h.set_visible(j);
19.    }
20.      , e = function() {
21.        if (this.get_markFirstMatch()) {
22.            this.highlightFirstVisibleEnabledItem();
23.        }
24.        this._resizeDropDown();
25.    };
26.    this._process(0, c, d, b, e);
27.}
28.;
I've provided some screenshot as an example, I hope that it will be clear. 
thank you

Lorenzo
Top achievements
Rank 1
 asked on 11 Jan 2018
5 answers
527 views
I'm working on multi-language web application where one of the languages is simplified chinese.  I'm using custom paging, which in turn means I have to handle custom filtering as well, which is major PITA.

ORM I'm using doesn't support LINQ.  So I came up with a plan to simply use contents of FilterExpression as part of the sql to retrieve data from database.

Problem is datetime format for simplified chinese looks like yyyyå¹´M月dæ—¥.  Say user selects 25 Jul 2013 in GridDateTimeColumn filter, then FilterExpression becomes ([LastUpdateDate] >= '2013å¹´7月25æ—¥ 0:00:00'), which sql server doesn't recognise at all.  I tried changing FilterDateFormat, but that defines how date is displayed in the filter.

Funny thing is default filtering works ok, but of course it doesn't work with custom paging.  Is there any way to customise datetime format in FilterExpression?
Pierre-Yves
Top achievements
Rank 1
 answered on 11 Jan 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?