Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
122 views
I've tried to implement my custom filter, as described in the following article:

http://www.telerik.com/help/aspnet-ajax/contentfilters.html

As a result, I got the following error:

"Telerik.Web.UI.Editor.Filter is null or not an object."

Could someone help please?

P.S. I've already added RadScriptManager and RadAjaxManager on my page.
Rumen
Telerik team
 answered on 30 Mar 2011
7 answers
317 views
Hi,

I am trying to set focus back on the radEditor after saving the contents.  Also setting the cursor to the end of the text.

I have the following scripts set up from looking at these forums.  The error I get 'Object doesn't support this property or method' on the setFocus() call.

            Telerik.Web.UI.Editor.CommandList["Save"] = function(commandName, editor, args) {
                var btnSave = $get("<%=btnDocumentSave.ClientID%>");
                btnSave.click();
                focusRadEditor();
            };

            function focusRadEditor() {
                var docEditor = document.getElementById('<%=Page.Master.FindControl("cphMain").FindControl("DocumentEditor1").FindControl("tbDocumentSource").ClientID%>');
                docEditor.setFocus();
                var contents = docEditor.get_document();
                contents.execCommand("SelectAll", null, false);
                //Collapse selection to the end
                docEditor.getSelection().collapse();
            }

Anyone know what I'm doing wrong?  I'm using Q3 2008 build, and IE6.

Rumen
Telerik team
 answered on 30 Mar 2011
5 answers
77 views
Hi,

We save the location of raddocks on our page with the following code:

void MainRadDockLayout_LoadDockLayout(object sender, DockLayoutEventArgs e)
{
...
e.Positions = serializer.Deserialize<Dictionary<string, string>>(positionsAndIndices[0].ToString());
e.Indices = serializer.Deserialize<Dictionary<string, int>>(positionsAndIndices[1].ToString());
...
}

Where positionsAndIndicies is a json string. This used to work until we upgraded to Q3 2010 and now we get an error:

Property or indexer 'Telerik.Web.UI.DockLayoutEventArgs.Positions' cannot be assigned to -- it is read only
Property or indexer 'Telerik.Web.UI.DockLayoutEventArgs.Indices' cannot be assigned to -- it is read only

Is there a better way to do this in the new release or should we just populate the positions and indices in a loop with e.Indices.Add(...)?

Thanks
Pero
Telerik team
 answered on 30 Mar 2011
3 answers
202 views
Hi

I am trying to add an ImageClickEventHandler onto an imagebutton.
Althought i cant get it to fire. I am doing this within the ItemDataBound event of the grid . I tried changing EnableViewState to false, but that made no difference.

Any ideas would be greatly appreciated

    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)    
    {  
        ImageButton imgBtnHolder = new ImageButton();  
 
       if (e.Item is GridDataItem)    
        {  
            switch (e.Item.OwnerTableView.Name)  
            {  
 
                case "Vis":  
                    {  
                        GridDataItem item = (GridDataItem)e.Item;  
 
                     
 
                        imgBtnHolder = ((ImageButton)item["colDelete"].FindControl("imgDelete"));  
                        imgBtnHolder.ImageUrl = "data_delete.gif";  
                        imgBtnHolder.AlternateText = "Delete";  
                        imgBtnHolder.OnClientClick = "return confirm('Are you sure you want to remove this');";  
                        imgBtnHolder.CommandName = "Delete";  
                        imgBtnHolder.CommandArgument = "cccc";  
                        imgBtnHolder.Click +=new ImageClickEventHandler(imgBtnHolder_Click);  
                          
                        break;  
                    }  
 
               
            }  
                         
        }    
    }  
 
    
    void imgBtnHolder_Click(object sender, ImageClickEventArgs e)  
    {  
        throw new NotImplementedException();  
    } 

Thanks

 

Princy
Top achievements
Rank 2
 answered on 30 Mar 2011
