Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
130 views
Please help. Thanks!
When I use <AdvancedEditTemplate> as below code, the  Recurrencerule in e.ModifiedAppointment.Recurrencerule always is old value in update block:

RadScheduler1_AppointmentUpdate(

 

object sender, AppointmentUpdateEventArgs e)
{

string Recurrencerule=e.ModifiedAppointment.RecurrenceRule

}


<AdvancedEditTemplate>

...... 

<telerik:RadSchedulerRecurrenceEditor ID="RecurrenceEditor1" runat="server">

 

</telerik:RadSchedulerRecurrenceEditor>
....

 

</AdvancedEditTemplate>

What should I modify?

Best regards!

Joyce
Top achievements
Rank 1
 answered on 06 Apr 2012
3 answers
103 views
Hi,

Today we had an interesting problem that I'm hoping you'll be able to help me fix.

One of our clients, using the Rad Editor (ASP.NET), clicked on the Document Manager and the listing displayed no files.

However the folder that was being accessed had 77 files.

Upon trying to find out why they weren't being displayed, I discovered that one of the file names had a non-printable character in it.

So, once I renamed the file the listing of files worked fine.

The question is:
How do I fix the filenames of files being uploaded so that files are not stored on our servers that may contain non-printable characters?
And
Even if they do contain non-printable characters, how do I get the Document Manager to display the folder of files anyway (with or without the offending file)?


Thanks,
Cameron
Cameron
Top achievements
Rank 1
 answered on 05 Apr 2012
1 answer
161 views
So using the RadControl, I think I managed to get it to filter the datetime correctly so it can only do Dates even when times are included in the data source.This is calling the OnItemCommand event for the control.
But, when I do a datasource and a bind(), no results are shown even though the data does exist in the datasource

The control does filtering based on AJAX Requests I believe so how can I follow this convention?
At the end of the day, The data in this scenario is being filtered on the server end and wish to rebind this.

or alternatively, can someone tell me how I can do the date filtering on clientside using the GridDateTimeColumn, so I can obtain the FilterType and the current selected date then finally do a filter?

Thanks
Pavlina
Telerik team
 answered on 05 Apr 2012
6 answers
176 views
I am attempting to apply a date range filter to a GridBoundColumn bound to a DateTime.

<telerik:GridBoundColumn DataField="Created"  FilterControlAltText="Filter Created column"
                    HeaderText="Created" SortExpression="Created" UniqueName="Created">
                     <FilterTemplate>
                     <telerik:RadDatePicker ID="ToCreatedDatePicker" runat="server" Width="85px"
                            MinDate="01-01-2012" DbSelectedDate='<%# EndCreatedDate %>'  ClientEvents-OnDateSelected="ToDateSelected"/>
                        to
                     <telerik:RadDatePicker ID="FromCreatedDatePicker" runat="server" Width="85px" 
                            MinDate="01-01-2000" DbSelectedDate='<%# StartCreatedDate %>' ClientEvents-OnDateSelected="FromDateSelected"/>
<telerik:RadScriptBlock ID="scriptFilterEventDate" runat="server">
                                    <script type="text/javascript">
                                        function FromDateSelected(sender, args) {
                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                            var ToPicker = $find('<%# ((GridItem)Container).FindControl("ToCreatedDatePicker").ClientID %>');
 
                                            var fromDate = FormatSelectedDate(sender);
                                            var toDate = FormatSelectedDate(ToPicker);
 
                                            if (toDate != '') {
                                                tableView.filter("Created", fromDate + " " + toDate, "Between");
                                            }
                                        }
 
                                        function ToDateSelected(sender, args) {
                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                            var FromPicker = $find('<%# ((GridItem)Container).FindControl("FromCreatedDatePicker").ClientID %>');
 
                                            var fromDate = FormatSelectedDate(FromPicker);
                                            var toDate = FormatSelectedDate(sender);
 
                                            if (fromDate != '') {
                                                tableView.filter("Created", fromDate + " " + toDate, "Between");
                                            }
                                        }
 
                                        function FormatSelectedDate(picker) {
                                            var date = picker.get_selectedDate();
                                            var dateInput = picker.get_dateInput();
                                            var formattedDate = dateInput.get_dateFormatInfo().FormatDate(date, dateInput.get_displayDateFormat());
 
                                            return formattedDate;
                                        }
                                    </script>
                                </telerik:RadScriptBlock>
                            </FilterTemplate>
                </telerik:GridBoundColumn>

When the filter is applied I receive the following error message from javascript console.

Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: String was not recognized as a valid DateTime.
Sys.WebForms.PageRequestManager._endPostBackTelerik.Web.UI.WebResource.axd:15
Sys.WebForms.PageRequestManager._parseDeltaTelerik.Web.UI.WebResource.axd:15
Sys.WebForms.PageRequestManager._onFormSubmitCompletedTelerik.Web.UI.WebResource.axd:15
(anonymous function)Telerik.Web.UI.WebResource.axd:6
(anonymous function)Telerik.Web.UI.WebResource.axd:6
Sys.Net.WebRequest.completedTelerik.Web.UI.WebResource.axd:6
_onReadyStateChange

