Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
86 views
Hi everyone,

I have a "radtreeview" containing a contexmenu authorizing the user to create a new folder. I used th following example :
http://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/contextmenu/defaultcs.aspx 

When we click on the "create folder" item, the treeview allow us to edit it, I would like to save the name of this new node in my db. So I tried to put my methods of saving in the treeview event "OnNodeEdit", but it does not pass by this event.

My question is thus the following one: on what server side event may I introduce my saving?

Thx a lot.
David
Top achievements
Rank 1
 answered on 17 Aug 2012
1 answer
38 views
I need to supress few charecters while copying text from MS Word to RadEditor control such as ' (single quote)  and " (Double quotes). Below is the example.
 

Below employees are requested me at HR’s desk in

“Chris”

“Jhon”


This is different from the radEditior text

Below employees are requested me at HR's desk in

"Chris"

"Jhon"


is there any way to replace\supress this type of data as well ?
I have used reEditor.StripFormattingOptions = Telerik.Web.UI.EditorStripFormattingOptions.MSWordRemoveAll;
but not helped.
Rumen
Telerik team
 answered on 17 Aug 2012
1 answer
83 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
100 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
87 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
81 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
65 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
67 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
162 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
52 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?