Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
86 views
Hi,
I use the TimeView with a custom collection according to http://demos.telerik.com/aspnet-ajax/calendar/examples/datetimepicker/customcollection/defaultcs.aspx

The custom collection is needed because the user should be able to select the time 23:59. But this does not work in other timezones: when not in the same timezone as UTC time, the picker "results" in another time than the selected. For example, if I pick 23:59, the time in the textbox results in 21:59 for my timezone. Every other time is ok - for example if I pick 12:00, it picks the right one. It seems that the property UseClientTimeOffset does not work for this particular time 23:59?

 

public static void SetA4DValidTimeView(this RadTimeView timeView)
{
    ArrayList arrayList = new ArrayList();
    arrayList.Add(new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, DateTime.UtcNow.Day, 23, 59, 0));
    for (int hour = 1; hour < 24; hour++)
        arrayList.Add(DateTime.UtcNow.Date.AddHours(hour));
    timeView.DataList.DataSource = arrayList;
}

 

 

I created a class in order to use the UseClientTimeOffset property.

 

 

public class A4DRadTimeView: RadTimeView
   {
       public A4DRadTimeView()
       {
           this.SetA4DValidTimeView();
           base.UseClientTimeOffset = true;
       }
   }

Markup:
<MCN:A4DRadDateTimePicker runat="server" ID="dateTimePickerDepartureTime" Enabled="false"
    CssClass="labelregular" Calendar-CultureInfo="en-US" SharedTimeViewID="A4DSharedTimeView">
    <DateInput EmptyMessage="____-__-__ __:__">
        <ClientEvents OnValueChanged="inputValueChanged" />
    </DateInput>
                                     
</MCN:A4DRadDateTimePicker>
<MCN:A4DRadTimeView ID="A4DSharedTimeView" runat="server"></MCN:A4DRadTimeView>


Script:
function inputValueChanged(sender, args) {
    
    var newValue = args.get_newValue();
    var dateFormat = sender.get_dateFormat();
    var date = args.get_newDate();
    if (date != null) {
        if (newValue.indexOf(sender.get_dateFormatInfo().TimeSeparator) < 0 &&
                    date.getHours() == 0 &&
                        date.getMinutes() == 0 &&
                            date.getSeconds() == 0) {
            date.setHours(0);
            date.setMinutes(01);
              
            sender.set_value(date.format(dateFormat));
        }
    }
     
}


Lars Friede
Top achievements
Rank 1
 answered on 17 Aug 2012
1 answer
111 views
I have created a Grid with filtering using the RadGrid with the following markup

 

<telerik:RadGrid ID="RadGrid1" Width="99%" OnNeedDataSource="Grid_NeedDataSource"
                    AllowFilteringByColumn="True" AllowSorting="True" PageSize="20" ShowFooter="True"
                    AllowPaging="True" runat="server" AutoGenerateColumns="False" GridLines="None"
                    Skin="Office2007">
                    <GroupingSettings CaseSensitive="false" />
                    <MasterTableView ShowHeadersWhenNoRecords="true" AllowFilteringByColumn="True" ShowFooter="True"
                        DataKeyNames="OffenseTypeId" TableLayout="Fixed" ClientDataKeyNames="OffenseTypeId, StateCode, Description">
                        <Columns>
                            <telerik:GridClientSelectColumn HeaderStyle-Width="30px" />
                            <telerik:GridBoundColumn DataField="StateCode" HeaderText="VCC Code" AutoPostBackOnFilter="true"
                                CurrentFilterFunction="Contains" ShowFilterIcon="true" FilterControlWidth="70%">
                                <HeaderStyle Width="120px" />
                            </telerik:GridBoundColumn>
                            <custom:OffenseModifierFilteringColumn DataField="ModifierDescription" HeaderText="Offense Modifier"
                                AllowFiltering="true" FilterControlWidth="90%">
                                <HeaderStyle Width="200px" />
                                <ItemTemplate>
                                    <%# Eval("ModifierDescription")%>
                                </ItemTemplate>
                            </custom:OffenseModifierFilteringColumn>
                            <telerik:GridBoundColumn DataField="Description" HeaderText="Description" AutoPostBackOnFilter="true"
                                CurrentFilterFunction="Contains" ShowFilterIcon="true" FilterControlWidth="95%">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="OffenseStatute" HeaderText="Statute" AutoPostBackOnFilter="true"
                                CurrentFilterFunction="Contains" ShowFilterIcon="true" FilterControlWidth="70%">
                                <HeaderStyle Width="120px" />
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings>
                        <Selecting AllowRowSelect="true" />
                        <ClientEvents OnRowSelected="RowSelected" />
                    </ClientSettings>
                </telerik:RadGrid>

