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

Hello,

I'm experiencing some trouble in the google-like filtering demo ( http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandcombo/defaultcs.aspx?product=grid ).

The ItemRequested event is never fired, Loading statement stands forever without displaying any results.

This is my implementation of the gridboundcolumn :

protected override void SetupFilterControls(TableCell cell)

{

    base.SetupFilterControls(cell);

    cell.Controls.RemoveAt(0);

    RadComboBox combo = new RadComboBox();

    combo.ID = ("RadComboBox1" this.DataField);

    combo.ShowToggleImage = false;

    combo.Skin = "WebBlue";

    combo.EnableLoadOnDemand = true;

    combo.AutoPostBack = false;

    combo.MarkFirstMatch = true;

    combo.Height = Unit.Pixel(100);

    combo.ItemsRequested += new RadComboBoxItemsRequestedEventHandler(this.combo_ItemsRequested);           

    combo.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(this.list_SelectedIndexChanged);

    //cell.Controls.Clear();

    cell.Controls.AddAt(0, combo);

    cell.Controls.RemoveAt(1);

}

 

//RadGrid will call this method when the value should be set to the filtering input control(s)

protected override void SetCurrentFilterValueToControl(TableCell cell)

{

    base.SetCurrentFilterValueToControl(cell);

    RadComboBox combo = (RadComboBox)cell.Controls[0];

    if ((this.CurrentFilterValue != string.Empty))

    {

        combo.Text = this.CurrentFilterValue;

    }

}

 

//RadGrid will cal this method when the filtering value should be extracted from the filtering input control(s)

protected override string GetCurrentFilterValueFromControl(TableCell cell)

{

    RadComboBox combo = (RadComboBox)cell.Controls[0];

    return combo.Text;

}

 

private void combo_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)

{           

    ((RadComboBox)o).DataTextField = this.DataField;

    ((RadComboBox)o).DataValueField = this.DataField;

 

    if (this.UniqueName == "Autore")

    {

        try

        {

            ((RadComboBox)o).DataSource = MYSOLUTION.DataLayer.GestioneAnomalie.GestioneAnomalieDataProvider.GetAutori(e.Text);

        }

        catch (Exception ex)

        {

            throw (ex);

        }

    }

    else if (this.UniqueName == "Note")

    {

        try

        {

            ((RadComboBox)o).DataSource = MYSOLUTION.DataLayer.GestioneAnomalie.GestioneAnomalieDataProvider.GetNote(e.Text);

        }

        catch (Exception ex)

        {

            throw (ex);

        }

    }

    ((RadComboBox)o).DataBind();

}

 

private void list_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)

{

    GridFilteringItem filterItem = (GridFilteringItem)((RadComboBox)o).NamingContainer;

    if ((this.UniqueName == "Index"))

    {

        //this is filtering for integer column type

        filterItem.FireCommandEvent("Filter"new Pair("EqualTo"this.UniqueName));

    }

    //filtering for string column type

    filterItem.FireCommandEvent("Filter"new Pair("Contains"this.UniqueName));

}       


RadGrid is in an ASCX file, it is placed in a RadAjaxPanel. A RadAjaxManager is also present down below the RadGrid, outside of the Ajax Panel.

