Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
217 views
We have a page with search form, which uses 2 RadDatePicker components.

<div class="calendar date">
    <table>
        <tr>
            <td>
                <asp:Label runat="server" AssociatedControlID="DateFrom"><%=GetTranslatedText("LANG_WEB_MOBS_LASTMINUTE_DEPARTURE_DATE_LARGE")%></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <telerik:RadDatePicker ID="DateFrom" runat="server" Width="100px">
                    <ClientEvents OnDateSelected="OnDateFromSelected" />
                </telerik:RadDatePicker>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="WeekDayCheckIn" runat="server">Dienstag</asp:Label>
            </td>
        </tr>
    </table>
</div>
<div class="calendar duration">
    <table>
        <tr>
            <td>
                <asp:Label runat="server" AssociatedControlID="Duration"><%=GetTranslatedText("LANG_WEB_MOBS_LASTMINUTE_DURATION")%></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <asp:DropDownList runat="server" ID="Duration" onchange="SetReturnDate_CY('ctl00_ContentMainPlaceHolder_SearchForm_');GetDayOfWeek('ctl00_ContentMainPlaceHolder_SearchForm_');">
                                    <asp:ListItem Value="" Text="Bitte wählen"></asp:ListItem>
                                    <asp:ListItem Value="" disabled="disabled" Text="-------------"></asp:ListItem>
                                    <asp:ListItem Value=">=1 <=5" Text="1-5 Nächte"></asp:ListItem>
                                    <asp:ListItem style="font-weight: bold;" Value=">=6 <=8" Text="6-8 Nächte(1 Woche)"></asp:ListItem>
                                    <asp:ListItem Value=">=9 <=12" Text="9-12 Nächte"></asp:ListItem>
                                    <asp:ListItem style="font-weight: bold;" Value=">=13 <=15" Text="13-15 N. (2 Wochen)"></asp:ListItem>
                                    <asp:ListItem Value=">=16 <=19" Text="16-19 Nächte"></asp:ListItem>
                                    <asp:ListItem style="font-weight: bold;" Value=">=20 <=22" Text="20-22 N. (3 Wochen)"></asp:ListItem>
                                    <asp:ListItem Value="" disabled="disabled" Text="-------------"></asp:ListItem>
                                    <asp:ListItem Value=">=1 <=1" Text="1 Nacht"></asp:ListItem>
                                    <asp:ListItem Value=">=2 <=2" Text="2 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=3 <=3" Text="3 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=4 <=4" Text="4 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=5 <=5" Text="5 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=6 <=6" Text="6 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=7 <=7" Text="7 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=8 <=8" Text="8 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=9 <=9" Text="9 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=10 <=10" Text="10 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=11 <=11" Text="11 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=12 <=12" Text="12 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=13 <=13" Text="13 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=14 <=14" Text="14 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=15 <=15" Text="15 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=16 <=16" Text="16 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=17 <=17" Text="17 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=18 <=18" Text="18 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=19 <=19" Text="19 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=20 <=20" Text="20 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=21 <=21" Text="21 Nächte"></asp:ListItem>
                                    <asp:ListItem Value=">=22" Text=">21 Nächte"></asp:ListItem>
                                </asp:DropDownList>
            </td>
        </tr>
    </table>
</div>
<div class="calendar date">
    <table>
        <tr>
            <td>
                <asp:Label runat="server" AssociatedControlID="DateTo"><%=GetTranslatedText("LANG_WEB_MOBS_LASTMINUTE_RETURN_DATE_LARGE")%></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <telerik:RadDatePicker ID="DateTo" runat="server" Width="100px">
                    <ClientEvents OnDateSelected="OnDateToSelected" />
                </telerik:RadDatePicker>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label runat="server" ID="WeekDayCheckOut">Dienstag</asp:Label>
            </td>
        </tr>
    </table>
</div>

and a piece of javascript code :

function SetReturnDate_CY(prefix)
{
    if (document.getElementById(prefix+'Duration')) {
            dt = $find(prefix+'DateFrom').get_selectedDate();
            min_duration = MinDuration_CY(prefix);
            max_duration = MaxDuration_CY(prefix);
            var one_day = 1000 * 60 * 60 * 24;
            if ($find(prefix+'DateTo').get_selectedDate()) {
                dt2 = $find(prefix+'DateTo').get_selectedDate();
                //Calculate difference btw the two dates, and convert to days
                var diff = Math.ceil((dt2.getTime() - dt.getTime()) / one_day);
            }
            else {
                dt2 = dt;
                diff = 0;
            }
            calendar=$find(prefix+"DateTo");
            if(calendar)
            {
                if (diff < min_duration) {
                    dt2.setTime(dt.getTime() + (max_duration+7) * one_day);
                    calendar.set_selectedDate(dt2);
                }
                var min_return_date=dt;
                min_return_date.setTime(dt.getTime()+one_day);
                calendar.set_minDate(min_return_date);
            }
    }
// SetReturnDate


Default values are set by C# code directly. In general it works fine, but the problem is, that we get errors from calendar components like this - 



User Agent:        Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)


Error Message:  Input string was not in a correct format.