with the custom filtering column as such:

/// <summary>
/// Custom Filtering column for the SelectOffense
/// </summary>
public class OffenseModifierFilteringColumn : GridTemplateColumn
{
    /// <summary>
    /// Setups the filter controls.
    /// </summary>
    /// <param name="cell">The cell.</param>
    protected override void SetupFilterControls(TableCell cell)
    {
        var rcBox = new RadComboBox
                        {
                            ID = "DropDownList1",
                            AutoPostBack = true,
                            DataTextField = DataField,
                            DataValueField = DataField
                        };
        rcBox.SelectedIndexChanged += rcBox_SelectedIndexChanged;
        var table = GetDataTable();
        var row = table.NewRow();
        row[DataField] = "";
        table.Rows.InsertAt(row, 0);
        rcBox.DataSource = table;
        cell.Controls.Add(rcBox);
    }
    /// <summary>
    /// Sets the current filter value to control.
    /// </summary>
    /// <param name="cell">The cell.</param>
    protected override void SetCurrentFilterValueToControl(TableCell cell)
    {
        if (!(CurrentFilterValue == ""))
        {
            ((RadComboBox)cell.Controls[0]).Items.FindItemByText(CurrentFilterValue).Selected = true;
        }
    }
    /// <summary>
    /// Gets the current filter value from control.
    /// </summary>
    /// <param name="cell">The cell.</param>
    /// <returns></returns>
    protected override string GetCurrentFilterValueFromControl(TableCell cell)
    {
        var currentValue = ((RadComboBox)cell.Controls[0]).SelectedItem.Value;
        CurrentFilterFunction = (currentValue != "") ? GridKnownFunction.EqualTo : GridKnownFunction.NoFilter;
        return currentValue;
    }
    /// <summary>
    /// Handles the SelectedIndexChanged event of the rcBox control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs"/> instance containing the event data.</param>
    protected void rcBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        ((GridFilteringItem)(((RadComboBox)sender).Parent.Parent)).FireCommandEvent("Filter", new Pair());
    }
    /// <summary>
    /// Gets the filter data field.
    /// </summary>
    /// <returns></returns>
    protected override string GetFilterDataField()
    {
        return DataField;
    }
    #region Private Members
    /// <summary>
    /// Gets the data table.
    /// </summary>
    /// <returns></returns>
    public DataTable GetDataTable()
    {
        var offenseModifiers = BusinessProcessManagerFactory<IOffenseTypeManager>.Instance.Get().GetOffenseModifiers();
        // convert to datatable
        var myDataTable = SqlTableTypeHelper.CreateTableType(offenseModifiers.Select(x => x.ModifierDescription).ToList(), typeof(String), "ModifierDescription");
        return myDataTable;
    }
    #endregion
}

As per your example in Grid -> Filtering Template Columns. I am using Telerik version  2009.3.1208.35.

The page render's and the grid display full of data. I filter on every column except the custom column and the filtering works great. When I select a value from the drop down, the grid empties and no records are displayed.

Any idea's?

Thanks,
Luke
Milena
Telerik team
 answered on 17 Aug 2012
0 answers
94 views
I have a problem concerning asp:dropdownlist control did not postback with RadAjaxManager in .net framework 4.0. It works on .net framework 2.0 in MS Visual Basic .net 2010 and converting it to .net framework 4.0, asp:dropdownlist control didn't postback. Any idea on this?
Wilfredo
Top achievements
Rank 1
 asked on 17 Aug 2012
1 answer
90 views
Hi,