2 answers
77 views
Hi,
I have a custom provider that Ive created and its works fine with the default edit form. The issue that Im running into is that once I modify my RadScheduler to use an advanced edit form, none of the drop down controls (all of which are populated via resources in the custom provider) have the selected value in edit mode.
Ive tried adding binding expressions for each of the controls in the advanced edit and insert templates, but when I do that I get an error saying that that the Appointment object does not have a definition for a property.
To get around that I can add the CustomAttributes to the radScheduler definition but then the control does not save the data. Also, Im not working with attributes, they are resources.

Can telerik please provide some guidance on this? and please don't recommend that I read the Advanced Templates Demo. Ive read it a number of times and it has not helped.
Veronica
Telerik team
 answered on 30 Mar 2011
1 answer
74 views
I built a custom provider that has mutlivalues for field called attendees.  When I just run that as is (without changing the advanced template) the list of attendees shows up but there are no check-boxes to select from.  Do you know why?

Thanks.
Veronica
Telerik team
 answered on 30 Mar 2011
3 answers
278 views
Hi All,
    In our application we have a dynamically generated Bar Chart and to this bar chart we are creating ChartSeries and adding ChartSeries item and while adding the items to the series i am trying to register a click event for the ActiveRegion and the code is as below in bold but the event never gets fired.

ChartSeries

s0 = new ChartSeries();  

s0.Name =

 

string.Empty;  

 

for (int ic = 0; ic < dt.Rows.Count; ic++)  

 

ChartSeriesItem seriesItem = new ChartSeriesItem();  

seriesItem.YValue = (

 

double)dt.Rows[ic]["Quantity"];  

seriesItem.Name =

 

"Settlement";  

seriesItem.Appearance.Border.Color =

 

Color.Black;  

 

DateTime dt1 = Convert.ToDateTime(dt.Rows[ic]["Date"]);  

seriesItem.XValue = dt1.ToOADate();

seriesItem.ActiveRegion.Click +=

 

new RegionClickEventHandler(ActiveRegion_Click);  

seriesItem.ActiveRegion.Tooltip =

"Number of News:" + dt.Rows[ic]["Quantity"] + "";  

 

 

RadToolTipManager1.TargetControls.Add(

null, seriesItem.ActiveRegion.Tooltip.ToString(), true);  

 

 

s0.AddItem(seriesItem);

}

 

 

radchart1.Series.Add(s0); 
I even tried the below  way of registering the click event for the Active region at chart level but in vain.

 

radchart1.ChartTitle.ActiveRegion.Click +=

 

new RegionClickEventHandler(ActiveRegion_Click);

Please correct me if i am doing something wrong.

Regards,
Preetam.

 

 

Ves
Telerik team
 answered on 30 Mar 2011
1 answer
112 views
Hi All,

I am trying to remove this design-time created CheckBox at run-time, client-side. I am able to remove the control in Chrome and FireFox, but IE8 is putting up a fight and I do not know why. 

My Mark-Up:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LocalSettings.aspx.cs" Inherits="Cormant_Web_Dashboard.LocalSettings" %>
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<!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>
    <link href="~/Styles/LocalSettings.css" rel="Stylesheet" type="text/css" />
