Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
1.1K+ views
Hello,

I'm trying to see all the benefits of telerik components for a project. I'm trying to display a insert/update/delete grid on a web page. I'm working with the framework 4.0. The version of the Telerik.Web.UI.dll is 2011.1.519.40

My problem is, when i'm choose the edit button, i've got a error message

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

 

I searched on the internet about this problem but didn't find a real answer.
I can't assign false value the validationEvent tag as it's not secure.

Do you have any idea ?
Here is my code (quite simple)
My Content page

<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true"
   CodeBehind="ListeFormateurs.aspx.cs" Inherits="ProtoFTCartoAjax.ListeFormateurs" %>
  
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
   Ceci est la liste des formateurs<br />
   <br />
   <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="True" EnableViewState="True">
      <MasterTableView CommandItemDisplay="Top" DataKeyNames="Identifiant" AutoGenerateColumns="False" EditMode="InPlace"
      >
         <Columns>
            <telerik:GridEditCommandColumn ButtonType="PushButton" UniqueName="EditCommandColumn">
               <HeaderStyle Width="85px"></HeaderStyle>
            </telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn UniqueName="FirstName" HeaderText="First name"
                        DataField="Nom" />
<telerik:GridBoundColumn UniqueName="LastName" HeaderText="Last name"
                        DataField="Prenom" />
         </Columns>
      </MasterTableView>
   </telerik:RadGrid>
</asp:Content>

My aspx.cs page
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;
  
namespace ProtoFTCartoAjax
{
   public partial class ListeFormateurs : System.Web.UI.Page
   {
      protected void Page_Load(object sender, EventArgs e)
      {
            List<FormateurDto> liste = FormateurFactory.SelectAll();
            RadGrid1.DataSource = liste;
            RadGrid1.DataBind();
      }
   }
}

Thanks for your time
Alex Fuernsinn
Top achievements
Rank 1
 answered on 25 Jun 2014
7 answers
180 views
How can I get a loading panel working for the webservice binding?

Is there a built-in way?
Boyan Dimitrov
Telerik team
 answered on 25 Jun 2014
1 answer
152 views
Hi,

I have placed a RadRotator control on my form like shown below:
<telerik:RadRotator ID="AttachmentRadRotator" runat="server" RotatorType="ButtonsOver"
                                                                Width="572" Height="118px" ItemHeight="118" ItemWidth="145" FrameDuration="1"
                                                                ScrollDirection="Left,Right" OnClientItemClicked="RadRotatorOnClientItemClicked">
                                                <ItemTemplate>
                                                    <div class="itemTemplate" style="overflow: auto; overflow-y: hidden; vertical-align: top;
                                                         height: 85px;">
                                                        <img runat="server" src='<% # DataBinder.Eval(Container.DataItem,"AttachImageURL") %>'
                                                             id="AttachmentImg" alt="" class="RotatorImage" />
                                                        <br />
                                                        <asp:Label runat="server" ID="FileNameLabel" Text='<%# DataBinder.Eval(Container.DataItem, "AttachmentFileName")%>'
                                                                   CssClass="detailsLabel"></asp:Label>
                                                        <asp:HiddenField ID="VendorAttachmentHidden" runat="server" Value='<% # DataBinder.Eval(Container.DataItem,"AttachmentHiddenValues") %>' />
                                                    </div>
                                                </ItemTemplate>
                                                <ControlButtons LeftButtonID="LeftSideNavigatorImg" RightButtonID="RightSideNavigatorImg" />
                                            </telerik:RadRotator>

The problem I'm facing is that rotator's right button is not working properly. Left button works properly i.e. when it is done with showing all items it starts showing from first item. But right button unexpectedly shows blank rotator when it is done with showing all items. It doesn't rotate the items properly.

Any help in this regard would be appreaciated.

Thanks,
Priyank
Shinu
Top achievements
Rank 2
 answered on 25 Jun 2014
10 answers
466 views
Hi,
    I'm getting occasional unwanted behaviour from the RadEditor control. It is adding span tags with a background style around text like this:
<span style="background-color: #f0efef;">Broadband not working</span>