Error Source:        mscorlib
Error TargetSite:    Void StringToNumber(System.String, System.Globalization.NumberStyles, NumberBuffer ByRef, System.Globalization.NumberFormatInfo, Boolean)
Error Stack Trace:      at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at Telerik.Web.UI.Calendar.Utils.Utility.ConvertToServerDateTimeCollection(DateTimeCollection dateTimeCollection, String inputString)
   at Telerik.Web.UI.RadCalendar.LoadPostData(String postDataKey, NameValueCollection postCollection)
   at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


These errors come from unknown user and we have no clue, how to reproduce and how to fix it. We use the version RadControls for ASP.NET AJAX Q3 2011. Do you have any ideas, why this can happen?

Best regards,
Leonid
BabaYa
Top achievements
Rank 1
 answered on 08 May 2012
1 answer
60 views
How to get the index of selected text in editor control without using document and range object?
Rumen
Telerik team
 answered on 08 May 2012
1 answer
126 views

Hello,

I have a grid on page.
For database communication we are using wcf service.So I am getting a list of objects from service and binding it to a grid.
I want inplace editing of a grid(Add and update).It requires DataSource control.
Is it possible with wcf service?
Appreciate your help.

Thanks

Marin
Telerik team
 answered on 08 May 2012
3 answers
127 views
I've been trying to clear a bad date in Javascript
<telerik:RadDateInput id="del1" DateFormat="d" Width="82px" Height="18px" Font-Size="X-Small" Font-Names="Verdana" BorderWidth="1px" AllowEmpty="true" runat="server" >
    <ClientEvents OnKeyPress="del_keypress" />
    <ClientEvents OnError="date_input_error" />  
</telerik:RadDateInput>
the scripts
function del_keypress(sender, eventArgs) {
    var whichCode = eventArgs.get_keyCode();
    if ((whichCode != 13) && ((whichCode < 47) || (whichCode > 57)))
        eventArgs.set_cancel(true);
}
 
function date_input_error(sender, args) {
    alert("Invalid Delivery Date");
   // next line does nothing
    sender.clear();
    sender.focus();
}
Vasil
Telerik team
 answered on 08 May 2012
1 answer
91 views

i have rad chart with the following sql datasource

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Cnn_StatisticsSql %>"
 SelectCommand="SELECT COUNT(Title) AS Title_Count,
 Title AS Account_Type,
 LEFT(BankingDate, 7) AS Date
 FROM Extracted.Sepordeh_EftetahShodeh
 WHERE LEFT(BankingDate, 4) IN ( '1388' )
 GROUP BY Title , LEFT(BankingDate, 7) ORDER BY 3 "></asp:SqlDataSource>
<telerik:RadChart ID="RadChart1" runat="server" AutoLayout="True" AutoTextWrap="True"
IntelligentLabelsEnabled="True" Width="945px" Height="285px" Skin="DeepBlue"
DataGroupColumn="Account_Type" DataSourceID="SqlDataSource1">
<Appearance>
<FillStyle FillType="ComplexGradient">
<FillSettings>
<ComplexGradient>
<telerik:GradientElement Color="26, 120, 179" />
<telerik:GradientElement Color="35, 189, 254" Position="0.5" />
<telerik:GradientElement Color="26, 120, 179" Position="1" />
</ComplexGradient>
</FillSettings>
</FillStyle>
<Border Color="0, 66, 110" Width="5" />
</Appearance>
<Series>
</Series>
<Legend Visible="False">
<Appearance Dimensions-Margins="1px, 2%, 12%, 1px" Visible="False">
<ItemTextAppearance TextProperties-Color="White">
</ItemTextAppearance>
<FillStyle GammaCorrection="False" MainColor="37, 255, 255, 255">
</FillStyle>
<Border Color="76, 255, 255, 255" />
</Appearance>
<TextBlock>
<Appearance Position-AlignedPosition="Top" TextProperties-Color="LightSkyBlue">
</Appearance>
</TextBlock>
</Legend>
<PlotArea>
<DataTable>
<Appearance Position-Auto="False" Position-X="0" Position-Y="0">
</Appearance>
</DataTable>
<EmptySeriesMessage Visible="True">
<Appearance Visible="True">
</Appearance>
</EmptySeriesMessage>
<XAxis AutoScale="False" DataLabelsColumn="Date" MaxValue="7" MinValue="1"
Step="1">
<Appearance Color="98, 183, 226" MajorTick-Color="98, 183, 226">
<MajorGridLines Color="98, 183, 226" Width="0" />
<TextAppearance TextProperties-Color="White">
</TextAppearance>
</Appearance>
<AxisLabel>
 <Appearance Dimensions-Paddings="1px, 1px, 10%, 1px">
 </Appearance>
 <TextBlock>
 <Appearance TextProperties-Color="LightSkyBlue">
 </Appearance>
 </TextBlock>
 </AxisLabel>
 </XAxis>
 <YAxis>
 <Appearance Color="98, 183, 226" MajorTick-Color="98, 183, 226"