</head>
<body onload="AdjustRadWindowOnFirstLoad();">
    <form id="form1" runat="server">
 
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
    </telerik:RadStyleSheetManager>
 
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
    </telerik:RadScriptManager>
    <telerik:RadFormDecorator ID="RadFormDecorator1" Runat="server" DecoratedControls="All" Skin="Web20" />
 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
        UpdatePanelsRenderMode="Inline">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="CheckBox1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadNumericTextBox1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadComboBox1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Label1" />
                    <telerik:AjaxUpdatedControl ControlID="Label2" />
                    <telerik:AjaxUpdatedControl ControlID="CheckBox3" />
                    <telerik:AjaxUpdatedControl ControlID="RadDateTimePicker2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="CheckBox2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadDateTimePicker1" />
                    <telerik:AjaxUpdatedControl ControlID="RadDateTimePicker2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadButton1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadButton1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function CloseAndSave(args) {
                var oWindow = GetRadWindow();
                var resultArguments = new Array();
                resultArguments.push(document.getElementById('<%= CheckBox1.ClientID %>').checked);
                resultArguments.push($find("<%= RadNumericTextBox1.ClientID %>").get_value());
                resultArguments.push($find("<%= RadComboBox1.ClientID %>").get_value());
                resultArguments.push(document.getElementById('<%= CheckBox2.ClientID %>').checked);
                if (document.getElementById('CheckBox2').checked == true) {
                    var RadDateTimePicker1 = $find("<%= RadDateTimePicker1.ClientID %>");
                    if (resultArguments[2] == "LineChart") {
                        var RadDateTimePicker2 = $find("<%= RadDateTimePicker2.ClientID %>");
 
                        if (RadDateTimePicker1.isEmpty() || RadDateTimePicker2.isEmpty()) {
                            alert("Please provide values for both dates.");
                            return;
                        }
                        else {
                            var Date1 = RadDateTimePicker1.get_selectedDate();
                            var Date2 = RadDateTimePicker2.get_selectedDate();
 
                            if ((Date2 - Date1) < 0) {
                                alert("The second date should be past the first.");
                                return;
                            }
 
                            resultArguments.push(Date1.format("MM/dd/yyyy hh:mm:ss"));
                            resultArguments.push(Date2.format("MM/dd/yyyy hh:mm:ss"));
 
                        }
                    }
                    else if (resultArguments[2] == "PieChart") {
                        if (RadDateTimePicker1.isEmpty()) {
                            alert("Please enter a date.");
                            return;
                        }
                        resultArguments.push(RadDateTimePicker1.get_selectedDate().format("MM/dd/yyyy hh:mm:ss"));
                        resultArguments.push(null);
                    }
                }
                else {
                    resultArguments.push(null);
                    resultArguments.push(null);
                }
 
                if (document.getElementById('<%= CheckBox3.ClientID %>') != null) {
                    resultArguments.push(document.getElementById('<%= CheckBox3.ClientID %>').checked);
                }
                else {
                    resultArguments.push(null);
                }
 
                oWindow.close(resultArguments);
            }
 
            function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow;
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
                return oWindow;
            }
 
            var doPostback = true;
            function pageLoad() {
                var oWindow = GetRadWindow();
                properties = oWindow.argument;
 
                if (properties) {
                    if (properties["AutoRefreshEnabled"] == "True") {
                        document.getElementById('<%= CheckBox1.ClientID %>').checked = true;
                        $find("<%= RadNumericTextBox1.ClientID %>").set_value(properties["AutoRefreshInterval"]);
                        $find("<%= RadNumericTextBox1.ClientID %>").enable();
                    }
 
                    doPostback = false;
                    $find("<%= RadComboBox1.ClientID %>").findItemByValue(properties["ChartType"]).select();
                    doPostback = true;
 
                    if (properties["ChartType"] == "PieChart") {
                        document.getElementById('<%= CheckBox3.ClientID %>').style.display = 'none';
                        document.getElementById('<%= Label2.ClientID %>').style.display = 'none';
                        //document.getElementById('<%= CheckBox3.ClientID %>').style.visibility = 'hidden';
                        //document.getElementById('<%= Label2.ClientID %>').style.visibility = 'hidden';
                        $find("<%=RadDateTimePicker2.ClientID %>").set_visible(false);
                    }
 
 
                    if (properties["TimeRestrictionEnabled"] == "True") {
                        document.getElementById('<%= CheckBox2.ClientID %>').checked = true;
 
                        if (properties["ChartType"] == "LineChart") {
                            $find("<%= RadDateTimePicker1.ClientID %>").set_enabled(true);
                            $find("<%= RadDateTimePicker2.ClientID %>").set_enabled(true);
                            $find("<%= RadDateTimePicker1.ClientID %>").set_selectedDate(new Date(properties["TimeStart"]));
                            $find("<%= RadDateTimePicker2.ClientID %>").set_selectedDate(new Date(properties["TimeEnd"]));
                        }
                        else if (properties["ChartType"] == "PieChart") {
                            $find("<%= RadDateTimePicker1.ClientID %>").set_enabled(true);
                            $find("<%= RadDateTimePicker1.ClientID %>").set_selectedDate(new Date(properties["TimeStart"]));
                        }
                    }
 
                    if (properties["DataPointsEnabled"] == "True") {
                        document.getElementById('<%= CheckBox3.ClientID %>').checked = true;
                    }
                }
            }
 
            function OnClientSelectedIndexChanged(sender, eventArgs) {
                if (doPostback) {
                    __doPostBack('RadComboBox1', '');
                }
            }
 
            function AdjustRadWindowOnFirstLoad() {
                var oWindow = GetRadWindow();
                if (oWindow.argument != null) {
                    oWindow.argument = null;
                    setTimeout(function () { oWindow.autoSize(true); if ($telerik.isChrome || $telerik.isSafari) ChromeSafariFix(oWindow); }, 500);
                }
            }
 
            function AdjustRadWindow() {
                    var oWindow = GetRadWindow();
                    setTimeout(function () { oWindow.autoSize(true); if ($telerik.isChrome || $telerik.isSafari) ChromeSafariFix(oWindow); }, 500);
            }
 
            //fix for Chrome/Safari due to absolute positioned popup not counted as part of the content page layout
            function ChromeSafariFix(oWindow) {
                var iframe = oWindow.get_contentFrame();
                var body = iframe.contentWindow.document.body;
 
                setTimeout(function () {
                    var height = body.scrollHeight;
                    var width = body.scrollWidth;
 
                    var iframeBounds = $telerik.getBounds(iframe);
                    var heightDelta = height - iframeBounds.height;
                    var widthDelta = width - iframeBounds.width;
 
                    if (heightDelta > 0) oWindow.set_height(oWindow.get_height() + heightDelta);
                    if (widthDelta > 0) oWindow.set_width(oWindow.get_width() + widthDelta);
                    oWindow.center();
 
                }, 310);
            }
        </script>
    </telerik:RadCodeBlock>
 
        <fieldset>
            <legend>Refresh Settings</legend>
            <table>
                <tr>
                    <td class="AutoRefreshEnabled">
                        <asp:Label ID="Label1" runat="server" Text="Auto-Refresh Enabled:"></asp:Label>
                    </td>
                    <td class="AutoRefreshCheckbox">
                    <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" oncheckedchanged="CheckBox1_CheckedChanged" />
                    </td>
                    <td class="AutoRefreshNumericTextbox">
                        <telerik:RadNumericTextBox ID="RadNumericTextBox1" Runat="server"
                            Label="Auto-Refresh Interval (Minutes):" MaxValue="60" MinValue="0"
                            ShowSpinButtons="True" Value="0" Width="225px" Enabled="False"
                            LabelCssClass="riLabel LabelDisabled">
                        <NumberFormat DecimalDigits="0" />
                        </telerik:RadNumericTextBox>
                    </td>
                </tr>
            </table>
        </fieldset>
 
        <fieldset>
            <legend>Chart Properties</legend>
            <telerik:RadComboBox ID="RadComboBox1" Runat="server" Skin="Web20"
                onselectedindexchanged="RadComboBox1_SelectedIndexChanged"
                onclientselectedindexchanged="OnClientSelectedIndexChanged">
                <Items>
                    <telerik:RadComboBoxItem runat="server" Text="Line Chart" Value="LineChart" />
                    <telerik:RadComboBoxItem runat="server" Text="Pie Chart" Value="PieChart" />
                </Items>
            </telerik:RadComboBox>
            <table>
                <tr>
                    <td class="TimeframeRestricted">
                        Timeframe Restricted:</td>
                    <td class="TimeframeCheckbox">
                        <asp:CheckBox ID="CheckBox2" runat="server" AutoPostBack="True" oncheckedchanged="CheckBox2_CheckedChanged" />
                    </td>
                    <td class="TimeframeDateTimePickers">
                        <telerik:RadDateTimePicker ID="RadDateTimePicker1" Runat="server" Skin="Web20" Enabled="False" Culture="en-US" EnableTyping="False" PopupDirection="TopLeft">
                            <TimeView runat="server" CellSpacing="-1">
                            </TimeView>
                            <TimePopupButton CssClass="rcTimePopup rcDisabled" ImageUrl="" HoverImageUrl="">
                            </TimePopupButton>
 
                            <Calendar runat="server" Skin="Web20" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x">
                            </Calendar>
                            <DateInput runat="server" DateFormat="M/d/yyyy" DisplayDateFormat="M/d/yyyy" readonly="True">
                            </DateInput>
                            <DatePopupButton CssClass="rcCalPopup rcDisabled" ImageUrl="" HoverImageUrl="">
                            </DatePopupButton>
                            <ClientEvents OnPopupClosing="AdjustRadWindow" OnPopupOpening="AdjustRadWindow" />
                        </telerik:RadDateTimePicker>
                    </td>
                </tr>
                <tr>
                    <td class="DataPointsShown">
                        <asp:Label ID="Label2" runat="server" Text="Data Points Shown:"></asp:Label>
                    </td>
                    <td class="DatapointsCheckbox">
                        <asp:CheckBox ID="CheckBox3" runat="server" AutoPostBack="True" />
                    </td>
                    <td class="TimeframeDateTimePickers">
                        <telerik:RadDateTimePicker ID="RadDateTimePicker2" Runat="server" Skin="Web20" Enabled="False" Culture="en-US" EnableTyping="False" PopupDirection="TopLeft">
                            <TimeView runat="server" CellSpacing="-1">
                            </TimeView>
                            <TimePopupButton CssClass="rcTimePopup rcDisabled" ImageUrl="" HoverImageUrl="">
                            </TimePopupButton>
 
                            <Calendar runat="server" Skin="Web20" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x">
                            </Calendar>
                            <DateInput runat="server" DateFormat="M/d/yyyy" DisplayDateFormat="M/d/yyyy" readonly="True">
                            </DateInput>
                            <DatePopupButton CssClass="rcCalPopup rcDisabled" ImageUrl="" HoverImageUrl="">
                            </DatePopupButton>
                            <ClientEvents OnPopupClosing="AdjustRadWindow" OnPopupOpening="AdjustRadWindow" />
                        </telerik:RadDateTimePicker>
                    </td>
                </tr>
            </table>
        </fieldset>
        <div class="BottomButtons">
            <telerik:RadButton ID="RadButton1" runat="server" Skin="Web20" Text="Apply" OnClientClicked="CloseAndSave" >
            </telerik:RadButton>
        </div>
    </form>
