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

I'm trying to set up a rad filter from code.

This works as expected:
<telerik:RadFilter ID="RadFilter1" runat="server">  
   <FieldEditors> 
       <telerik:RadFilterTextFieldEditor DataType="System.String" FieldName="MyColumn" /> 
   </FieldEditors> 
</telerik:RadFilter> 
 

This doesn't:
<telerik:RadFilter ID="RadFilter1" runat="server">  
</telerik:RadFilter> 
 
protected void Page_Load(object sender, EventArgs e)  
{  
    RadFilterTextFieldEditor editor = new RadFilterTextFieldEditor();  
    editor.FieldName = "MyColumn";  
    editor.DataType = typeof(System.String);  
    RadFilter1.FieldEditors.Add(editor);  
}  
 

When configured programatically, I'm getting the following error as soon as I try to add an expresion (via the UI when the page is running):
Exception of type 'System.Web.HttpUnhandledException' was thrown. 
 
==> Parameter cannot be null or empty.  
Parameter name: fieldName    
Stack Traces  
Source: System.Web  
at System.Web.UI.Page.HandleError(Exception e)  
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)  
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)  
at System.Web.UI.Page.ProcessRequest()  
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)  
at System.Web.UI.Page.ProcessRequest(HttpContext context)  
at ASP.junk_filters_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\bit9.console.web.ui\f02bb933\1bce73bb\App_Web_filters.aspx.83447962.uwhliv7r.0.cs:line 0  
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()  
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)  
 
==> Source: Telerik.Web.UI  
at Telerik.Web.UI.RadFilterDataFieldEditorCollection.RetrieveEditorForFieldName(String fieldName)  
at Telerik.Web.UI.RadFilterSingleExpressionItem.SetupFunctionInterface(Control container)  
at Telerik.Web.UI.RadFilterExpressionItem.CreateFunctionalInterface()  
at Telerik.Web.UI.RadFilterExpressionItem.InitializeItem()  
at Telerik.Web.UI.RadFilter.CreateFilterItems()  
at Telerik.Web.UI.RadFilter.CreateControlHierarchy()  
at Telerik.Web.UI.RadFilter.CreateChildControls()  
at System.Web.UI.Control.EnsureChildControls()  
at Telerik.Web.UI.RadFilter.EnsureItemsCreated()  
at Telerik.Web.UI.RadFilter.RecreateControl()  
at Telerik.Web.UI.RadFilter.AddChildExpression(RadFilterGroupExpressionItem groupItem, Boolean isGroup)  
at Telerik.Web.UI.RadFilterCommandEventArgs.ExecuteCommand(Object source)  
at Telerik.Web.UI.RadFilter.OnBubbleEvent(Object source, EventArgs args)  
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)  
at Telerik.Web.UI.RadFilterExpressionItem.OnBubbleEvent(Object source, EventArgs args)  
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)  
at System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)  
at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument)  
at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)  
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)  
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)  
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)  

Any suggestions?  Doing this declaratively is not an option for me and I will not have a grid or other "FilterContainer" available.

-Al
João
Top achievements
Rank 1
 answered on 17 May 2011
4 answers
144 views

Hello,
I have a RadGrid which one of its columns is RadCombobox.
when i change item in one of the comboboxes, i want to know to which item (row) in the grid it belongs.
I mean, I want to know which of the rows was changed
How do i do that?
i thought to do it in the radCombobox 'OnClientSelectedIndexChanged' event,
but i dont know how to get to check which row i changed.

it's very important for me.
waiting for an answer,
yoni
Veli
Telerik team
 answered on 17 May 2011
3 answers
93 views
Hi,
We are having an old project which uses “r.a.d.menu v3.6” which is part of  r.a.d controls Q4 2005 installed on 32 bit server. Now the project is being moved to a new server having 64 bit architecure. For testing we ported the application on a test 64 bit server but the menu control does not work. There is an error "Master Page Undefined" in page from which menu is invoked.

Please let me know what are the steps needed to make this menu control work in 64 bit web server.

Thanks in advance,
-Kumar
Helen
Telerik team
 answered on 17 May 2011
1 answer
148 views
I need to test whether or not a RadWindow is in the Windows collection of a RadWindowManager.

"Easy" I thought, I'll add an extension method ...

public static RadWindow FindWindowByID(this RadWindowManager WindowManager, string ID)
{
    if (String.IsNullOrWhiteSpace(ID))
    {
        throw new InvalidOperationException("Searching for a blank ID is not supported)");
    }
    string id = ID.ToLower();
    if (WindowManager.Windows.Count == 0)
    {
        return null;
    }
    RadWindow result = null;
    foreach (RadWindow window in WindowManager.Windows)
    {
        if (window.ID.ToLower() == id)
        {
            result = window;
            break;
        }
    }
    return result;
}

