Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
109 views

Hi I use this example http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx but when I add my control:

<telerik:RadPageView runat="server" ID="RadPageView2">
<uc2:uc ID="ucmy" RowID='<%#Eval("id") %>' runat="server" />
</telerik:RadPageView>
In information about client I have always get information about the last customer in RadGrid in current page.

Please help...

Pavlina
Telerik team
 answered on 07 Aug 2009
1 answer
245 views
I get following ERROR
------------------------------------------------------------------------------------------------------------------------------------------------------------------
Microsoft JScript runtime error: Unexpected ajax response was received from the server.
This may be caused by one of the following reasons:

 - Server.Transfer.
 - Custom http handler.
- Incorrect loading of an "Ajaxified" user control.

Verify that you don't get a server-side exception or any other undesired behavior, by setting the EnableAJAX property to false.
------------------------------------------------------------------------------------------------------------------------------------------------------------------

I m getting this issue but at only site but not the other. same code i deployed on two different server, at 1 site i get this error but on other 1 i don't. its quite weird for me.

actually my this site has this issue
http://beta.texasdrivingexperience.com/CatalogofProducts/tabid/66/Default.aspx
when you click on Details button

but at this site there is no issue
http://texasdriving.premierwebplatform.com/CatalogofProducts/tabid/66/Default.aspx

code and web.config settings are the same.


but the point, which i m not getting is how could server time out within few seconds :-S

what should i do? if i set Response.RedirectLocation = Request.Url.ToString(); then i think it would redirect to login page rather giving error but actual desired operation won't be performed...





------------------------------------------------------
Pavlina
Telerik team
 answered on 07 Aug 2009
1 answer
108 views

Hi,

I've a radgrid with 2 columns - gridboundcolumn and other greidtemplate column with a dropdownlist in it.

For the dropdownlist, I'm binding the data in item databound.

These 2 columns have been created in ascx like:

 
   <Columns>
                                              <telerik:GridBoundColumn HeaderText ="Search Criteria" DataField="" UniqueName="SearchCriteria" ReadOnly="true">
                                              </telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn HeaderText="Mapped Tag" UniqueName ="MappedTag">
                                                   <ItemTemplate>
                                                      <asp:DropDownList ID="m_radMappedTagCombo" runat="server" Width="100%"></asp:DropDownList>
                                                  
                                                  </ItemTemplate>
                                                </telerik:GridTemplateColumn>
                                             </Columns>

how'll i access my gridboundcolumn in codebehind.

I need to bind some data to the grid bound column??

in cs:

List<string> strList = new List<string(){"aaa","ddd","cc"};

I need to bind strlist to my gridboundcolumn(uniquename for it is "temp").
so, how do i bind gridboundcolumn to strlist in my radgrid.

Note: i've declared my columns in .ascx

Thanks,
ZR

Tsvetoslav
Telerik team
 answered on 07 Aug 2009
3 answers
205 views
Hi,

I have a radgrid to which I am trying to create custom filter by using http://www.telerik.com/help/aspnet-ajax/grdcustomfilteroptionswithhandling.html article. I am not able to see onClick event on GridFilterMenu class. When I add onItemClick event, I am getting the following error;

System.ArgumentException: Requested value 'null' was not found.

code:

Default.aspx
<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

                <asp:ScriptManager ID="scrp" runat="server"></asp:ScriptManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
   <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server">
        <img id="imgid" src="images/loading.gif" alt="Loading" />
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
        <AjaxSettings>
           
             <telerik:AjaxSetting AjaxControlID="radioYes">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radGrid" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
              <telerik:AjaxSetting AjaxControlID="radioNo">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radGrid" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
          
               
    
            <telerik:RadGrid ID="radGrid" runat="server" AutoGenerateColumns="true" AllowPaging="true"
                 PageSize="5" EnableAjaxSkinRendering="true" AllowFilteringByColumn="true"
                Skin="Office2007">
                <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true" />
            </telerik:RadGrid>
    </div>
    </form>
</body>
</html>


Default.aspx.cs

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Telerik.Web.UI;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadRadGrid();
        }

    }

    protected void Page_Init(object sender, EventArgs e)
    {
        AddCustomGridFilters();
    }

    public void AddCustomGridFilters()
    {
        radGrid.FilterMenu.Items.Clear();
        RadMenuItem[] radMenuItems = new RadMenuItem[7];
        for (int index = 0; index < radMenuItems.Length; index++)
        {
            radMenuItems[index] = new RadMenuItem();
            radGrid.FilterMenu.Items.Add(radMenuItems[index]);
        }
        radMenuItems[0].Text = Constants.EqualTo;
        radMenuItems[1].Text = Constants.StartsWith;
        radMenuItems[2].Text = Constants.EndsWith;
        radMenuItems[3].Text = Constants.LessThan;
        radMenuItems[4].Text = Constants.GreaterThan;
        radMenuItems[5].Text = Constants.Contains;
        radMenuItems[6].Text = Constants.NoFilter;

        (radGrid.FilterMenu as GridFilterMenu).ItemClick += new RadMenuEventHandler(_Default_ItemClick);

    }

    void _Default_ItemClick(object sender, RadMenuEventArgs e)
    {
        //Do something.
    }

   

    private void LoadRadGrid()
    {
        

        this.radGrid.DataSource = GetDataTable();
        this.radGrid.DataBind();
    }

    private DataTable GetDataTable()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add(new DataColumn("ID"));
        dt.Columns.Add(new DataColumn("Name"));
        dt.Columns.Add(new DataColumn("Marks"));

        DataRow dr = dt.NewRow();
        dr["ID"] = 1;
        dr["Name"] = "Mahesh";
        dr["Marks"] = 100;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr["ID"] = 2;
        dr["Name"] = "Rajesh";
        dr["Marks"] = 55;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr["ID"] = 3;
        dr["Name"] = "Kishore";
        dr["Marks"] = 89;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr["ID"] = 4;
        dr["Name"] = "Sasi";
        dr["Marks"] = 44;
        dt.Rows.Add(dr);

        dr = dt.NewRow();
        dr["ID"] = 5;
        dr["Name"] = "Kamesh";
        dr["Marks"] = 78;
        dt.Rows.Add(dr);

        return dt;
    }

    //This class contains all the constants
    public class Constants
    {
        public const string CrtSegment = "crt";
        public const string FleetSegment = "fleet";

        // Numeric And String Constants
        public const string EqualTo = "EqualTo";
        public const string NotEqualTo = "NotEqualTo";
        public const string GreaterThan = "More than";
        public const string LessThan = "Less than";
        public const string GreaterThanOrEqualTo = "GreaterThanOrEqualTo";
        public const string LessThanOrEqualTo = "LessThanOrEqualTo";
        public const string Between = "Between";
        public const string NotBetween = "NotBetween";
        public const string ISNull = "IsNull";
        public const string ISNotNull = "NotIsNull";
        public const string NoFilter = "No filter";

        // String Constants
        public const string Contains = "Contains...";
        public const string DoesNotContain = "DoesNotContain";
        public const string StartsWith = "Starts with...";
        public const string EndsWith = "Ends with...";
        public const string IsEmpty = "IsEmpty";
        public const string IsNotEmpty = "IsNotEmpty";

        //RadContextMenu Constants
        public const string ShowColumn = "Show column";
        public const string HideColumn = "Hide column";
        public const string RestoreAll = "Restore All";

    }

}


