Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
127 views
Hi,

I found some samples about RadFilterDropDownEditor like:
public class RadFilterDropDownEditor : RadFilterDataFieldEditor
{
    protected override void CopySettings(RadFilterDataFieldEditor baseEditor)
    {
        base.CopySettings(baseEditor);
        var editor = baseEditor as RadFilterDropDownEditor;
        if (editor != null)
        {
            DataSourceID = editor.DataSourceID;
            DataTextField = editor.DataTextField;
            DataValueField = editor.DataValueField;
        }
    }
 
    public override System.Collections.ArrayList ExtractValues()
    {
        ArrayList list = new ArrayList();
        list.Add(_combo.SelectedValue);
        return list;
    }
 
    public override void InitializeEditor(System.Web.UI.Control container)
    {
        _combo = new RadComboBox();
 
        _combo.DataTextField = DataTextField;
        _combo.DataValueField = DataValueField;
        _combo.DataSourceID = DataSourceID;
 
        container.Controls.Add(_combo);
    }
 
 
    public override void SetEditorValues(System.Collections.ArrayList values)
    {
        if (values != null && values.Count > 0)
        {
            if (values[0] == null)
                return;
            var item = _combo.FindItemByValue(values[0].ToString());
            if (item != null)
                item.Selected = true;
        }
    }
 
    public string DataTextField
    {
        get
        {
            return (string)ViewState["DataTextField"] ?? string.Empty;
        }
        set
        {
            ViewState["DataTextField"] = value;
        }
    }
    public string DataValueField
    {
        get
        {
            return (string)ViewState["DataValueField"] ?? string.Empty;
        }
        set
        {
            ViewState["DataValueField"] = value;
        }
    }
    public string DataSourceID
    {
        get
        {
            return (string)ViewState["DataSourceID"] ?? string.Empty;
        }
        set
        {
            ViewState["DataSourceID"] = value;
        }
    }
    private RadComboBox _combo;
}

But I faced 2 problems.
1-When I try to set its DataType to System.Int32, I receive "Input string was not in a correct format." error. But when I set it to System.String it works. (the result is = '1' -within single quotas- as expected as it is set to be string). I have checked DataTextField and DataValueField properties and they are referencing to proper fields and datatypes.

2-When I set its value from combobox and add another condition/expression it looses it value and select first value of the combobox.

Any thoughts?

Thanks in advance.
Raji
Top achievements
Rank 1
 answered on 21 Jul 2011
0 answers
98 views
Hi:

I am getting:
  Microsoft JScript runtime error: 'onLoadAmount' is undefined
error. 
<telerik:RadNumericTextBox ID="overAmountTextBox" Runat="server" MaxLength="13"
    MaxValue="999999.999999" MinValue="-999999.999999" Text='<%# Bind("overAmount") %>'
    TabIndex="7">
    <ClientEvents OnLoad="onLoadAmount" />
    <FocusedStyle HorizontalAlign="Right" />
    <EnabledStyle HorizontalAlign="Right" />
    <NumberFormat DecimalDigits="4" />
</telerik:RadNumericTextBox>
 
<script type="text/javascript">
    //<![CDATA[
    //
    function onLoadAmount(sender, args) {
        alert('Amount');
    }
    //]]>
</script>
The RadNumericTextBox is in a FormView control, when I get the error.  If I extract the code and place it on a simple page it finds the on load event.

Phil
Phil
Top achievements
Rank 2
 asked on 21 Jul 2011
9 answers
89 views

Hi,

Is there a way to detect a double-click on the title icon on the left side? Our users are expecting to close the window by double clicking on it as they would do in a Windows application.

 Thanks.

LeBear
Top achievements
Rank 1
 answered on 21 Jul 2011
3 answers
312 views
Dear,
I create header template and footer template(contain table inside)
Then I set AllowScroll = true
If I set UseStaticHeader = false .All Column align ok
But if I set UseStaticHeader = true.It align wrong .Width of Item larger width if header.
Problem just occur when I set UseStaticHeader =true .
Because All width of columns sum is very large.I must be use scroll and Use Static Header
This problem just in IE. FireFox work well
Please give me a solution.Thanks
Regard,
Lam
Support
Top achievements
Rank 1
 answered on 21 Jul 2011
1 answer
89 views
Hello,
Thanks in advance for replying.
I am using a radgrid and I use a GridClientSelectColumn in it. Now, I want user to click on the check box of this column to select the rows and clicking on any other part of the row should not make him select that row. Can this be done?

Why I am asking this is, when the user clicks on any other part of the row, only that row gets selected and all the previously selected rows get de-selected. I want to prevent this. Please let me know.

regards
Yash
Yash
Top achievements
Rank 1
 answered on 21 Jul 2011
2 answers
53 views
Hi,

I have a dock with an update panel inside of it. This update panel contains an ASP.NET Microsoft Chart Control. The Chart Control has a Click event handler. I would like to execute code from the dock level after the Chart's Click event handler has finished.

Currently, I have a 'brute force' method of iterating through all docks on the page in Save Dock Layout and ensuring the state that I want. I would prefer to handle it on a dock-by-dock basis during this parent event handler.

Is this possible?

Thanks

Sean
Sean
Top achievements
Rank 2
 answered on 21 Jul 2011
2 answers
212 views
Hi Telerik,

Is it possible to have a RadDock class which implements IPostBackEventHandler's RaisePostBackEvent method and also utilize the cleanliness of RadDock_Command?