The filter is not applied when this error is received

Any idea what I'm doing wrong here..

Ahmed Ilyas
Top achievements
Rank 1
 answered on 05 Apr 2012
4 answers
151 views
Hi.
Following some examples, I found this:

http://www.telerik.com/community/code-library/aspnet-ajax/general/filtering-range-with-raddatepicker-instances-in-a-custom-filtering-column.aspx

I am trying to filter a data source between 2 selected dates.

I am almost there with the implementation of the solution however the problem is, even when the dates are selected, the SelectedDate on the ItemCommand event is null (Nothing in VB.NET)

any ideas where I have gone wrong?

<telerik:GridTemplateColumn HeaderStyle-HorizontalAlign="Center" 
                        HeaderText="DateFilter" SortExpression="DateTime" UniqueName="DateFilter" 
                        AllowFiltering="true" ShowFilterIcon="true" AutoPostBackOnFilter="false" DataType="System.DateTime" 
                        DataField="DateTime" ItemStyle-HorizontalAlign="Left">
  
                        <HeaderStyle Width="90px"></HeaderStyle>
                        <ItemStyle HorizontalAlign="Left" Width="90px"></ItemStyle>
                          
                        <FilterTemplate>
                            <telerik:RadComboBox ID="ddlDateFilter" runat="server" DropDownWidth="200px">   
                                <Items>
                                    <telerik:RadComboBoxItem Text="" Selected="true" />
                                </Items>
                                <ItemTemplate>
                                  
                                    From <telerik:RadDatePicker ID="RadDatePickerFrom" runat="server" onclick="PreventDropDownClose(event);">
                                    </telerik:RadDatePicker>
                                    To <telerik:RadDatePicker ID="RadDatePickerTo" runat="server" onclick="PreventDropDownClose(event);">
                                    </telerik:RadDatePicker>                                    
                                    <asp:Button ID="cmdFilterDates" runat="server" Text="Filter" CommandName="FilterDates" />
                                </ItemTemplate>
                            </telerik:RadComboBox>
                        </FilterTemplate>
                          
                    </telerik:GridTemplateColumn>


Code:

Protected Sub grdShiftObservation_OnItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles grdShiftObservation.ItemCommand
  
        If String.Equals(e.CommandName, "filterdates", StringComparison.OrdinalIgnoreCase) Then
  
            Dim cell As TableCell = CType(e.Item, Telerik.Web.UI.GridFilteringItem)("DateFilter")
            Dim dateFilterComboBox As RadComboBox = CType(cell.Controls(0).FindControl("ddlDateFilter"), RadComboBox)
            Dim dateFrom As RadDatePicker = CType(dateFilterComboBox.SelectedItem.FindControl("RadDatePickerFrom"), RadDatePicker)
            Dim dateTo As RadDatePicker = CType(dateFilterComboBox.SelectedItem.FindControl("RadDatePickerTo"), RadDatePicker)
  
        End If
  
    End Sub


dateFrom and dateTo show "Nothing"

any ideas? I want to be able to obtain the dates the user has selected.
Pavlina
Telerik team
 answered on 05 Apr 2012
1 answer
86 views
Hi.
using RadControls I believe - how can I get the filter type chosen by the user on clientside, so I can do a filter based upon that.
We hit a problem with date filtering so if we do an Equals, it will not find the date since the time is not considered when performing the filtering.

Example:

telerik:GridDateTimeColumn FilterControlWidth="60px" AllowFiltering="true" AutoPostBackOnFilter="false"
                        CurrentFilterFunction="Contains" HeaderStyle-HorizontalAlign="Center" DataField="DateTime"
                        HeaderText="Date" SortExpression="DateTime" ShowFilterIcon="true" UniqueName="DateTime"
                        PickerType="DatePicker" DataFormatString="{0:g}" DataType="System.DateTime">
                         
                        <HeaderStyle Width="100px" HorizontalAlign="center"></HeaderStyle>
                        <ItemStyle HorizontalAlign="center" Width="100px"></ItemStyle>
                    </telerik:GridDateTimeColumn>


So we have the datetimes showing.
But at this point, how can I intercept the filtering on the clientside, so I can then also get the input they have entered to filter textbox/datepicker then append say "00:00:00" to that value, finally doing the filter.

how can I do this?
Pavlina
Telerik team
 answered on 05 Apr 2012
1 answer
142 views
Using RadControls I believe.
We have a DateTimePicker and need to do custom filtering on Date only.
I have implemented the code on the ItemCommand event and then I filter a dataset and then finally set the datasource to the grid and bind. I know there are results in there but the grid shows "no results"

any ideas?
<telerik:GridDateTimeColumn FilterControlWidth="60px" AllowFiltering="true" AutoPostBackOnFilter="false"
                        CurrentFilterFunction="Contains" HeaderStyle-HorizontalAlign="Center" DataField="DateTime"
                        HeaderText="Date" SortExpression="DateTime" ShowFilterIcon="true" UniqueName="DateTime"
                        PickerType="DatePicker" DataFormatString="{0:g}" DataType="System.DateTime">
                         
                        <HeaderStyle Width="100px" HorizontalAlign="center"></HeaderStyle>
                        <ItemStyle HorizontalAlign="center" Width="100px"></ItemStyle>
                         
                    </telerik:GridDateTimeColumn>