</body>
</html>

In my client-side onLoad function I check the combobox's value, and, if its value is PieChart, I attempt to hide some controls on the page from the user. Setting the checkbox's visibility property to Collapse, Hidden, etc.. doesn't do anything. The same with setting its height and width to 0 -- it is still visible. If I disable it, it becomes disabled. I am able to affect the controls on its left and right -- the RadDateTimePicker and the label both disappear in IE8 perfectly fine.

Any suggestions on how to remove this finicky box would be appreciated.

Niko
Telerik team
 answered on 30 Mar 2011
1 answer
422 views
Hello, i've try to add a event (OnClick) on my GridButtonColumn:

if (e.Item.OwnerTableView.Name == "ChildTableName")
{
ImageButton LinkButton = (ImageButton)item["BtnCol"].Controls[0];
LinkButton.ToolTip = ResourceProvider.GetLocalValue("Cfg_Carousel_Peg_Bobbins_Details");
                
// [...] AddAttribute
}

But I need to intercept the button with UniqueName BtnCol value into if statement:

<telerik:GridButtonColumn 
UniqueName="BtnCol" 
ButtonType="ImageButton" 
ImageUrl="Images/Generic/Icons/info.gif"                                  
CommandName="BobbinsDetails">
<HeaderStyle Width="30px"></HeaderStyle>
</telerik:GridButtonColumn>

What?
Thanks
mbro87
Top achievements
Rank 1
 answered on 30 Mar 2011
1 answer
115 views

hi, in the event of

Page_Load

 I added a custom item:

 

 

RadMenuItem

 

 

manageAccessMenuItem = new RadMenuItem("Open Account");

 

 

manageAccessMenuItem.Value =

 

"OpenAccount";

 

 

 

 

I need to achieve 2 things:
1. on this item click i open a radwindow
2. show or enable this item only for a specific files within some specific folders, hide or disable this when right click on empty area or a folder.

please help
thanks in advance

 

Dobromir
Telerik team
 answered on 30 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?