Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
275 views
Hi
I am making use of a Radcombobox inside a Radgrid during Edit mode. I get this problem when I have different values for the
DataValueField and DataTextField. When I make use of the same valeus for both, I don't get the error and the Radcombobox is geting populated.

 

<telerik:RadComboBox ID="CbAircraftModelType" runat="server" Skin="Black"      
                            SelectedValue='<%# Bind("modelTypeName") %>' EmptyMessage=" Select Aircraft Type"                                
                            HighlightTemplatedItems="True" DataTextField="modelTypeName" DataValueField="modelTypeId"    
                            EnableTextSelection="False" DataSourceID="SqlDataSource_AircraftType"      
                            OnClientSelectedIndexChanged="cb_OnClientSelectedIndexChanged" />    
 
I am making use of a SqlDataSource to populate the Radcombobox.

<asp:SqlDataSource ID="SqlDataSource_AircraftType" runat="server"      
                    ConnectionString="<%$ ConnectionStrings:AvengeConnectionString %>"      
                 SelectCommand="select modelTypeName,modelTypeId from Avenge.dbo.AircraftModelType ">     
            </asp:SqlDataSource>    
 

I don't have any code for working with this in the code-behind.

This is the error that I am getting:

Selection out of range     
Parameter name: value      
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.      
    
Exception Details: System.ArgumentOutOfRangeException: Selection out of range     
Parameter name: value     
    
Source Error:      
    
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.       
    
Stack Trace:      
    
    
[ArgumentOutOfRangeException: Selection out of range     
Parameter name: value]     
   Telerik.Web.UI.RadComboBox.PerformDataBinding(IEnumerable dataSource) +172     
   Telerik.Web.UI.RadComboBox.OnDataSourceViewSelectCallback(IEnumerable data) +39     
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31     
   Telerik.Web.UI.RadComboBox.OnDataBinding(EventArgs e) +102     
   Telerik.Web.UI.RadComboBox.PerformSelect() +37     
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73     
   System.Web.UI.Control.DataBindChildren() +211     
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102     
   System.Web.UI.Control.DataBind() +15     
   System.Web.UI.Control.DataBindChildren() +211     
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102     
   System.Web.UI.Control.DataBind() +15     
   System.Web.UI.Control.DataBindChildren() +211     
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102     
   System.Web.UI.Control.DataBind() +15     
   System.Web.UI.Control.DataBindChildren() +211     
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102     
   System.Web.UI.Control.DataBind() +15     
   System.Web.UI.Control.DataBindChildren() +211     
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102     
   System.Web.UI.Control.DataBind() +15     
   System.Web.UI.Control.DataBindChildren() +211     
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102     
   System.Web.UI.Control.DataBind() +15     
   System.Web.UI.Control.DataBindChildren() +211     
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102     
   System.Web.UI.Control.DataBind() +15     
   System.Web.UI.Control.DataBindChildren() +211     
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102     
   System.Web.UI.Control.DataBind() +15     
   System.Web.UI.Control.DataBindChildren() +211     
   System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102     
   System.Web.UI.Control.DataBind() +15     
   Telerik.Web.UI.GridEditFormItem.SetupItem(Boolean dataBind, Object dataItem, GridColumn[] columns, ControlCollection rows) +387     
   Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group) +979     
   Telerik.Web.UI.GridTableView.CreateItems(IEnumerator enumerator, GridColumn[] columns, ControlCollection controls) +187     
   Telerik.Web.UI.GridTableView.CreateControlHierarchy(Boolean useDataSource) +1573     
   Telerik.Web.UI.GridTableView.CreateChildControls(IEnumerable dataSource, Boolean useDataSource) +782     
   System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +57     
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +114     
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31     
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142     
   Telerik.Web.UI.GridTableView.PerformSelect() +28     
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73     
   Telerik.Web.UI.GridTableView.DataBind() +351     
   Telerik.Web.UI.GridTableView.Rebind() +98     
   Telerik.Web.UI.GridCommandEventArgs.ExecuteCommand(Object source) +395     
   Telerik.Web.UI.RadGrid.OnBubbleEvent(Object source, EventArgs e) +191     
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37     
   Telerik.Web.UI.GridItem.OnBubbleEvent(Object source, EventArgs e) +165     
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37     
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118     
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135     
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10     
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13     
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175     
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565     
    
      
    
Hope someone will be able to help me with this.  
 
