Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
183 views
I have an application that has been running for over a month now with no problems. Suddenly I am getting the following error when executing an inset or updated on the grids.

Server Error in '/' Application.
--------------------------------------------------------------------------------
  
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. 

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.ArgumentException: 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.
  
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: 
  
  
[ArgumentException: 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.]
   System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +8627289
   System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) +72
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +35
   System.Web.UI.WebControls.Button.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) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
  
   
  
  
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618

Can someone tell me what is happening here and how to overcome it? It's hopefully a simple fix. I can't figure out it is suddenly acting so bizzare.
Iana Tsolova
Telerik team
 answered on 14 Dec 2010
3 answers
163 views

Hello,

I've got a trouble with dropdown column databinding in a RadGrid :
I've got 2 columns in my grid, one dropdown binded to a "Code" column, and one griddatabound column binded to a "Libelle" column
When I display the RadGrid, the "Code" column always display the first element of the dropdown column.
So the selected item in the drop down list is always the first element, not the data item.
When I am in edit mode, the dropdownlist is well binded.
Note that the RadGrid and The GridDropDown column are binded on objects of the same type.
Thanks for your help.
Here is my aspx code :

<%@ Control AutoEventWireup="false" CodeBehind="wucAdminEditions.ascx.vb" Inherits="FilsRSSInternes.wucAdminEditions" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  
<telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">
    <script language="javascript" type="text/javascript">
        function verifierSelectionEditions() {
            var grid = $find("<%=GrilleAdminEditions.ClientID %>");
            if (grid != null) {
                if (grid.get_selectedItems().length > 0) {
                    return true;
                } else {
                    alert('Aucune édition sélectionnée');
                    return false;
                }
            }
        }
    </script>
</telerik:RadScriptBlock>
<telerik:RadAjaxPanel ID="PanelEditions" runat="server" EnableAJAX="true">
    <div style="text-align:left;width:80%;padding:10px;">
        <asp:Label ID="lblMsg" runat="server" CssClass="MessageErreur"></asp:Label>
    </div>
    <div style="text-align:right;width:80%;padding:10px;">
        <telerik:RadGrid runat="server" ID="GrilleAdminEditions" ShowStatusBar="true" ShowHeader="true"
            AutoGenerateColumns="false" AllowSorting="true" AllowMultiRowSelection="true"
            EnableEmbeddedSkins="true" Width="100%" Skin="Windows7" SkinID="Windows7"
            AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true"
            PageSize="20" PagerStyle-AlwaysVisible="true" AllowPaging="true" 
            GroupingEnabled="false" ShowGroupPanel="false" 
            ClientSettings-AllowDragToGroup="false" ClientSettings-Selecting-AllowRowSelect="false"
            SortingSettings-SortToolTip="Cliquer pour trier la colonne" SortingSettings-SortedDescToolTip="Tri ascendant" SortingSettings-SortedAscToolTip="Tri descendant"
            DataSourceID="ListeEditionsADM"
            OnItemDataBound="GrilleAdminEditions_ItemDataBound">
                <MasterTableView runat="server" PageSize="20" NoMasterRecordsText="Aucun abonnement disponible pour les éditions de la mise à jour" NoDetailRecordsText="Aucun abonnement disponible pour les éditions de la mise à jour"
                        ShowHeadersWhenNoRecords="true"
                        AllowAutomaticDeletes="true"
                        AllowAutomaticInserts="true"
                        AllowAutomaticUpdates="true"
                        CommandItemDisplay="Top"
                        EditMode="InPlace"
                        AutoGenerateColumns="false"
                        DataSourceID="ListeEditionsADM"
                        >
                    <Columns>
                        <telerik:GridDropDownColumn HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" UniqueName="Code" DataField="Code" DataSourceID="ListeEditionsABO" ListTextField="Code" ListValueField="Code" DropDownControlType="DropDownList">
                        </telerik:GridDropDownColumn>
                        <telerik:GridBoundColumn HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" HeaderText="Titre" UniqueName="Libelle" DataField="Libelle">
                        </telerik:GridBoundColumn>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                            <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                        </telerik:GridEditCommandColumn>
                        <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                            ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                            UniqueName="DeleteColumn">
                            <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                        </telerik:GridButtonColumn>
                        <telerik:GridButtonColumn ButtonType="ImageButton" ItemStyle-HorizontalAlign="Center" UniqueName="imgAbonner">
                        </telerik:GridButtonColumn>
                    </Columns>
                </MasterTableView>
                <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric"
                    FirstPageText="" FirstPageToolTip="Aller à la première page"
                    NextPageText="" NextPageToolTip="Aller à la page suivante"
                    LastPageText="" LastPageToolTip="Aller à la dernière page"
                    PrevPageText="" PrevPageToolTip="Aller à la page précédente"
                    NextPagesToolTip="Afficher les pages suivantes" PrevPagesToolTip="Afficher les pages précédentes"
                    PagerTextFormat="{4}{5} édition(s) sur {1} page(s)"
                />
        </telerik:RadGrid>
    </div>