However, when called it always throws an exception in the test if(window.ID.ToLower() == id) and reports the window.ID is null.

If I drill down through the object's structure all the way to WebControl I can see that, in fact, ID is set but it isn't my value (the one assigned in the markup), but, rather is an automagically assigned value like cl001.

OK, so you are managing the ID, but I can't find a property anywhere that has the value that I assigned and that I can test against.

What am I missing?

-- 
Stuart
Marin Bratanov
Telerik team
 answered on 17 May 2011
2 answers
125 views
I have a project that previously used asp dropdown lists.  I am switching these over to telerik controls for increased functionality.  However, I need to be able to dynamically reference and populate the controls in the page load event.  Here is how I used to accomplish this:

Dim dropDown As New DropDownList
dropDown = CType(Me.Master.FindControl("id_" & dynamic_code), DropDownList)
 
With dropDown
    .Enabled = True
    .DataSource = SqlDataReader
    .DataValueField = "code"
    .DataTextField = "desc"
    .DataBind()
End With


How do I replicate this behavior with a telerik control?  I've tried something like this:

Dim dropDown As RadComboBoxItem
Dim instance As RadComboBoxItem
 
dropDown = instance.FindControl("id_" & dynamic_code)
 
With dropDown
    .Enabled = True
    .DataSource = SqlDataReader
    .DataValueField = "code"
    .DataTextField = "desc"
    .DataBind()
End With

But the properties I'm trying to set are invalid and do not exist.  Suggestions or help appreciated.
Karl
Top achievements
Rank 1
 answered on 17 May 2011
1 answer
81 views
Hi,

The radeditor flickers a lot when using IE (only tested with IE9), when setting ContentMode to Div and using AutoResize to fit content height.

This is easy to demonstrate in your Demo:
http://demos.telerik.com/aspnet-ajax/editor/examples/contentareamodediv/defaultcs.aspx

1. Check the Auto resize button.
2. Make a lot of new lines at the end of the editor (large content).
3. Start typing and press enter, continue typing and pressing enter.

This makes the entire page to flicker a lot.

Regards
Caesar
Rumen
Telerik team
 answered on 17 May 2011
1 answer
77 views

This one is complicated even to explain. I have .aspx page in my project, which uses JSON to load some parts of page. In old version of this page, I have text area, which was replaced with fckeditor using javascript. Now, I am trying to change old fckeditor with new RAD editor.
My problem is, that when I change textarea to radeditor, I get this error :


Sys.Res is undefined


 if (!element) throw Error.argument('element', Sys.Res.createNoDom);

When editor should appear, on FF4, I see unconfigured editor, which do not responds to any of my actions, on IE8 - text area without toolbar.

Any ideas how to make this work?

Rumen
Telerik team
 answered on 17 May 2011
3 answers
172 views
Hi,

Autocomplete feature gets disabled when the radcombobox is used in ajax poastback. eg. I have a radcombobox which postback after index changed. It is also registered for ajax postback like below

 

<telerik:AjaxSetting AjaxControlID="cboCountry">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="cboStates" />

 

 

<telerik:AjaxUpdatedControl ControlID="cboProduct" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 


Now when page is loaded for the first time the cbostates and cboproducts will autocomplete but after the ajaxpost back autocomplete feature gets disabled. Please reply for the same its kinda urgent. Thanks.
Kate
Telerik team
 answered on 17 May 2011
1 answer
127 views
Hello, i have RadRotator inside of RadListView, when I click on the linkbutton (RadRotator) the RadAjaxLoadingPanel just appears for an instant but the end of request never waits for the response ??

I mean, the RadAjaxLoadingPanel  is never waiting to the Itemclick event of the rad rotator inside of radlistview..

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Office2007"
    meta:resourcekey="RadAjaxLoadingPanel1Resource1" />
<telerik:RadCodeBlock ID="RadCodeBlock2" runat="server">
    <script type="text/javascript">
        function showNextItem(clickedButton, rotator, direction) {
            rotator.showNext(direction);
        }
    </script>
