Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
183 views
Hello,

I reload the items within a RadComboBox using the client-side API.  I'm not using the WS load on demand feature, but solely the JS api to add items to the combo.  When the items are refreshed and a postback happens, I'm getting this error below.  When it goes to load the combo client-state, an error occurs.  We are using the last 2009 Q3 version.

Thanks.

 

System.NullReferenceException: Object reference not set to an instance of an object.

at Telerik.Web.UI.ControlItem.LoadFromDictionary(IDictionary`2 dictionary)

at Telerik.Web.UI.ClientStateLogPlayer`1.Insert(ClientStateLogEntry entry, ControlItemCollection items, Int32 index)

at Telerik.Web.UI.ClientStateLogPlayer`1.Play(ClientStateLogEntry entry)

at Telerik.Web.UI.ClientStateLogPlayer`1.Play(IEnumerable`1 clientStateLogEntry)

at Telerik.Web.UI.RadComboBox.LoadClientState(RadComboBoxClientState clientState)

at Telerik.Web.UI.RadComboBox.LoadPostData(String postDataKey, NameValueCollection postCollection)

at Telerik.Web.UI.RadDataBoundControl.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection)

at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Simon
Telerik team
 answered on 29 Mar 2010
0 answers
97 views
Solved
Webster Velasco
Top achievements
Rank 2
 asked on 29 Mar 2010
5 answers
458 views

Requirements

RadControls version

2009.01.0311.20
.NET version

2.0
Visual Studio version 2005
programming language

C#
browser support

all browsers supported by RadControls


PROJECT DESCRIPTION

The project demonstrates on how to filter a grid automatically on typing every single letter into the filter textbox. For this purpose an 'onkeyup' client event is added to the filter textbox wherein filtering is performed and the unique name of the currently filtered column is stored into a hidden field. The filter textbox of the current column is focused after a filtering has been performed and the cursor position in the textbox is set by adding an 'onfocus' client event to the filter textbox of that column.

aspx:
 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
<head > 
<title>Untitled Page</title>  
   
</head> 
<body> 
    <form id="form1" runat="server"
        <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
        <div> 
         
        <input id="Hidden1" runat="server" name="Hidden1" type="hidden"/>  
 
       <telerik:RadGrid ID="RadGrid" runat="server" AutoGenerateColumns="true" AllowPaging="true" PageSize="10" AllowFilteringByColumn="True" DataSourceID="SqlDataSource1" OnItemDataBound="RadGrid_ItemDataBound" OnPreRender="RadGrid_PreRender"
          <MasterTableView>        
          </MasterTableView> 
        </telerik:RadGrid> 
         
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" SelectCommand="SELECT [CustomerID], [CompanyName], [ContactName], [ContactTitle], [Address], [City], [PostalCode] FROM [Customers]"></asp:SqlDataSource>        
        
        </div> 
    </form>     
</body> 
</html> 

c#:
 
using System; 
using System.Data; 
using System.Configuration; 
using System.Web; 
using System.Web.Security; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using System.Web.UI.WebControls.WebParts; 
using System.Web.UI.HtmlControls; 
using Telerik.Web.UI; 
 
public partial class _Default : System.Web.UI.Page  
    protected void Page_Load(object sender, EventArgs e) 
    { 
 
    } 
   
    protected void RadGrid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
        if (e.Item is GridFilteringItem) 
        { 
            GridFilteringItem filterItem = (GridFilteringItem)e.Item; 
            foreach (GridColumn col in RadGrid.MasterTableView.RenderColumns) 
            { 
                if ((col.UniqueName != "ExpandColumn") && (col.UniqueName != "RowIndicator") ) 
                { 
                     TextBox filtertxt = (TextBox)filterItem[col.UniqueName].Controls[0]; 
                     filtertxt.Attributes.Add("onkeyup""Filter('" + col.UniqueName + "','" + filtertxt.ClientID + "')");                        
 
                } 
            } 
        }     
    } 
    protected void RadGrid_PreRender(object sender, EventArgs e) 
    { 
        if (Hidden1.Value != ""
        { 
            GridFilteringItem filter = (GridFilteringItem)RadGrid.MasterTableView.GetItems(GridItemType.FilteringItem)[0]; 
            TextBox txtfilter = (TextBox)filter[Hidden1.Value].Controls[0]; 
            txtfilter.Focus(); 
            txtfilter.Attributes.Add("onFocus""FocusFilter('" + txtfilter.ClientID + "');");           
        } 
    }     
        

js:
 
<script type="text/javascript">   
    function Filter(colName,filtertxt)  
        {  
                  
           var filterTxt = document.getElementById(filtertxt);  
           var MasterTable = $find("<%= RadGrid.ClientID %>").get_masterTableView();                  
            
           var hidden = document.getElementById('<%=Hidden1.ClientID %>');  
           hidden.value = colName;   
           
           if(filterTxt.value.length>0)  
           {                    
               MasterTable.filter(colName, filterTxt.value, Telerik.Web.UI.GridFilterFunction.StartsWith);                   
           }  
           else  
           {  
               MasterTable.filter(colName, filterTxt.value, Telerik.Web.UI.GridFilterFunction.NoFilter);             
           }            
        }  
          
     function FocusFilter(filter)  
        {         
          var input = document.getElementById(filter);    
          if (input.createTextRange)    
            {    
                var FieldRange = input.createTextRange();    
                FieldRange.moveStart('character', input.value.length);   
                FieldRange.select();    
            }             
        }     
</script>  

Regards
Princy.
Sebastian
Telerik team
 answered on 29 Mar 2010
1 answer
87 views
I need to Duplicate X button behavior in javascript code.

My domains are different so I'm getting an access denied message when using frameelement.  But when I click on the X - it closes the window and works.

So, is there javascript code that does exactly what clicking the "X" button does?
Georgi Tunev
Telerik team
 answered on 29 Mar 2010
1 answer
88 views
Could someone tell me the best way to deploy websites that use the telerik dlls and prevent the end user from copying and using the dlls.  This is a website and not a web application.  Any htlp would be greatly appreciated.
Sebastian
Telerik team
 answered on 29 Mar 2010
1 answer
118 views
Telerik,

I have an interesting use case that may be more common than you expect: I have an existing ASP.NET 2.0 web application that I am adding a side-by-side DNN site for content management.  Even though the DNN/content site and my webapp site are technically two different web sites, I want the user experience to be seamless.

This requires that the navigation menu in both the DNN site and the non-DNN web app site look and act identical.  My initial implementation thought was:

DNN Site: use the included RadMenu to display the DotNetNuke nav menu data (easy).
Web App Site: use RadMenu with identical skinning, but somehow query the DNN SQL database as the RadMenu datasource in this non-DNN site.

Is there any way to accomplish this?  If supported (or even if custom code could accomplish), you'd have one more buyer of your ASP.NET AJAX controls!

Many thanks for your input, of for input of anyone who's tackled a similar problem.

Ryan
Dimitar Milushev
Telerik team
 answered on 29 Mar 2010
1 answer
132 views
I have populated the radmenu using the xml file. Below is the snapshot of it:

<?

 

xml version="1.0" encoding="utf-8" ?>

 

<

 

Menu>

 

<

 

Group>

 

<

 

Item Text="Administrator" ImageUrl="../Images/admin.png" >

 

<

 

Group>

 

<

 

Item Text="Manage Users" Href="../Pages/UserGroup.aspx" ImageUrl="../Images/user.gif" />

 

<

 

Item Text="Manage Release/Project" Href="../Pages/Releases.aspx" ImageUrl="../Images/ht.gif" />

 

<

 

Item IsSeparator="True" />

 

<

 

Item Text="RVP" Href="../Pages/RVP.aspx" ImageUrl="../Images/report.png" />

 

</

 

Group>

 

</

 

Item>
....

Menu loads up fine, but the images are not cenetered. Is there a way to center the images in the menu?

Thank you.

 

Shinu
Top achievements
Rank 2
 answered on 29 Mar 2010
1 answer
89 views
Hi telerik team,
I try to use  RadToggleButton in my web page, but I can't find the RadToggleButton control from vs 2008 toolbox.
How can I access this control.
I am using RadControls for ASP.NET AJAX Q3 2009 NET35
Thanks a lot !
Qixiong
Sebastian
Telerik team
 answered on 29 Mar 2010
1 answer
104 views
In our project, we are planning to use the standard skins for various controls, and implement only a few customizations in a few places.  My plan is to set up the project to use the embedded skins, then in a separate CSS file we will place our own CSS that overrides some of the CSS in the Telerik files.  There is no need to generate a complete "custom" skin for only a small amount of customization.

In overriding the Telerik styles, of course, we could always add a higher level of specificity to ensure our style wins.  But I was wondering if there is a way to guarantee that our CSS file always loads after the <link> element that loads the Telerik styles from the Telerik webresource.  That way our styles would always override even if they were specified exactly like the Telerik styles.

Do you know how/when the Telerik <link> element is generated and how we could place our stylesheet <link> element after it?

Regards,
Bob Reader
Dimo
Telerik team
 answered on 29 Mar 2010
1 answer
164 views
Is there a way to avoid causing a new captcha image to be generated on a postback? For example, if i had a form with two dropdown lists that are dependent on each other, when the first dropdownlist fires an event to bind the second list, the captcha image regenerates.

Thanks,
Sam
Pero
Telerik team
 answered on 29 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
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?