</telerik:RadAjaxPanel>
<asp:ObjectDataSource ID="ListeEditionsABO" runat="server" SelectMethod="GetListeEditionsABO" TypeName="FilsRSSInternes.EditionMAJ"></asp:ObjectDataSource>
<asp:ObjectDataSource ID="ListeEditionsADM" runat="server" SelectMethod="GetListeEditionsADM" TypeName="FilsRSSInternes.EditionMAJ"></asp:ObjectDataSource>
Veli
Telerik team
 answered on 14 Dec 2010
1 answer
174 views
i'll be blunt - i DO NOT like the new keyboard navigation feature of the radgrid.  the idea is great but it needs heavy work.

If you do not use the keys to navigate and instead click on a row, it always scrolls the page so that the top of the radgrid is in the browser window.  This is especially annoying if you scroll to the bottom of the page and want to double click on a row to edit it.  The radgrid instead opens some other random row to edit.

you can use the up and down arrow keys to highlight a row but why can you not click on a row to highlight it?

if i have 200 rows in my radgrid and i want to edit the 100th row using keyboard navigation, it is horribly inconvenient to step through the entire grid with the arrow keys.  Am i missing something? can someone tell me how to use the keyboard to get to that row faster?
[update] so i found out how to select a specific row by clicking on it but if this row is down on the page, click on it will select it but it will cause the radgrid to scroll to the top of the page - VERY FRUSTRATING [/update]

i like the old style where you could use javascript to double click on a row to edit it and then press enter to save the changes.  Now, pressing enter causes the radgrid to cancel the changes you made in the edit row and instead put the top row in edit mode.  What do i have to do so that i can keep the double-click-to-edit functionality and then press enter to save those changes in the current row being edited and avoid the screwey things the radgrid is doing now.
Tsvetina
Telerik team
 answered on 14 Dec 2010
3 answers
198 views
Just wanted to state i think these controls are great!! just having a little trouble adapting.

This is what im trying to do.

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)   
{         
  
this.TextBox1.Text = GridView1.SelectedRow.Cells[1].Text;
}

but using the new radgrid its different. can someone help? thanks!


-EricPacheco

Veli
Telerik team
 answered on 14 Dec 2010
1 answer
27 views
So I've fixed my other problem with the grid not calling my web service and now things are half working. I've got a background thread that's adding objects to a collection (thread safe) every second, and the grid simply refreshes every second and displays all of these objects. This works fine until there are more than 10 objects in the collection, then the grid stops displaying all of the objects fields except one. Screen shot below:

The EventTime is a DateTime property of the object, so the grid is for some reason displaying that property, but ignoring all of the other properties on all objects after Message 21. Any idea's what's going on?
Iana Tsolova
Telerik team
 answered on 14 Dec 2010
3 answers
60 views
Hello,

I am new to using RadControls. I do get the concept of having to cast a nested control using the .FindControl method. However, I am noticing that if I wish to start coding for an event for a button nested inside of a RadControlPanel, for example, since I can not see my button listed as an available control, I can not view and select any of its events either.

I do notice that in a tutorial, there is an example showing how events may be wired up to a nested control, however I am unsure how one comes up with the first block of say the Button_Click event. I am hoping coding for all nested controls will be as easy as coding with .net has always been... I want to be able to choose the "Click" event of my Button and then begin coding with the Button_Click event code block being generated as it always has been. I definitely do NOT want to have to copy and paste this from any where else, or start coding with the control outside of the panel and then simply move the control inside of the panel when done. This seems awkward and a step backward and I am really hoping there is a better way to go about this. If not, this would likely be a deal breaker for us.

Thanks,
Nelson
Nikolay Tsenkov
Telerik team
 answered on 14 Dec 2010
1 answer
142 views
I'm really struggling with this and am sure it's a case of being too deep in it to see the solution...

I'm adding an unknown number of PanelBar items to a RadPanelBar and for each one I'm displaying a RadGrid, essentially giving a user a list of categories (the RadPanelBar items) and a list of items in each category below (in the RadGrid).

The RadGrids need to display static data about each line (part number, description and unit cost) along with a textbox so the user can pick a quantity, and then have a calculated column display the unit cost multiplied by the textbox value (obviously validated to be a number)

However, while I can build the RadPanelBar, PanelBar items, build and attach the RadGrid to each PanelBar, data bind the RadGrids and display the static columns in each one, I simply cant see how to add the textboxes or how to work out what the datafields should be for the calculated column.

If anyone has a sample script (csharp pref) of how to add a textbox column and a calculated column that uses the textbox column then I;d REALLY appreciate it.

Thanks,
Karl
Tsvetina
Telerik team
 answered on 14 Dec 2010
1 answer
110 views
Hi,