Currently, I have this setup:

/// <summary>
/// Parses custom/default commands of RadDock.
/// </summary>
public void RadDock_Command(object sender, DockCommandEventArgs e)
{
    Logger.InfoFormat("Command {0} detected for {1} ", e.Command.Name, ID);
 
    switch (e.Command.Name)
    {
        case "Close":
            Close();
            break;
        case "Refresh":
            RefreshContent(ForceCacheRefresh.True);
            break;
        case "Toggle Legend":
            ToggleLegend();
            break;
        case "Undo Drill Down":
            UndoDrillDown();
            break;
        default:
            Logger.ErrorFormat("Unhandled command name: {0}", e.Command.Name);
            break;
    }
}

public void RaisePostBackEvent(string eventArgument)
{
 
    HandleDialogClose(eventArgument);
}
 
private void HandleDialogClose(string json)
{
    if (json.Contains("HistoricalLocalSettingsJSON"))
    {
        UpdateSettings(JsonConvert.DeserializeObject<HistoricalLocalSettingsJSON>(json));
    }
    else if (json.Contains("CustomLocalSettingsJSON"))
    {
        UpdateSettings(JsonConvert.DeserializeObject<CustomLocalSettingsJSON>(json));
    }
    else
    {
        Logger.ErrorFormat("Unable to handle JSON: {0}", json);
    }
}

My RadDock has a custom command which opens a dialog window. This window visualizes some of the RadDock's settings. After closing, those changes must be persisted and reflected on the RadDock.

I noticed, however, that after implemented IPostBackEventHandler, that RadDock's commands are getting eaten by this RaisePostBackEvent instead of filtering into RadDock_Command.

Is it possible to achieve this?
Sean
Top achievements
Rank 2
 answered on 21 Jul 2011
2 answers
47 views
HELP, this is driving me mad!

I am setting security for controls on an asp.net page from the names in a database. This has worked for eveything so far.....

For example for Radcontextmenus I use :

Dim currentitem As Telerik.Web.UI.RadContextMenu = thisform.FindControl(reader("objectname"))
currentitem.Items(reader("objectindex")).Enabled = reader("permissionvalue")
currentitem.Items(reader("objectindex")).Visible = reader("visiblevalue")

For each element in a Context menu.

However, whenever I reference a RadSchedulerContextMenu the object can never be found. Despite being able to reference it directly through vb.net.

I have :
Dim currentitem As Telerik.Web.UI.RadSchedulerContextMenu = thisform.FindControl(reader("objectname"))
currentitem.Items(reader("objectindex")).Enabled = reader("permissionvalue")
currentitem.Items(reader("objectindex")).Visible = reader("visiblevalue")

The same but it doesn't find the object. Whereas if I specifically use the objectname in vb eg. radschedulercontextmenu1.items(0).enabled = false it works.

Why does the radschedulercontextmenu differ from the radcontextmenu and how should I reference it correctly? Do I need to do so from the radscheduler container?

Any help much appreciated. Its been a long long day :)

Toxic
Top achievements
Rank 1
 answered on 21 Jul 2011
1 answer
113 views
Greetings,

I have an .aspx page that is loaded inside a radwindow. The content for the page is dynamic and of variable height.

In the Page_Load event, I want to detect if the vertical scrollbars for the window are visible, and if they appear, I want to restyle another div on the page. How do I detect if the scrollbars are visible in C# code-behind?


Thanks
Kevin
Top achievements
Rank 2
 answered on 21 Jul 2011
1 answer
83 views
The iframe module appears to have issues when you try to delete a file input at a given index through script (rather than having the user click on the 'x' button).

Scenario #1 (size validation):
-----------------------------------------
1) subscribe to OnClientValidationFailed client event (implementation below)
        a)  alert("The file you have chosen is too large or is of a type that is not allowed.");
             sender.deleteFileInputAt(sender.getUploadedFiles().length);
             sender.updateClientState(); // (optional?)
2) user selects file that is 'too large'
3) event fires and works as expected...we get the alert message and the desired input disappears
4) user selects same or other file that is 'too large'
5) event fires, but does not work as expected this time
    a) The desired input disappears, but now the select button won't bring up the file chooser and the select button's hover effect is lost.

Scenario #2 (duplicate file validation):
-------------------------------------------------
1) subscribe to OnClientFileSelected client event (implementation below)
         a) this.isDuplicateFile = this.IsDuplicateFile(args.get_fileName()); // do we already have this file?
2) subscribe to OnClientFileUploaded client event (implementation below)
         a) if (this.isDuplicateFile) {
                 this.ShowDuplicateFileMessage();
                 sender.deleteFileInputAt(sender.getUploadedFiles().length - 1);
                 sender.updateClientState(); // (optional?)
                 this.isDuplicateFile = false;
             }
3) user selects file 'a'...everything works as expected...file added to list successfully
4) user selects file 'a'...everything works as expected...we get the duplicate warning message and duplicate is removed from list
5) user selects file 'a'....doesn't work as expected...duplicate is removed from list ok, but 'select' button no longer brings up file chooser and select button has lost its hover effect.

* Both of these scenarios work if I use the Silverlight module and the same source code.
* I have tried unsuccessfully on IE 8 compat/non-compat modes and Firefox 5
* I am using the latest Telerik release 2011.1.519.40
* I have a pretty minimalistic sample if you would like to take a look at it. I don't know where/how to send it though.
Peter Filipov
Telerik team
 answered on 21 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?