Thanks.  
Simon
Telerik team
 answered on 29 Mar 2010
1 answer
98 views
Hi,

How can we add a dropdownlist or combo within the textarea of radeditor? For example a dropdownlist with suggestions as you type in the textarea of radeditor.

Thanks,
Pravs
Shinu
Top achievements
Rank 2
 answered on 29 Mar 2010
4 answers
145 views
I have an invisible field on a page that I populate with a reference ID. How do I get this value into a RadComboBox SelectedValue property at runtime so the combo box has the default (invisible field value) selected when the window comes up?

Thanks,

Joe B
Simon
Telerik team
 answered on 29 Mar 2010
4 answers
183 views
Hi ,
I am Using this CSS. 
Below is code for CSS.
we want to remove the wrapped item text space. for more refernece see scennshot.

<dnn:RadMenu  ID="RadMain_Menu" Width="198px" runat="server" Flow="vertical" SelectedPathHeaderItemCss="focused"
                                            EnableEmbeddedSkins="false"  ShowPath="true" CssClass="RadMenu_Skin"
                                            Skin="" EnableViewState="false"  GroupOffsetX="8" GroupOffsetY="4"   Wrap="false"  SelectedPathItemCss="focused">
   </dnn:RadMenu>

And CSS.




.RadMenu_Skin .expandRight
{
background: transparent url( "../images/arrow.png" ) no-repeat right center; /*background: transparent url("/GSBADNN/arrow.png") no-repeat right center;*/
background-color: transparent;
}

.RadMenu_Skin .rmLink rmExpanded
{
background: transparent url( "../images/arrow.png" ) no-repeat right center; /*background: transparent url("/GSBADNN/arrow.png") no-repeat right center;*/
background-color: transparent;
}
.RadMenu_Skin .rmText rmExpandRight
{
/*background: transparent url("/GSBADNN/arrow.png") no-repeat right center;*/
background: transparent url( "../images/arrow.png" ) no-repeat right center;
background-color: transparent;
}

.RadMenu_Skin .rmLevel1 .rmLink
{
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=78)";
filter: alpha(opacity=78);
opacity: 0.78;
-moz-opacity: 0.78;
white-space:normal !important;  
    float:none !important;  
    position:inherit;  
}

.RadMenu_Skin .group .text {
    padding:3px 10px 5px;
}
/*Space Between root items and child items menu */
 


/*focused menu item color */.RadMenu_Skin a.focused
{
background-color: #34C6F9;
}
.RadMenu_Skin .rmRootGroup
{
}
.RadMenu_Skin .rmLink
{
border: 1px solid white;
border-bottom: 0;
border-left: 0;
border-right: 0;
height: auto;
width: auto;
}
.RadMenu_Skin .rmText
{
padding-left: 5px; 
width: 198px;
padding-right: 5px; 
margin-left: 0px;
left: 0px;
}
.RadMenu_Skin .rmLeftArrow, .RadMenu_Skin .rmRightArrow, .RadMenu_Skin .rmTopArrow, .RadMenu_Skin .rmBottomArrow
{
background: transparent url( "../images/arrow.png" ) no-repeat right center; /*background: transparent url("/GSBADNN/arrow.png") no-repeat right center;*/
background-color: transparent;
}
.RadMenu_Skin .rmRootGroup
{
border: 1px solid #3d556c;
background-color: #627f97;
}
.RadMenu_Skin .rmHorizontal
{
background-position: 0 0;
background-repeat: repeat-x;
}
.RadMenu_Skin .rmVertical
{
background-position: 0 -425px;
background-repeat: repeat-x;
}
/* <Root items> */.RadMenu_Skin, .RadMenu_Skin .rmLink
{
font: normal 10pt/23pt "Verdana" , Verdana, Verdana;
text-decoration: none;
}
.RadMenu_Skin .rmLink
{
color: #fff;
}
.RadMenu_Skin .rmLink, .RadMenu_Skin .rmText
{
background-position: 0 1050px;
background-repeat: no-repeat;
height:auto;
}
.RadMenu_Skin .rmLink:hover
{
text-decoration: none;
cursor: pointer; /* background: transparent url("http://localhost/gsbadnn/arrow.png") no-repeat right center; */
}
.RadMenu_Skin .rmFocused, .RadMenu_Skin .rmSelected
{
color: #0d202b;
background-position: 0 -72px;
}