<telerik:RadGrid

    ID="RadGridGestioneAnomalie"

    runat="server"

    AutoGenerateColumns="False"

    AllowFilteringByColumn="true"

    DataSourceID="LinqDataSourceAnomalie"

    GridLines="Both"

    Skin="WebBlue"

    AllowMultiRowSelection="True"

    AllowMultiRowEdit="True"   

    SortingSettings-SortedBackColor ="AliceBlue"

    SortingSettings-SortToolTip ="Ordina in base ai valori di questa colonna"

     

    ShowStatusBar="true"

    StatusBarSettings-LoadingText "Caricamento in corso"

    StatusBarSettings-ReadyText "Gestione Anomalie"

    PageSize="50"          

    PagerStyle-ForeColor="Black"

    PagerStyle-Position="TopAndBottom"  

    PagerStyle-AlwaysVisible="true"    

     

    EnableLinqExpressions="true"

    oninit="RadGridGestioneAnomalie_Init"

    onitemdatabound="RadGridGestioneAnomalie_ItemDataBound"

    onitemcommand="RadGridGestioneAnomalie_ItemCommand"

    oneditcommand="RadGridGestioneAnomalie_EditCommand"

    onitemcreated="RadGridGestioneAnomalie_ItemCreated"

    OnSortCommand="RadGridGestioneAnomalie_SortCommand"

    OnColumnCreating="RadGridGestioneAnomalie_ColumnCreating"

    oninsertcommand="RadGridGestioneAnomalie_InsertCommand"

    OnPreRender="RadGridGestioneAnomalie_PreRender"

    >

    <ExportSettings IgnorePaging="true" OpenInNewWindow="true" FileName="GestioneAnomalie" ExportOnlyData="true">

                    <Pdf FontType="Subset" PaperSize="Letter" AllowPrinting="true" />

                    <Excel Format="Html"  />

                    <Csv ColumnDelimiter="Comma" RowDelimiter="NewLine"  />

    </ExportSettings>

    <MasterTableView

     

        GroupLoadMode ="Client"

        HierarchyLoadMode="Client"      

                        CurrentResetPageIndexAction="SetPageIndexToFirst"         

        VirtualItemCount="50" 

        datakeynames="ID_Anomalia"

        datasourceid="LinqDataSourceAnomalie" 

        CommandItemDisplay="TopAndBottom" 

        GroupHeaderItemStyle-BackColor="LemonChiffon"

        AllowPaging ="true"

        AllowCustomSorting "true"

        AllowFilteringByColumn "true"

        AutoGenerateColumns="false"

        AllowSorting ="true"

        AllowNaturalSort="false" 

        PagerStyle-Mode="NextPrevNumericAndAdvanced"

        PagerStyle-BackColor="LightGray"

        PagerStyle-ForeColor="Black"

        PagerStyle-Position="TopAndBottom"

                                 

        Name="Anomalie"

        NoMasterRecordsText="Nessuna anomalia da mostrare"

        AllowAutomaticDeletes="True"

        AllowAutomaticUpdates="True" AllowAutomaticInserts="True"

        CanRetrieveAllData="True"                

        >


In the Page_Load, I pull out every column and later I put my personal dropdownfiltercolumn just for those column that has got particular UniqueName... here there's the code-behind :

protected void Page_Load(object sender, EventArgs e)