The user just entered the text "Broadband not working" into the control and the tags were added before the data was saved to the DB. [Note: the #f0efef; colour is the background colour for the control].

When the edit screen is closed, the text is displayed in a RadGrid, which has been styled to have a very dark grey background with white text on it. When this problem occurs, the white text on a (near) white background makes it unreadable.

This problem happens just on the odd occasion and I have not been able to reproduce the effect deliberately. It has happened to me but when I retraced my steps, it didn't happen again. This has generated a number of complaints from our users but I can't figure out what is causing the problem. Can anyone help?
Marina
Top achievements
Rank 1
 answered on 25 Jun 2014
2 answers
155 views
<telerik:RadTileList ID="ClientList" runat="server" AutoPostBack="True" 
             OnTileClick="ClientList_TileClick"
             SelectionMode="None" 
             TileRows="3">
            <Groups>
                 <telerik:TileGroup Name="ClientsTileGroup" ></telerik:TileGroup>
            </Groups>
    </telerik:RadTileList>

Sorry to post again but I am getting an error that I have no clue how to figure out. Here, I set OnTileClick="ClientList_TileClick" however when I click on the tile that method is never called. What it does do is refresh the page, which is really weird. The method "ClientList_TileClick" is supposed to redirect to another page. The tile group is empty but it's filled in C# code so the tiles actually exist. In Debug mode I see that the method doesn't get called. Why is that?
Shinu
Top achievements
Rank 2
 answered on 25 Jun 2014
4 answers
268 views
Radgrid with hyperlink column and Add new record functionality:-can not add hyperlink while adding record as no textbox appears to enter.

when i click on Add new record on radgrid textboxes and checkboxes appears for all
fields except Gridhyperlink column,
Could not get text box to enter link.
need solution except item template column.
Shinu
Top achievements
Rank 2
 answered on 25 Jun 2014
1 answer
433 views
Hi there,

The value of property MaxFileInputsCount set to 4 is not limiting the user to select less then 4 files for RadAsyncUpload. Is there any way to limit user to select upto 4 files in one time to upload? Any suggestion is much appreciated.

<telerik:RadAsyncUpload  ID="RadUpload1" ControlObjectsVisibility="None" MultipleFileSelection="Automatic" MaxFileInputsCount="4" TemporaryFileExpiration="01:00:00" runat="server"/>
Shinu
Top achievements
Rank 2
 answered on 25 Jun 2014
2 answers
105 views
I have a radgrid with grouping enabled.
this._RadGrid1.ClientSettings.Selecting.AllowRowSelect = true;
 this._RadGrid1.AllowMultiRowSelection = true;
 this._RadGrid1.ClientSettings.AllowGroupExpandCollapse = true;
 this._RadGrid1.ClientSettings.AllowKeyboardNavigation = true;
 this._RadGrid1.EnableGroupsExpandAll = true;
 this._RadGrid1.EnableHeaderContextFilterMenu = true;
 this._RadGrid1.GroupingEnabled = true;
 this._RadGrid1.ShowGroupPanel = true;
 this._RadGrid1.AllowFilteringByColumn = false;
 
 this._RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
 this._RadGrid1.MasterTableView.EnableHeaderContextMenu = true;
 this._RadGrid1.MasterTableView.EnableHeaderContextFilterMenu = true;        
 this._RadGrid1.MasterTableView.NoMasterRecordsText = "No BAN Assignments found";
                      
 this._RadGrid1.MasterTableView.DataKeyNames = new string[] { this._PriceDealProductBanTable.PriceDealEntityProductItemIdColumn.ColumnName };
 this._RadGrid1.MasterTableView.ClientDataKeyNames = new string[] { this._PriceDealProductBanTable.PriceDealEntityProductItemIdColumn.ColumnName };                                
 this._RadGrid1.NeedDataSource += RadGrid1_NeedDataSource;
The grid also has a text box template as followS:
templateColumn = new GridTemplateColumn();
templateColumnName = this._PriceDealProductBanTable.BillingAccountNumberColumn.ColumnName;
this._RadGrid1.MasterTableView.Columns.Add(templateColumn);
templateColumn.ItemTemplate = new TextBoxTemplate(templateColumnName);
templateColumn.HeaderText = "BAN";
templateColumn.DataField = templateColumnName;      
templateColumn.Groupable = false;

When the records are grouped, and if i select a row and change the value of the textbox, on click of save button, I get the previous value and not the new value which needs to be saved! But if the records are not grouped, it works fine!
RB
Top achievements
Rank 1
 answered on 24 Jun 2014
13 answers
779 views
I have a grid with delete button for each row and also in the commanditemtemplate. for these buttons, a confirmation dialog will popup when the user clicks on it. for the delete button in each row i can set the ConfirmationType to "RadWindow" and it does the job perfectly. But for the button in the commanditemtemplate, when i use the sample from the knowlegebase, it results in the rows' delete button to not working. I found that the javascript which is used to block the execution of the delete button in the commanditemtemplate while displaying the radconfirm dialog causes the delete button in each rows to fail when clicked. If I removed this script block, the delete button in each row shows the radconfirm dialog just fine. But of course, removing the script will cause the delete button in CommandItemTemplate to not wait for the user confirmation when clicked.

Here is the ASPX file used to reproduce this behavior:-
<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:RadWindowManager ID="RadWindowManager1" runat="server" Style="z-index: 7500" />
 
<script type="text/javascript">
    //RADCONFIRM BLOCK THREAD SCRIPT
    //MAKE SURE THAT THE FOLLOWING SCRIPT IS PLACED AFTER THE RADWINDOWMANAGER DECLARATION
 
    //Replace old radconfirm with a changed version.  
    var oldConfirm = radconfirm;
    //TELERIK
    //window.radconfirm = function(text, mozEvent)
    //We will change the radconfirm function so it takes all the original radconfirm attributes
    window.radconfirm = function (text, mozEvent, oWidth, oHeight, callerObj, oTitle) {
        var ev = mozEvent ? mozEvent : window.event; //Moz support requires passing the event argument manually  
        //Cancel the event  
        ev.cancelBubble = true;
        ev.returnValue = false;
        if (ev.stopPropagation) ev.stopPropagation();
        if (ev.preventDefault) ev.preventDefault();
 
        //Determine who is the caller  
        callerObj = ev.srcElement ? ev.srcElement : ev.target;
 
        //Call the original radconfirm and pass it all necessary parameters  
        if (callerObj) {
            //Show the confirm, then when it is closing, if returned value was true, automatically call the caller's click method again.  
            var callBackFn = function (arg) {
                if (arg) {
                    callerObj["onclick"] = "";
                    if (callerObj.click) callerObj.click(); //Works fine every time in IE, but does not work for links in Moz  
                    else if (callerObj.tagName == "A") //We assume it is a link button!  
                    {
                        try {
                            eval(callerObj.href)
                        }
                        catch (e) { }
                    }
                }
            }
            //TELERIK
            //oldConfirm(text, callBackFn, 300, 100, null, null);      
            //We will need to modify the oldconfirm as well               
            oldConfirm(text, callBackFn, oWidth, oHeight, callerObj, oTitle);
        }
        return false;
    
</script>
 
<div>
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" AllowMultiRowSelection="true">
        <ClientSettings EnableRowHoverStyle="true">
            <Selecting AllowRowSelect="true" EnableDragToSelectRows="false" />
        </ClientSettings>
        <MasterTableView CommandItemDisplay="Top">
            <CommandItemTemplate>
                <div>
                    <asp:LinkButton ID="LinkButton2" OnClientClick="return radconfirm('The selected application(s) will be deleted.\n\nClick OK to confirm.', event, null, null, '', 'Delete')"
                        runat="server" CommandName="DeleteSelected" CausesValidation="false">Delete</asp:LinkButton>   
                    <asp:LinkButton ID="LinkButton3" runat="server" CommandName="RebindGrid">Reload</asp:LinkButton>   
                </div>
            </CommandItemTemplate>
            <Columns>
                <telerik:GridClientSelectColumn HeaderStyle-Width="26px" ItemStyle-Width="26px" />
                <telerik:GridBoundColumn DataField="intcol" HeaderText="intcol" />
                <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Delete" ConfirmText="Delete?"
                    Text="Delete" ConfirmDialogType="RadWindow">
                </telerik:GridButtonColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
</div>

How do I make both set of delete buttons (in the CommandItemTemplate and in each row) to work as intended, ie. upon clicking, shows the radconfirn dialog for the user to confirm?

Thanks,
Sonny
Top achievements
Rank 1
 answered on 24 Jun 2014
0 answers
102 views
I need a urgent help trying to create multiple series on a chart. One series two is drawing on the chart and I don't know what I am missing. Below is my code and attached is an image of what I am getting now. I need something like what is in this link.
http://www.telerik.com/help/reporting/understandingelementsseriesseriesproperties.html
Any help will be appreciated.

private void chart1_NeedDataSource(object sender, EventArgs e)
        {
            DataSet ds;
            Telerik.Reporting.Processing.Chart chart;
            DateTime stepDate;
            DateTime stepDateNew;
            string interval, AverageName, AverageNameNew, pointLabel, pointLabelnew, interval2;
            int average, Child1, Child2, step, statusId;

            if (_series == null || _seriesNew == null)
            {

                chart = sender as Telerik.Reporting.Processing.Chart;

                ds = CreateChartDataSet();

                DataView view = ds.Tables[0].DefaultView;

                Telerik.Reporting.Chart chartDef = (Telerik.Reporting.Chart)chart.ItemDefinition;
                _series = new Telerik.Reporting.Charting.ChartSeries();
                _seriesNew = new Telerik.Reporting.Charting.ChartSeries();

                AverageName = string.Empty;
                AverageNameNew = string.Empty;

                SetXAxisRange(view);

                foreach (DataRowView rowView in view)
                {
                    statusId = (int)rowView["ID"];
                    step = int.Parse(rowView["Step"].ToString());
                    average = (int)rowView["average"];
                    interval = rowView["Interval"].ToString();
                    interval2 = rowView["IntervalNew"].ToString();
                    handlingPlanName = rowView["AverageName"].ToString();
                    handlingPlanNameNew = rowView["AverageNameNew"].ToString();
                    likelihood = (int)rowView["Child1"];
                    consequence = (int)rowView["Child2"];                   
                    if (interval != interval2 )
                    {
                        DateTime.TryParse(interval, out stepDate);
                        string str = null;
                        str += stepDate.ToString("MM/dd/yy");
                        pointLabel = str;
                    }

                    else
                        pointLabel = string.Empty;
                     
                    if (interval != interval2)
                    {
                        DateTime.TryParse(interval2, out stepDateNew);
                        string strNew = null;
                        strNew += stepDateNew.ToString("MM/dd/yy");
                        pointLabelnew = strNew;
                    }
                    else
                        pointLabelnew = string.Empty;

/*******Below this  code is the only portion showing on the report ********************************************/
                    Telerik.Reporting.Charting.ChartSeriesItem seriesItem = CreateSeriesItem(pointLabel, average, statusId);

                    _series.AddItem(seriesItem);


                    Telerik.Reporting.Charting.ChartSeriesItem seriesItemNew = CreateSeriesItemNew(pointLabelnew, average, statusId);

                    _seriesNew.AddItem(seriesItemNew);
                    //}
                    foreach (DataRow dtrow in ds.Tables[0].Rows)
                    {

                        if (string.IsNullOrEmpty(handlingPlanName) && DateTime.TryParse(interval, out stepDate))
                            handlingPlanName = "New Report to Check Children's age";                                             

                    }
                    _series.Appearance.LineSeriesAppearance.Color = Color.Teal;
                    _series.Name = handlingPlanName;
                    _series.Type = ChartSeriesType.Line;
                    chart1.ChartTitle.TextBlock.Text = "New Report to Check Children's age";
                    chartDef.Series.Clear();
                    chartDef.Series.Add(_series);

                    foreach (DataRow dtrowNew in ds.Tables[0].Rows)
                    {
                        if (string.IsNullOrEmpty(AverageNameNew) && DateTime.TryParse(interval2, out stepDateNew))
                            handlingPlanNameNew = "New Report to Check Children's age";

                    }
                    _seriesNew.Appearance.LineSeriesAppearance.Color = System.Drawing.Color.Black;
                    _seriesNew.Appearance.LineSeriesAppearance.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
                    _seriesNew.Appearance.LineSeriesAppearance.PenStyle = System.Drawing.Drawing2D.DashStyle.Dash;
                    _seriesNew.Appearance.LineSeriesAppearance.Width = 5;
                    _seriesNew.Name = AverageNameNew;
                    _seriesNew.Type = ChartSeriesType.Line;
                    chart1.ChartTitle.TextBlock.Text = "New Report to Check Children's age";
                    chartDef.Series.Clear();
                    chartDef.Series.Add(_seriesNew);

                }

            }

        }
Ebenezer
Top achievements
Rank 1
 asked on 24 Jun 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?