Thanks,
Mahesh
Sebastian
Telerik team
 answered on 07 Aug 2009
3 answers
351 views
Hi,

I have an older web application using Telerik.WebControls namespace and *.NET2 assemblies. Where can I find the documentation on how to perform an upgrade of this kind of application to the latest version of Telerik controls? I tried copying the new Telerik.Web.UI.dll, updating web.config and changing all references of Telerik.WebControls to Telerik.Web.UI namespace but it's not working. Thanks for your help,

Marc
Svetlina Anati
Telerik team
 answered on 07 Aug 2009
1 answer
52 views
Hi,

I have 4 sliders within a RadPanelItem which is initially set to collapsed. when ever I expand it the 

OnValueChanged event fires for each of the sliders. is there any way for me to disable this. it seems that this event gets fired before the item click event of the radPanel if it was the other way around i could simply check for this and stop my other events.

Is there anything I can do or any guidance you can offer for this.

Thanks in advance.

Paddy

Tsvetie
Telerik team
 answered on 07 Aug 2009
4 answers
146 views
has anyone had problems dragging components onto webforms with the Q3 2008 update ?
When I try to do this in code view I get an error  'The operation could not be completed'
in code view, nothing happens at all !
sbe
Top achievements
Rank 1
 answered on 07 Aug 2009
2 answers
141 views
I am using the Telerik Skin now in 2008.03.1105.35 realease in my grid along with the skin Telerik.  The problem I have is that I like most of the skin, I just want to change the SelectedItemStyle-BackColor="#efefef" but it still shows the green selected row.  How can I override the color for the selected row in the skin?
Mike
Top achievements
Rank 1
 answered on 07 Aug 2009
2 answers
147 views
I have the following RaGrid, which displays the CommanItems "Add New Record" and "Refresh" in the Grid at TopAndBottom:
 

 

<MasterTableView Width="98%" ShowFooter="True" CommandItemDisplay="TopAndBottom">    
<CommandItemTemplate>    
    <asp:LinkButton ID="btnAddNewRecord" runat="server" CommandName="AddNewRecord" Style="vertical-align: bottom">    
        <asp:Image ID="imgAdd" runat="server" ImageUrl="~/App_ThemesCustom/images/AddRecord.gif" />   
        &nbsp;&nbsp;Add  New Record  
    </asp:LinkButton> &nbsp;&nbsp;    
    <asp:LinkButton ID="btnRefresh" runat="server" CommandName="Refresh" Style="vertical-align: bottom">    
        <asp:Image ID="imgRefresh" runat="server" ImageUrl="~/App_ThemesCustom/images/Refresh.gif" /> &nbsp;Refresh  
    </asp:LinkButton>   
</CommandItemTemplate>  

Under specific curcimstances I'd like to hide the "Add New Record" LinkButton and tried to do that on DataBound:
 
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)   
{  
    if(e.Item is GridCommandItem)   
    {  
        if (!UserHasEditAccess())   
        {   
            this.ParentPage.FindControlRecursive(this, "btnAddNewRecord").Visible = false;  
        }  
    }  
} 

 


This code works to a degree. It hides the "Add New Record" button in the "Top" of the grid, but it is still visible on the "Bottom" of the grid.

 

 

Any idea why it's not making it invisible in both the "Top" and the "Bottom"?

 

 

 

 

 

 

 

Stephan
Top achievements
Rank 1
 answered on 07 Aug 2009
5 answers
476 views
Hi

Please can you tell me how i would bind a drop down list within the form template of an edit form settings in the code behind. I have seen how to do it in the aspx like so


                                         <td> 
         <asp:DropDownList ID="ddlTOC" runat="server" SelectedValue='<%# Bind("TitleOfCourtesy") %>' 
                 DataSource='<%# (new string[] { "Dr.", "Mr.", "Mrs.", "Ms." }) %>' TabIndex="7" 
     AppendDataBoundItems="True">  
        <asp:ListItem Selected="True" Text="Select" Value=""></asp:ListItem> 
  </asp:DropDownList></td> 

but not in the code behind

many thanks
Yavor
Telerik team
 answered on 07 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?