.RadMenu_Skin .rmLeftArrow, .RadMenu_Skin .rmRightArrow, .RadMenu_Skin .rmTopArrow, .RadMenu_Skin .rmBottomArrow
{
background: transparent url( "../images/arrow.png" ) no-repeat right center; /*background: transparent url("/GSBADNN/arrow.png") no-repeat right center;*/
background-color: transparent;
}
.RadMenu_Skin .rmLink:hover .rmText, .RadMenu_Skin .rmFocused .rmText, .RadMenu_Skin .rmSelected .rmText
{
background-position: 100% -96px;
}
.RadMenu_Skin .rmExpanded, .RadMenu_Skin .rmExpanded:hover
{
/*color: #0d202b;*/
background-position: 0 -120px;
}
.RadMenu_Skin .rmExpanded .rmText, .RadMenu_Skin .rmExpanded:hover .rmText
{
background-position: 100% -144px;
}
.RadMenu_Skin .rmDisabled, .RadMenu_Skin .rmDisabled:hover
{
color: #aaa;
}
.RadMenu_Skin .rmDisabled:hover, .RadMenu_Skin .rmDisabled:hover .rmText
{
background: none;
}
/* </Root items> *//* <Submenu items> */.RadMenu_Skin .rmGroup, .RadMenu_Skin .rmMultiColumn, .RadMenu_Skin .rmGroup .rmVertical
{
border: 1px solid #768ca5;
margin:0 0 0 0px;
padding:0 0px 0 0px;
}
.RadMenu_Skin .rmSlide .rmScrollWrap
{
background-image: none;
}
.RadMenu_Skin_rtl .rmGroup, .RadMenu_Skin_rtl .rmMultiColumn, .RadMenu_Skin_rtl .rmGroup .rmVertical
{
background-position: 100% 0;
margin:0 0 0 0px;
padding:0 0px 0 0px;
}
.RadMenu_Skin .rmGroup .rmLink
{
/* color: #000;*/
margin:0 0 0 0px;
padding:0 0px 0 0px;
}
.RadMenu_Skin .rmGroup .rmLink:hover, .RadMenu_Skin .rmGroup .rmFocused, .RadMenu_Skin .rmGroup .rmSelected
{
    margin:0 0 0 0px;
padding:0 0px 0 0px;
}
.RadMenu_Skin .rmRootGroup .rmHorizontal
{
background-image: none;
margin:0 0 0 0px;
padding:0 0px 0 0px;
}
.RadMenu_Skin .rmScrollWrap .rmVertical
{
border: 0;
}
.RadMenu_Skin .rmGroup .rmFirst, .RadMenu_Skin .rmGroup .rmLast
{
background: none;
margin:0 0 0 0px;
padding:0 0px 0 0px;
}
.RadMenu_Skin .rmGroup .rmLast
{
padding-bottom: 1px;
}
.RadMenu_Skin .rmGroup .rmLink:hover, .RadMenu_Skin .rmGroup .rmFocused, .RadMenu_Skin .rmGroup .rmSelected, .RadMenu_Skin .rmGroup .rmExpanded
{
background-position: 0 -168px;
margin:0 0 0 0px;
padding:0 0px 0 0px;
}
.RadMenu_Skin .rmGroup .rmLink:hover .rmText, .RadMenu_Skin .rmGroup .rmFocused .rmText, .RadMenu_Skin .rmGroup .rmSelected .rmText, .RadMenu_Skin .rmGroup .rmExpanded .rmText
{
background-position: 100% -192px;
}
.RadMenu_Skin .rmGroup .rmDisabled, .RadMenu_Skin .rmGroup .rmDisabled:hover
{
color: #aaa;
}
/* <expand arrows> */.RadMenu_Skin .rmGroup .rmExpandRight
{
height: auto;
background: transparent url( "../images/arrow.png" ) no-repeat right center; /*background: transparent url("/GSBADNN/arrow.png") no-repeat right center;*/
}
.RadMenu_Skin .rmGroup .rmExpandRight:hover
{
background-color: #001C4E;
}
.RadMenu_Skin .rmGroup .rmExpandDown
{
background-position: 100% -216px;
}
.RadMenu_Skin_rtl .rmGroup .rmItem .rmLink .rmText
{
background: transparent url( "../images/arrow.png" ) no-repeat right center; /*background: transparent url("/GSBADNN/arrow.png") no-repeat right center;*/
}
.RadMenu_Skin .rmGroup .rmLink:hover .rmExpandRight, .RadMenu_Skin .rmGroup .rmFocused .rmExpandRight, .RadMenu_Skin .rmGroup .rmSelected .rmExpandRight, .RadMenu_Skin .rmGroup .rmExpanded .rmExpandRight, .RadMenu_Skin .rmGroup .rmLink:hover .rmExpandDown, .RadMenu_Skin .rmGroup .rmFocused .rmExpandDown, .RadMenu_Skin .rmGroup .rmSelected .rmExpandDown, .RadMenu_Skin .rmGroup .rmExpanded .rmExpandDown
{
background-position: 100% -240px;
}
.RadMenu_Skin .rmGroup .rmDisabled:hover .rmExpandRight, .RadMenu_Skin .rmGroup .rmDisabled:hover .rmExpandDown
{
/*background-image: url('/../../../..arrow.png');*/
background-position: 100% -216px; /*background: transparent url("/GSBADNN/arrow.png") no-repeat right center;*/
background: transparent url( "../images/arrow.png" ) no-repeat right center;
}
/* </expand arrows> *//* <rtl> */.RadMenu_Skin_rtl .rmGroup .rmLink:hover, .RadMenu_Skin_rtl .rmGroup .rmFocused, .RadMenu_Skin_rtl .rmGroup .rmSelected, .RadMenu_Skin_rtl .rmGroup .rmExpanded
{
background-position: 100% -264px;
}
.RadMenu_Skin_rtl .rmGroup .rmLink:hover .rmText, .RadMenu_Skin_rtl .rmGroup .rmFocused .rmText, .RadMenu_Skin_rtl .rmGroup .rmSelected .rmText, .RadMenu_Skin_rtl .rmGroup .rmExpanded .rmText
{
background-position: 0 -288px;
}
.RadMenu_Skin_rtl .rmGroup .rmExpandLeft
{
background-position: 0 -312px;
}
.RadMenu_Skin_rtl .rmGroup .rmLink:hover .rmExpandLeft, .RadMenu_Skin_rtl .rmGroup .rmFocused .rmExpandLeft, .RadMenu_Skin_rtl .rmGroup .rmSelected .rmExpandLeft, .RadMenu_Skin_rtl .rmGroup .rmExpanded .rmExpandLeft
{
background-position: 0 -336px;
}
.RadMenu_Skin_rtl .rmItem .rmExpanded, .RadMenu_Skin_rtl .rmItem .rmExpanded:hover
{
background: transparent url( "../images/arrow.png" ) no-repeat right center; /*background:border: 1px solid white;     border-bottom: 0;     border-left: 0;     border-right: 0;*/ /*background: transparent url("/GSBADNN/arrow.png") no-repeat right center; background:border: 1px solid white;     border-bottom: 0;     border-left: 0;     border-right: 0;*/
}
/* </rtl> *//* </Submenu items> *//* <Submenu offsets (WebBlue - specific, overlapping submenus)> */.RadMenu_Skin .rmSlide
{
margin: -3px 0 0 1px;
}
.RadMenu_Skin .rmVertical .rmSlide, .RadMenu_Skin .rmSlide .rmSlide, .RadMenu_Skin_Context .rmGroup .rmSlide
{
margin: 0 0 0 -5px;
}
.RadMenu_Skin_rtl .rmSlide
{
margin: -3px 0 0 -1px;
}
.RadMenu_Skin_rtl .rmVertical .rmSlide, .RadMenu_Skin_rtl .rmSlide .rmSlide, .RadMenu_Skin_Context_rtl .rmGroup .rmSlide
{
margin: 0 0 0 5px;
}
/* </Submenu offsets> *//* <Scrolling arrows> */.RadMenu_Skin .rmLeftArrow, .RadMenu_Skin .rmRightArrow
{
background-color: #E0E5F5;
margin-left: 10px;
}
.RadMenu_Skin .rmLeftArrow
{
background-position: -8px -312px;
border-right: 1px solid #B7BDCD;
}
.RadMenu_Skin .rmRightArrow
{
background-position: -482px -216px;
border-left: 1px solid #B7BDCD;
}
.RadMenu_Skin .rmTopArrow, .RadMenu_Skin .rmBottomArrow, .RadMenu_Skin .rmGroup .rmLeftArrow, .RadMenu_Skin .rmGroup .rmRightArrow
{
background-color: #f0f0f0;
}
.RadMenu_Skin .rmTopArrow
{
background-position: 50% -367px;
border-bottom: 1px solid #B7BDCD;
}
.RadMenu_Skin .rmBottomArrow
{
background-position: 50% -391px;
border-top: 1px solid #B7BDCD;
}
/* </Scrolling arrows> *//* <Separators> */.RadMenu_Skin .rmVertical .rmSeparator .rmText
{
background-position: 0 -406px;
}
.RadMenu_Skin_Context .rmVertical .rmSeparator .rmText, .RadMenu_Skin .rmVertical .rmVertical .rmSeparator .rmText, .RadMenu_Skin .rmHorizontal .rmVertical .rmSeparator .rmText
{
background-position: 0 -408px;
}
.RadMenu_Skin .rmHorizontal .rmSeparator .rmText, .RadMenu_Skin .rmVertical .rmHorizontal .rmSeparator .rmText
{
background-position: 0 -386px;
}
/* </Separators> *//* </RadMenu / WebBlue> */div.RadMenu_Skin
{
background-color: rgb(255, 255, 255);
}
div.RadMenu_Skin .rmItem .rmLink
{
background-color: #001C4E;
background-image: url( "../images/MenuBack.jpg" ); /*background-image: url("/GSBADNN/MenuBack.jpg");*/
background-position: top;
background-repeat: repeat-x;
border: 1px solid white;
border-bottom: 0;
border-left: 0;
border-right: 0;
height: auto;
}
div.RadMenu_Skin .rmItem .rmLink:hover
{
background-color: rgb(52, 198, 249);
}
div.RadMenu_Skin > .rmVertical .rmLink .rmExpandRight
{
}
div.RadMenu_Skin .rmItem .rmGroup
{
 background: none; 
}
/* Rad Menu subitem */div.RadMenu_Skin .rmGroup .rmItem .rmLink
{
background-color: #34C6F9;
background-image: url( "../images/Menu_Hover_Back.png" ); /*background-image: url("/GSBADNN/Menu_Hover_Back.png");*/
color: Black;
}
div.RadMenu_Skin .rmGroup .rmItem .rmLink:hover
{
background-color: rgb(1, 31, 81);
color: White;
}
.RadMenu_Skin .rmItem .rmLink:hover
{
}
.RadMenu_Skin .rmItem .rmFocused, .RadMenu_Skin .rmItem .rmSelected
{
border: 1px solid white;
border-bottom: 0;
border-left: 0;
border-right: 0;
height:  auto;
}
.RadMenu_Skin ul.rmRootGroup, .RadMenu_Skin div.rmRootGroup
{
border: 1px solid white;
background-color: white;
border-top: none !important;
border-bottom: none !important;
}
.RadMenu_Skin .rmGroup
{
border-top: none !important;
border-bottom: none !important;
}
.RadMenu_Skin .rmItem .rmExpanded:hover
{
/*background:border: 1px solid white;     border-bottom: 0;     border-left: 0;     border-right: 0;*/
}
.rmItem rmLast
{
background-color: #34C6F9;
}
/*Selected item CSS Style */
.RadMenu_Skin .rmLink:hover, .RadMenu_Skin .focused
{
color: Black;
background-image: url( "../images/Menu_Hover_Back.png" ) !important; /*background-image: url("/GSBADNN/Menu_Hover_Back.png")!important;*/
background-repeat: no-repeat;
text-decoration: none;
background: url( "../images/arrow.png" ) no-repeat right center; /*background:  url("/GSBADNN/arrow.png") no-repeat right center;*/
}

.RadMenu_Skin a.expanded
{
/*background:  url("/GSBADNN/arrow.png") no-repeat right center;*/
background: url( "../images/arrow.png" ) no-repeat right center;
}
div.RadMenu .rmGroup .rmText {
   margin:0 0 0 14px;
   padding:0 0px 0 0px;
   text-align: left;
 }
 
 div.RadMenu .rmGroup  .rmText
{
    width: 198px !important;
}

div.RadMenu .rmRootGroup .rmText 
{      
    width: 198px !important;  
   padding: 0px; 
   
}

Thanks for time and Support.
 Vivek
Yana
Telerik team
 answered on 29 Mar 2010
3 answers
188 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
100 views
Solved
Webster Velasco
Top achievements
Rank 2
 asked on 29 Mar 2010
5 answers
469 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
90 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
94 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
123 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?