</telerik:RadCodeBlock>
<telerik:RadAjaxPanel ID="radAjaxPanel" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"
    HorizontalAlign="NotSet" meta:resourcekey="radAjaxPanelResource1">
    <telerik:RadDataPager ID="RadDataPager2" runat="server" PagedControlID="RadListView1"
        Width="685px" meta:resourcekey="RadDataPager2Resource1">
        <Fields>
            <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
            <telerik:RadDataPagerButtonField FieldType="Numeric" />
            <telerik:RadDataPagerButtonField FieldType="NextLast" />
            <telerik:RadDataPagerPageSizeField PageSizeText="Page size: " />
            <telerik:RadDataPagerGoToPageField CurrentPageText="Page: " TextBoxWidth="15" meta:resourcekey="RadDataPagerGoToPageFieldResource1" />
            <telerik:RadDataPagerTemplatePageField>
                <PagerTemplate>
                    <div style="float: right">
                        <b>Items
                            <asp:Label runat="server" ID="CurrentPageLabel" Text="<%# Container.Owner.StartRowIndex+1 %>"
                                meta:resourcekey="CurrentPageLabelResource1" />
                            to
                            <asp:Label runat="server" ID="TotalPagesLabel" Text="<%# Container.Owner.TotalRowCount > (Container.Owner.StartRowIndex+Container.Owner.PageSize) ? Container.Owner.StartRowIndex+Container.Owner.PageSize : Container.Owner.TotalRowCount %>"
                                meta:resourcekey="TotalPagesLabelResource1" />
                            of
                            <asp:Label runat="server" ID="TotalItemsLabel" Text="<%# Container.Owner.TotalRowCount %>"
                                meta:resourcekey="TotalItemsLabelResource1" />
                            <br />
                        </b>
                    </div>
                </PagerTemplate>
            </telerik:RadDataPagerTemplatePageField>
        </Fields>
    </telerik:RadDataPager>
    <div style="background-image: url('/images/detallefoto_2.jpg'); background-repeat: repeat-y;
        text-align: center; width: 705px; clear: both">
        <telerik:RadListView ID="RadListView1" Width="540px" AllowPaging="True" AllowCustomPaging="True"
            runat="server" AllowSorting="false" ItemPlaceholderID="ProductsHolder" OnPageIndexChanged="RadListView1_PageIndexChanged"
            DataKeyNames="MatchID" OnItemDataBound="RadListView1_ItemDataBound" OnNeedDataSource="RadListView1_NeedDataSource"
            meta:resourcekey="RadListView1Resource1">
            <LayoutTemplate>
                <asp:Panel ID="ProductsHolder" runat="server" meta:resourcekey="ProductsHolderResource1" />
                <br style="clear: both" />
            </LayoutTemplate>
            <ItemTemplate>
                <div style="clear: left;">
                    <div style="background-image: url('../images/faq_1.jpg'); background-repeat: no-repeat;
                        height: 54px; text-align: left">
                        <div style="width: 549px; position: relative; left: 65px; top: 22px; height: 14px;">
                            <asp:Label ID="MyData" runat="server" Font-Bold="True" Font-Size="Small" ForeColor="#999999"
                                Text='<%# Eval("NumberID") %>' meta:resourcekey="MyDataResource1"></asp:Label>
                        </div>
                    </div>
                    <table style="width: 700px; padding: 0px; margin: 0px; height: 300px" border="0">
                        <tr>
                            <td width="20">
                                <asp:HyperLink ID="rightButtonHyperLink" runat="server" ImageUrl="~/images/flechaiz.jpg"
                                    NavigateUrl="#" BorderWidth="0px" meta:resourcekey="rightButtonHyperLinkResource1" />
                            </td>
                            <td valign="top">
                                <telerik:RadRotator ID="RadRotator1" runat="server" Width="100%" ItemWidth="230px"
                                    RotatorType="FromCode" OnItemDataBound="RadRotator1_ItemDataBound" meta:resourcekey="RadRotator1Resource1"
                                    Height="350px" onitemclick="RadRotator1_ItemClick"  AutoPostBack="true" EnableAjaxSkinRendering="true" FrameDuration="2000"
                                    onitemcreated="RadRotator1_ItemCreated" SlideShowAnimation-Duration="4000">
                                    <ItemTemplate>
                                        <div>
                                            <table style="width: 100%;" cellspacing="0" cellpadding="0" border="0" align="center">
                                                <tr>
                                                    <td colspan="3" style="text-align: center">
                                                        <div style="background-position: 15px 12px; background-image: url('/images/foto_1.jpg');
                                                            height: 20px; background-repeat: no-repeat;">
                                                        </div>
                                                        <div style="padding: 5px 0px 5px 0px; background-position: 15px 0px; background-image: url('/images/foto_2.jpg');
                                                            background-repeat: repeat-y; text-align: center">
                                                            <asp:HyperLink ID="photoImageButton" runat="server" ImageUrl='<%# Eval("ThumbsPath") %>'
                                                                meta:resourcekey="photoImageButtonResource1" />
                                                        </div>
                                                        <div style="background-position: 15px -16px; background-image: url('/images/foto_3.jpg');
                                                            height: 19px; background-repeat: no-repeat;">
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td style="text-align: center;">
                                                        <asp:Label ID="Label2" runat="server" Text='<%# Eval("Description") %>' meta:resourcekey="Label2Resource1"></asp:Label>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td style="text-align: center">
                                                        <asp:HyperLink ID="userNameHyperLink" runat="server" Text='<%# Eval("UserName") %>'
                                                            NavigateUrl='<%# "/member/" + Eval("UserName") %>' meta:resourcekey="userNameHyperLinkResource1" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="center" style="text-align: center">
                                                        <img alt="" src="/images/vinetaverde.jpg" height="10" width="10" />
                                                        <asp:Label ID="uploadedDateLabel" runat="server" meta:resourcekey="uploadedDateLabelResource1" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td style="text-align: center">
                                                        <asp:Label ID="numberVotesLabel" runat="server" Text='<%# Eval("NumberVotes") %>' />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td style="text-align: center">
                                                        <asp:ImageButton ID="voteNowImageButton" runat="server" meta:resourcekey="voteNowImageResource1"
                                                            CommandName="Vote" CommandArgument='<%# Eval("PhotographyID") %>' />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td style="text-align: center">
                                                        <asp:ImageButton ID="denunceNowImageButton" runat="server" meta:resourcekey="denunceNowImageResource1"
                                                            CommandName="Denounce" CommandArgument='<%# Eval("PhotographyID") %>' />
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </ItemTemplate>
                                </telerik:RadRotator>
                            </td>
                            <td width="20">
                                <asp:HyperLink ID="leftButtonHyperLink" runat="server" ImageUrl="~/images/flechade.jpg"
                                    NavigateUrl="#" BorderWidth="0px" meta:resourcekey="leftButtonHyperLinkResource1" />
                            </td>
                        </tr>
                    </table>
                </div>
            </ItemTemplate>
        </telerik:RadListView>
    </div>
    <telerik:RadDataPager ID="RadDataPager1" runat="server" PagedControlID="RadListView1"
        Width="685px" meta:resourcekey="RadDataPager1Resource1">
        <Fields>
            <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
            <telerik:RadDataPagerButtonField FieldType="Numeric" />
            <telerik:RadDataPagerButtonField FieldType="NextLast" />
            <telerik:RadDataPagerPageSizeField PageSizeText="Page size: " />
            <telerik:RadDataPagerGoToPageField CurrentPageText="Page: " TextBoxWidth="15" meta:resourcekey="RadDataPagerGoToPageFieldResource2" />
            <telerik:RadDataPagerTemplatePageField>
                <PagerTemplate>
                    <div style="float: right">
                        <b>Items
                            <asp:Label runat="server" ID="CurrentPageLabel" Text="<%# Container.Owner.StartRowIndex+1 %>"
                                meta:resourcekey="CurrentPageLabelResource2" />
                            to
                            <asp:Label runat="server" ID="TotalPagesLabel" Text="<%# Container.Owner.TotalRowCount > (Container.Owner.StartRowIndex+Container.Owner.PageSize) ? Container.Owner.StartRowIndex+Container.Owner.PageSize : Container.Owner.TotalRowCount %>"
                                meta:resourcekey="TotalPagesLabelResource2" />
                            of
                            <asp:Label runat="server" ID="TotalItemsLabel" Text="<%# Container.Owner.TotalRowCount %>"
                                meta:resourcekey="TotalItemsLabelResource2" />
                            <br />
                        </b>
                    </div>
                </PagerTemplate>
            </telerik:RadDataPagerTemplatePageField>
        </Fields>
    </telerik:RadDataPager>
</telerik:RadAjaxPanel>


Niko
Telerik team
 answered on 17 May 2011
2 answers
318 views
I'm attempting to get a selected item to scroll into view.  When I use the code posted in this article, I have a couple of problems.
1. First I get a JavaScript error that states that the "GridCreated" function can't be found.  If I remove the RadUpdate Panel from the page, this goes away (I need it to work in an update panel though).  
2.  After removing the update panel from the page, var scrollArea = document.getElementById(this.ClientID + "_GridData"); returns null.
3. this.MasterTableView is null.

I'm using the 2011.1.413.35 version of the Telerik.Web.UI.dll.  I have copied the code from the article into a completely clean project to make sure my code was not interfering with it, and the problems still occur.

Could you please point me in the right direction?

Regards,

John B.
John Brogdon
Top achievements
Rank 1
 answered on 17 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?