Code:

Protected Sub grdShiftObservation_OnItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles grdShiftObservation.ItemCommand
 
        If e.CommandName = RadGrid.FilterCommandName Then
 
            Dim filterPair As Pair = DirectCast(e.CommandArgument, Pair)
 
            Select Case filterPair.Second.ToString()
                Case "DateTime"
                    Dim filterOption As String = CType(e.CommandArgument, Pair).First
 
                    Dim filterItem As GridFilteringItem = CType(e.Item, GridFilteringItem)
                    Dim currentPattern As String = CType(filterItem(CType(e.CommandArgument, Pair).Second).Controls(0), RadDatePicker).SelectedDate
 
                    If Not String.IsNullOrEmpty(currentPattern) Then
                        Dim dt As DateTime = Convert.ToDateTime(currentPattern)
 
                        Dim dtFromString As String = dt.ToString("MM/dd/yyyy") & " 00:00:00" ' i.e the date they selected in the picker
                        Dim dtToString As String = dt.AddDays(1).ToString("MM/dd/yyyy") & " 00:00:00"
 
                        Dim filterPatternAssist As String = String.Empty
                        Dim dateColumn As GridBoundColumn = CType(e.Item.OwnerTableView.GetColumnSafe("DateTime"), GridBoundColumn)
 
                        Select Case filterOption
                            Case "EqualTo"
                                dtFromString = "DateTime >= #" & dtFromString & "# AND DateTime < #" & dtToString & "#"
                                dateColumn.CurrentFilterFunction = GridKnownFunction.EqualTo
                            Case "NotEqualTo"
                                dtFromString = "Not DateTime = #" & dtFromString & "#"
                                dateColumn.CurrentFilterFunction = GridKnownFunction.NotEqualTo
                            Case "GreaterThan"
                                dtFromString = "DateTime > #" & dtFromString & "#"
                                dateColumn.CurrentFilterFunction = GridKnownFunction.GreaterThan
                            Case "LessThan"
                                dtFromString = "DateTime < #" & dtFromString & "#"
                                dateColumn.CurrentFilterFunction = GridKnownFunction.LessThan
                            Case "GreaterThanOrEqualTo"
                                dtFromString = "DateTime >= #" & dtFromString & "#"
                                dateColumn.CurrentFilterFunction = GridKnownFunction.GreaterThanOrEqualTo
                            Case "LessThanOrEqualTo"
                                dtFromString = "DateTime <= #" & dtFromString & "#"
                                dateColumn.CurrentFilterFunction = GridKnownFunction.LessThanOrEqualTo
                            Case "Between"
                                dtFromString = "#" & dtFromString & "' <= DateTime AND DateTime <= #" & filterPatternAssist & "#"
                                dateColumn.CurrentFilterFunction = GridKnownFunction.Between
                            Case "NoFilter"
                                dtFromString = String.Empty
                                dateColumn.CurrentFilterFunction = GridKnownFunction.NoFilter
                            Case "NotBetween"
                                dtFromString = "DateTime <= #" & dtFromString & "' OR DateTime >= #" & filterPatternAssist & "#"
                                dateColumn.CurrentFilterFunction = GridKnownFunction.NotBetween
                            Case "IsNull"
                            Case "NotIsNull"
                            Case "Contains"
                                dtFromString = String.Empty
                                dateColumn.CurrentFilterFunction = GridKnownFunction.NoFilter
                        End Select
 
                        FilterGrid(dtFromString)
 
                    End If
            End Select
 
        End If
 
    End Sub
 
 
    Private Sub FilterGrid(ByVal strFilter As String)
        Dim ds As DataSet = GetData()
 
        Dim dvFilter As DataView = ds.Tables(0).DefaultView
        dvFilter.RowFilter = strFilter
 
        grdShiftObservation.DataSource = dvFilter.ToTable()
        grdShiftObservation.DataBind()
    End Sub


I know dvFilter.ToTable() at this point shows me say 5 rows filtered but when the grid is displayed, it shows no results.

what am I doing wrong? How else can I show the filtered results? I am trying to fix lack of support on the control which does not filter datetime values with date only specified hence the customisation above.
Pavlina
Telerik team
 answered on 05 Apr 2012
4 answers
193 views
I've implemented the solution described here already: http://www.telerik.com/help/aspnet-ajax/grid-resizing-in-splitter.html.

However there are a number of drawbacks.  Are there any other options for implementing a resizable RadGrid?
msigman
Top achievements
Rank 2
 answered on 05 Apr 2012
9 answers
288 views
Hi,
Is there a way to trap double click event on server-side event? I need to trap single click and double click to make a different action depending on what event is called.

Thank you!
Peter
Telerik team
 answered on 05 Apr 2012
11 answers
717 views
How do I prevent user from making duplicate entries in a given time slot? I am in timeline and resourceview.
Peter
Telerik team
 answered on 05 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?