I have added some javascript to the filter button that appears at the side of the text box on RAD Grid filter to basically clear the filter when the user clicks it rather than bring a menu down etc.  Heres the code I used:

<ClientSettings>
     <ClientEvents OnFilterMenuShowing="filterMenuShowing" />
</ClientSettings>

function
filterMenuShowing(sender, args) {
    var filterRow = args.get_tableView().get_tableFilterRow();
    var columnName = args.get_column().get_uniqueName();
    var cell = args.get_tableView()._getCellByColumnUniqueNameFromTableRowElement(filterRow, columnName);
    var filterValue = $telerik.findElement(cell, "FilterTextBox_" + columnName).value;
      
    args.set_cancel(true);
    args.get_tableView().filter(columnName, "", "NoFilter");
}


This works perfect first time round, I can enter a letter then filter the grid, then click the button and it clears the textbox and refreshes the grid to it's non filtered state. The problem is it just works the once, once I have click the button the filter clears when I type another a letter and hit return to filter the grid again it dosen't filter to my original setting of "StartsWith".

Thank you.

Craig Mellon
Top achievements
Rank 1
 answered on 14 Dec 2010
3 answers
147 views
I set the fixed width of my radgrid but the last column is cut off.

these are the critical parameters I have set the radgrid:
AllowFilteringByColumn = true;
AutoGenerateColumns = false;
ClientSettings.Scrolling.UseStaticHeaders = true;
MasterTableView.TableLayout = Fixed;

I fixed all ItemStyle.Width and HeaderStyle.Width for each GridTemplateColumn,
and the sum has been reported in the width of radgrid

which property should I set to fix the width?
Pavlina
Telerik team
 answered on 14 Dec 2010
11 answers
116 views
Good day!
I have got such a grid

<telerik:RadGrid  ID="grReport" runat="server" GridLines="None" AllowFilteringByColumn="true" BorderWidth="0" BorderColor="White"
            AllowPaging="True" Culture="ru-RU" AllowAutomaticInserts="True" AllowAutomaticDeletes="false" AllowAutomaticUpdates="True" AllowMultiRowSelection="false"
            AllowSorting="True" ShowGroupPanel="true" Skin="Office2007"  AutoGenerateColumns="False" PageSize="100"
            EnableHeaderContextMenu="true" EnableHeaderContextFilterMenu="false"        
            Width="100%" Height="100%" GroupPanel-Width="100%" CssClass="MyGrid" onitemdatabound="grid_ItemDataBound">
        <GroupingSettings CaseSensitive="false" />        
        <MasterTableView TableLayout="Auto">
            <Columns>
                <telerik:GridBoundColumn ReadOnly="True" DataField="sales_id" HeaderText="Аптека" SortExpression="sales_id" UniqueName="sales_id" Visible="True" />
                <telerik:GridBoundColumn ReadOnly="True" DataField="preparation_name" HeaderText="Препарат" SortExpression="preparation_name" UniqueName="preparation_name" Visible="True"  />
                <telerik:GridBoundColumn ReadOnly="True" DataField="price_retail" HeaderText="Цена" SortExpression="price_retail" UniqueName="price_retail" Visible="True"  />
                <telerik:GridBoundColumn ReadOnly="True" DataField="avg_price" HeaderText="Средняя цена" SortExpression="avg_price" UniqueName="avg_price" Visible="True"  />
            </Columns>            
         </MasterTableView>    
         <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" AllowDragToGroup="True">
            <Resizing  AllowColumnResize="true" AllowRowResize="true"/>
            <Selecting AllowRowSelect="true" />
            <ClientEvents OnRowContextMenu="RowContextMenu"></ClientEvents>
        </ClientSettings>
        <PagerStyle Mode="NextPrevAndNumeric" />
    </telerik:RadGrid>


And I bind the grid this way:

protected void Page_Load(object sender, EventArgs e)
        {
            var pr = new PriceLoader.PriceLoaderSoapClient();
            byte[] data = pr.GetDataForReport50();
            pr.Close();
            string xml = Decompressor.Decompress(data);
            var ds = new DataSet();
            var stringReader = new StringReader(xml);
            ds.ReadXml(stringReader);
            stringReader.Dispose();
            var table = ds.Tables[0];
            using (var repo = new SalesRepository())
                sales = repo.GetAllSoftVariant();
            grReport.DataSource = table;
            grReport.DataBind();

        }
        protected void grid_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                var item = (GridDataItem)e.Item;
                var templ = (DataRowView)item.DataItem;
                var sales_id = Int32.Parse(templ["sales_id"].ToString());
                var sale = sales.FirstOrDefault(s => s.Id == sales_id);
                item["sales_id"].Text = sale != null ? sale.Name : String.Empty;
            }
        }


Sorting works well.
But filtering do not =(
Please can you tell me  what can I do to make filtering work?

yours respectfully, Lina
Pavlina
Telerik team
 answered on 14 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?