MinorTick-Color="98, 183, 226">
 <MajorGridLines Color="120, 209, 248" />
 <MinorGridLines Color="120, 209, 248" Width="0" />
 <TextAppearance TextProperties-Color="White">
 </TextAppearance>
 </Appearance>
 <AxisLabel>
 <TextBlock>
 <Appearance TextProperties-Color="LightSkyBlue">
 </Appearance>
 </TextBlock>
 </AxisLabel>
 </YAxis>
 <Appearance Dimensions-Margins="19%, 90px, 12%, 9%">
 <FillStyle MainColor="50, 255, 255, 255" SecondColor="Transparent">
 </FillStyle>
 <Border Color="97, 180, 223" />
 </Appearance>
 </PlotArea>
 <ChartTitle>
 <Appearance Dimensions-Margins="4%, 10px, 14px, 6%">
 <FillStyle MainColor="">
 </FillStyle>
 </Appearance>
 <TextBlock>
 <Appearance TextProperties-Color="White" TextProperties-Font="Verdana, 14pt">
 </Appearance>
 </TextBlock>
 </ChartTitle>
 </telerik:RadChart>


I have sorted the chart by date. the problem is when there is no data for a specific date the bar chart is not left empty but it is filled with the next available data that belongs to the following dates.

Petar Marchev
Telerik team
 answered on 08 May 2012
0 answers
74 views
Hi Team,
I have been facing this problem for last 10 days i tried to find all the solution but failed.
My page is working fine in Internet explorer and Mozilla browsers but getting hanged in chrome and safari browsers when I deployed my application on azure 
even there is no  error in bug tracker .it is working fine in my  local PC with all browsers .

please tell me solution .

thanks.
Rohit
Top achievements
Rank 1
 asked on 08 May 2012
3 answers
132 views
Hi, when I edit my record I have the radupload component, however when it does the postback I want to get the current value of the selected grid row as this contains the id to be used for the file name. Could you assist on how I can get this information sent back as I found the the RadAsyncUpload1_FileUploaded gets called before the command method. thanks P
TonyG
Top achievements
Rank 1
 answered on 08 May 2012
1 answer
96 views
Hi,
I am using Visual Studio 2010 and i had installed  new "RadControls for ASP.NET AJAX Q1 2012 SP1"
and using "Telerik.Web.UI" version 2012.1.411.40
I created a .net application and added RadScriptManager , RadAjaxManager and RadScheduler
after i closed my .net project and reopens  
I saw designer errors  :
Error Creating Control - RadScriptManager1
Request is not availabe in this context

same thing for RadAjaxManager1 and RadScheduler1


here is my code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="DepoView.WebForm1" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
      </telerik:RadScriptManager>
      <telerik:RadAjaxManager runat="Server" ID="RadAjaxManager1">
      </telerik:RadAjaxManager>
      <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
      <telerik:RadScheduler ID="RadScheduler1" runat="server">
      </telerik:RadScheduler>
    </div>
 </form>
</body>
</html>

Please find attached image
Venkata
Top achievements
Rank 1
 answered on 07 May 2012
1 answer
64 views
Hi,

I am currently working on a Media Library module for a CMS. Reading a folder in the file system I bind the results to a RadListView that has a PageSize of n (12 at the moment) in order to display its content: images.

DirectoryInfo di = new DirectoryInfo(MediaLibPath);
FileSystemInfo[] files = di.GetFiles();
var fileByUploadedDate = files.OrderByDescending(f => f.CreationTime);
ResourceLV.DataSource = files;
ResourceLV.DataBind();

In the RadDataPager I have a RadButton with the OnClick

ResourceLV.PageSize += 12;
ReloadResourceListView();

ReloadResourceListView() rebinds the ListView. Very similar to this sample:

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/customizingpager/defaultcs.aspx 


What I am trying to avoid is rebind every time as there could be hundreds of images in the folder being
read. Is it possible to have the PageSize increase sort of like google images search results.
What would your suggestion be? What about the PageSize from Grid, could that be emulated too?

Thanks






Tsvetina
Telerik team
 answered on 07 May 2012
1 answer
157 views
I have a Grid with AllowFilteringByColumn set to true. Each column in the grid has the filer textbox plus the drop down list of search options. The CurrentFilterFunction is set to 'Contains' and Autopostback is set to true. So users can enter a value and press enter which will do a 'contains' search on that column.
However there are two things that users keep trying to do that cause odd behaviour.
- They will enter a filter value in the FirstName column, then enter a value in the LastName column and press enter. Since enter is pressed while focus is on the LastName column, only that column is filtered and the FirstName filter disappears.
- The second scenario is that they will do a filter on FirstName and press enter, then after viewing the results will delete the filter on FirstName and then type a filter into LastName and press enter. When you do this the lastName filter is applied but the FirstName filter isn't checked so it reappears.
Is there a way to do multiple filters at once? I'm trying to handle the OnItemCommand event for the grid, then go through each column to see if there is a value in the textbox and then apply the filter manually there. However I'm stuck on how to generate the FilterExpression and how to check the which search option is selected (contains, startswith etc...)
Is this the correct direction or is there a better way to do this?
Tsvetina
Telerik team
 answered on 07 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?