i have used telerik rad grid client-side programmatic binding. Binding is working fine but when we try to filter the data it is not accepting numeric values like for 28 it is taking as ( , 29 it is taking as ). So, what i understood is it is converting the numeric value to ASCII code.

how to solve this problem?

Thanks in advance. 
Antonio Stoilkov
Telerik team
 answered on 17 Aug 2012
1 answer
69 views
With the RadGrid, is it possible to change the look of the thing you're dragging when using Row dragging? Or does it have to be an exact copy of the row item?

Marin
Telerik team
 answered on 17 Aug 2012
1 answer
72 views
Hello. Thank you in advance for your help and advice.

Client is using Telerik RadEditor for ASP.NET AJAX with Microsoft Internet Explorer 8 web browser. A problem exists with the "Find And Replace" dialog box in this browser. You can reproduce problem on the current (17 August 2012) RadEditor demo page. Please try these steps.

1. Open RadEditor demo page using Internet Explorer 8
2. Click in RadEditor text area to set focus. Press Ctrl+F or click "binocular" icon to open "Find And Replace" dialog
3. Enter text in the "Find" input field. Text should actually exist in document. For example, enter "HTML" or "Microsoft"
4. Press Tab key to focus on "Find" button. Press Enter key to search

After you press Enter key. RadEditor will correctly locate and highlight the word in the document. But also the highlighted word is deleted and replaced with a linebreak character. It seems that the Enter keypress event is not terminated correctly. Similar problem exists when using Spacebar key to activate Find button. The search word is highlighted but then it is deleted and replaced with an empty space character.

This problem was not existing in a previous version of RadEditor. (It seems to be new problem in about last year.) Also it works OK in other browser like Mozilla Firefox. Please is there a way to make Enter key work in "Find And Replace" dialog box in Internet Explorer 8?

Thank you.
Rumen
Telerik team
 answered on 17 Aug 2012
3 answers
171 views
Hi Telerik team,
I have an issue with the Export to Excel-button. The button works fine until I perform an action on the radgrid (such as removing/adding columns, sorting or paging) - after that, the Export to Excel -button no longer has any effect.

My radgrid is ajaxified through a RadAjaxmanager. It does not reside in any kind of updatepanel. The grid is on a sharepoint page.

I've implemented the necessary disabling of ajax in the clickfunction of the button.
function onRequestStart(sender, args) {
    if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0) {
        args.set_enableAjax(false);
    }
}

So it seems like the button functionality is broken after an ajax request is made.
Any suggestions?

										
Daniel
Telerik team
 answered on 17 Aug 2012
1 answer
59 views
hi

i have implmented successfully the following demo

http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandcombo/defaultcs.aspx?product=grid


what i would like to do now is extend it to allow multi column filtering , is this at all possible ?

Peter

Tsvetina
Telerik team
 answered on 17 Aug 2012
1 answer
319 views
I have a RadGrid that has another RadGrid nested which also has another nested RadGrid. So there are 3 levels: Level 1 has information about a costumer, level 2 has information about customer´s purchases, and level 3 has info about products that the costumer has bought during the purchase. 

Now, I need to be able to select the level 2 row (purchase) and then access the data on all levels to construct a receipt of the purchase. I was able to add the checkbox column to level 2 by adding the GridClientSelectColumn to the column collection and enabling the client side row selection. So visually I have what I need. But my big problem now is: 

How do I access the data (contents of the cells) on all levels when I press a "print receipt for selected purchase" -button? I tried accessing it rought the RadGrid1.SelectedItems, but it was null. With just one RadGrid setup I could just use RadGrid1.SelectedItems[0].Cells, but that wont of course work with nested grids.

This might be a noob question, as I am very new to Telerik components. Any recommendations for "RadGrid for dummies" tutorials are welcome.

Thanks in advance! 
Marin
Telerik team
 answered on 17 Aug 2012
1 answer
69 views
I put a Filter control and Save button in one page and I also hide the Apply Button for Filter control. I don't find a way to get expression result after I click the Save button. Anybody know how to do?
Tsvetina
Telerik team
 answered on 17 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
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
Iron
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?