{

    EnsureUpdatePanelFixups();

 

    codiceProcesso = this.Page.Request.QueryString.Get(URLFactory.Param_ProcessoRilevatore);

 

    if (!(UserRole.isControlloQualita() || UserRole.isRilevatoreDelProcesso(codiceProcesso) || UserRole.isValidatoreDelProcesso(codiceProcesso))) 

    {

        // Per ora disabilito

        RadGridGestioneAnomalie.Visible = false;

        //RadGridTotaliOperazioni.Visible = false;

    }

 

     

    RadGridGestioneAnomalie.MasterTableView.IsItemInserted = false;

     

    LeggiParametriRicerca();

 

     

    #region Creazione Filtro DropDown

     

    if (!IsPostBack)

    {

        _rgSupporto = new List<GridColumn>();

        foreach (GridColumn colonna in RadGridGestioneAnomalie.MasterTableView.Columns)

        {

            _rgSupporto.Add(colonna);

        }

 

        RadGridGestioneAnomalie.MasterTableView.Columns.Clear();

 

        if (_rgSupporto.Count > 0)

        {

            foreach (GridColumn col in _rgSupporto)

            {

                if ((col.UniqueName == "Autore") || (col.UniqueName == "Note"))

                {

                    DropDownFilter gridColumn = new DropDownFilter();

                    this.RadGridGestioneAnomalie.MasterTableView.Columns.Add(gridColumn);

                    gridColumn.DataField = col.HeaderText;

                    gridColumn.HeaderText = col.HeaderText;

                }

                else

                    this.RadGridGestioneAnomalie.MasterTableView.Columns.Add(col);

            }

        }

    }


any help is appreciated

thanks
Giovanni

 

Pavlina
Telerik team
 answered on 26 Oct 2010
2 answers
194 views
Finally figured out how to get the code on the master page to deal with this... Would delete this post, but I do not see an option...










I have master page and on this page I have a javascript section that I need to have search the current page to see if a radgrid is on that page.

I tried 
   var control = document.getElementById('<%= RadGridStudents.ClientID %>');
                if (control == null) {
but it returns an error because the grid is not there - of course.



What is the best way in javascript to see if the current page has an element on it before continuing...

Mira
Telerik team
 answered on 26 Oct 2010
2 answers
136 views
Hi guys :)

Im having trouble positioning the RadMenu where I want it in my DNN skin.

So far, I have it positioned fine in FF and IE8, but in IE7/6, the menu magically appears about 20px higher than its meant to. Im using the backdated IE renderer at : http://ipinfo.info/netrenderer/index.php to test my menu.

Im a little confused as to why its sitting so high in IE7/6, but perfect in IE8/FF.

Any hints?

Ill post my CSS below, THANKS!!

Test URL is at :
http://ccngroup.com.au.dnnmax.com/skintest.aspx

--SkinObject Code--

<div style="float:right; width: 100%;"><dnn:RADMENU id="dnnRADMENU" runat="server" <br>                            Skin="Menu"<br>                            EnableEmbeddedSkins="false"  <br>                            CollapseDelay="500" <br>                            ShowPath="True"<br>                            Width="100%"<br>                            Flow="Horizontal"<br>                            Align="Right"<br>                            ImagesOnlyMenu="false"<br>                            EnableAdminMenus="true"<br>                        /></div><br>


-- CSS Code --

/* RADMenu */
.rwMenu{ text-align:right; clear:both;width:100%;padding:0px 0px 0px 0px; z-index:999 !Important;}
.Admin .rwMenu{clear:both;width:100%;padding:0px 0px 0px 0px;}
.RadMenu{float: none !Important; width:100%;}
.rmRootGroup{ width:100%; margin:0px; padding: 0px;}

/* Root Level - Menu Items */
.RadMenu_Menu .rmRootGroup .rmItem { padding:0px; border:#0F0; float: right;}
.RadMenu_Menu .rmRootGroup .rmItem .rmLink{padding:0px;}
.RadMenu_Menu .rmRootGroup .rmItem .rmLink:hover{text-decoration:none;}
.RadMenu_Menu .rmRootGroup .rmItem .rmLink .rmText { font-weight:normal ;font-size:12px; line-height:33px;font-family: Arial, sans-serif, Verdana; text-transform:uppercase; color:#FFF;cursor:pointer;}
.RadMenu_Menu .rmRootGroup .rmItem .rmLink:hover .rmText{color: #000000;}
.RadMenu_Menu .rmRootGroup .rmItem .rmLink:hover img{ cursor: pointer;}
.RadMenu_Menu .rmRootGroup .rmItem .rmFocused .rmText{color: #FFFFFF;}

/* Child Level - Menu Items */

.RadMenu_Menu .rmGroup{ margin:0px; padding:0px; width: 125px;text-align:center; border-bottom: 1px solid #FFF; border-left: 1px solid #FFF; border-right: 1px solid #FFF;}
.RadMenu_Menu .rmGroup .rmItem{ background-color:#b9122b; padding:0px;margin:0px; width: 125px; text-align:center; }
.RadMenu_Menu .rmGroup .rmItem:hover{ cursor:pointer; background-color:#FFF;}

.RadMenu_Menu .rmGroup .rmItem .rmLink{text-decoration:none;padding:0px;margin:0px; text-align:center; width: 125px;}
.RadMenu_Menu .rmGroup .rmItem .rmLink .rmText{color:#FFFFFF;line-height:24px;font-size:12px;font-weight:normal;padding:0px;margin:0px;text-align:center;}
.RadMenu_Menu .rmGroup .rmItem .rmLink:hover .rmText{color: #000000;}

.RadMenu_Default{z-index:7010 !Important;}
Peter
Telerik team
 answered on 26 Oct 2010
1 answer
92 views
The issue looked very bizzarre to me.
- I am using a RadAjaxManagerProxy on my user control. (I do have a RadAjaxManager on my MasterPage)
- I am using a Form Decorator (on Masterpage) which decorates "All" elements it can.
I have 3 buttons in the user control, mark up related to them is,
<ASP:BUTTON id="btSmptApply" runat="server" Width="100px"  Text="Apply"
Enabled="False" onclick="btSmptApply_Click" ValidationGroup="mail"
meta:resourcekey="btSmptApplyResource1"></ASP:BUTTON> &nbsp;
<ASP:BUTTON id="btVerifySmtp" runat="server" Width="100px"  Text="Verify"
ENABLED="False" onclick="btVerifySmtp_Click"  ValidationGroup="mail"

 meta:resourcekey="btVerifySmtpResource1"></
ASP:BUTTON>&nbsp;
<
ASP:BUTTON id="btSMTPCancel" runat="server" Width="100px"  Text="Reset"
 CAUSESVALIDATION="False" onclick="btCancel_Click"
meta:resourcekey="btSMTPCancelResource1">
</
ASP:BUTTON>&nbsp;

The settings of these buttons in RadAjaxManagerProxy is,
<telerik:AjaxUpdatedControl ControlID="btSmptApply"></telerik:AjaxUpdatedControl>
<
telerik:AjaxUpdatedControl ControlID="btVerifySmtp"></telerik:AjaxUpdatedControl>
<
telerik:AjaxUpdatedControl ControlID="btSMTPCancel"></telerik:AjaxUpdatedControl>

When these lines are enabled, the buttons align Vertically automatically, the following html is inserted automatically for each button:
<div style="display: block;" id="ctl00_ctl00_ContentPlaceHolder1_ConfigureMailServer1_btVerifySmtpPanel">

When I comment out the above lines of RadAjaxManagerProxy, the buttons align horizontally(as I want them to be).
My Questions:
1. Why is this happening?
2. What does RadAjaxManager to do with Alignment?
3. I worked with conventional Ajax (xmlHttpRequest object) etc alot. What role does RadAjaxManager play? why is it needed in a webpage?

Please let me know as soon as possible. Thanks in advance.



Pavel
Telerik team
 answered on 26 Oct 2010
1 answer
215 views
i read http://www.telerik.com/help/aspnet-ajax/ajxaddajaxrequesttoclientevent.html and made a similar demo, when client-side call
the TextBoxCustomAjax function to use Ajax send the request to server, server-side event RadAjaxManager1_AjaxRequest can be fired, and Label1.Text also updated value, but client-side cannot see any the updated result, why? i'm using RadControls 2010 for Ajax asp.net and VS 2010, these are my full demo code:
///////////////////////////////////////////////////////////////////////////////AddAjaxToHtmlElement.aspx///////////////////////////////////////////////////
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddAjaxToHtmlElement.aspx.cs" Inherits="AddAjaxToHtmlElement"  %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        //Put your JavaScript code here.
        function TextBoxCustomAjax(eventArgs) {
            $find("<%=RadAjaxManager1.ClientID %>").ajaxRequest(eventArgs);
        }
    </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >

    </telerik:RadAjaxManager>
    <div>
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">
             <asp:Label ID="Label1" runat="server" Text="Label1" /><br />
             <asp:TextBox ID="TextBox1" runat="server"
                 onkeyup="TextBoxCustomAjax('TextBox1');" type="text" /> <br />
        </telerik:RadAjaxPanel>

    </div>
    </form>
</body>
</html>
///////////////////////////////////////////////////////////////////////////////////////////////////////AddAjaxToHtmlElement.aspx.cs/////////////////////////////////////////////////////////
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

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

public partial class AddAjaxToHtmlElement : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        RadAjaxManager1.AjaxRequest += RadAjaxManager1_AjaxRequest;
    }
    protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        if (e.Argument == TextBox1.ClientID)
        {
            Label1.Text = TextBox1.Text;
            Page.Title = TextBox1.Text;
        }
    }
}
/*
  note :
            Label1.Text = TextBox1.Text;
            Page.Title = TextBox1.Text;
    Page.Title can be updated, but Label1.Text cannot be updated!!!
    why??
*/
Pavel
Telerik team
 answered on 26 Oct 2010
1 answer
123 views
Hello!

Guys, I need help using your scheduling control as I'm finding myself in a troubled scenario. I'm attaching a cut-down version of my database.

I require a schedule in the form of an organizer. Required design concept excel and image attached.

Some facts:
  • Every Locum can have a maximum of two Jobs in a single day. So the maximum items (jobs) available per day is two.

I hope you guys can help me out.

--
Regards,
Hassan Gulzar
Peter
Telerik team
 answered on 26 Oct 2010
1 answer
217 views
I need to use StateServer mode for session state in my application, but doing so returns the error: "Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode."

I'm using the .cs example code from \Telerik\RadControls for ASP.NET AJAX Q2 2010\Live Demos\Grid\Examples\Programming\DragAndDrop folder.  Is there any way to get this code to work using StateServer sessionState mode rather than InProc mode?
Daniel
Telerik team
 answered on 26 Oct 2010
1 answer
82 views
Hi Telerik,

Am using radgrid with filter enabled. Is there any way in radgrid to access the filtered result set before it binds to the Grid. Or any event which is fired before the filtered data is bound to the Grid? Please give me a solution for this as soon as possible.

Thanks
Priya
Marin
Telerik team
 answered on 26 Oct 2010
2 answers
197 views
Hi There,

we recently decided to begin the process of upgrading our product so that it becomes compatible with Telerik RadControls ASP.NET AJAX. We've spent a number of days now reading different KB articles and watching some upgrade videos but have been running into the same problems regardless. Our product is a .NET 2.0 application with no prior use of AJAX, so we also had to look into editing the web.config so that it supports System.Web.Extensions. 

There have been two errors that visual studio constantly prompts us about once we go through the process of replacing the register directive with 'Telerik.Web.UI' and then deleting the older DLLs. (We are also receiving errors for Telerik.Charting but this is another story i think...)

 ASP.NET runtime error: The base class includes the field 'radGdUserGroup', but its type (Telerik.WebControls.RadGrid) is not compatible with the type of control (Telerik.Web.UI.RadGrid). <<FILENAME>>

ASP.NET runtime error: Could not load file or assembly 'RadTreeView.Net2' or one of its dependencies. The system cannot find the file specified.  <<FILENAME>>

We really hope that you guys can assist in helping to remove these errors from our solution so that we can continue using the Telerik suite.

Regards

A.

Mak
Top achievements
Rank 1
 answered on 26 Oct 2010
1 answer
75 views

Hello all,
 

I have a form which has 7 grids, one grid per weekday.

For each grid I dynamically create a datatable because the column layout can change.

I use a HeaderTemplate because I need to merge headers, an ItemTemplate and an EditTemplate.

 

The form is displayed correctly, however I’d like all rows to be directly in EditMode, which I set in the PreRender event.

When I then trigger the Rebind event, it takes endlessly (up to 40 seconds) until the form is displayed. If I disable the EditMode, it’s displayed right away. (See attached pictures)

 
Any help would be appreciated.

 

Ulrich

Marin
Telerik team
 answered on 26 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?