This is a migrated thread and some comments may be shown as answers.

Radgrid problems when using a <telerik:GridButtonColumn

3 Answers 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ALBERT
Top achievements
Rank 1
ALBERT asked on 29 Apr 2011, 05:06 PM
I have following problem with the RADGRID, when I put an ImageButton to delete I get error, that can not be because with
 a LinkButton working properly. I leave the code so that I can help.


thank you very much.

Codigo HTML:
  <telerik:RadGrid ID="GvwMacroprocesos" runat="server" AllowFilteringByColumn="True"
                                    AllowPaging="True" AutoGenerateColumns="False" GridLines="None" Skin="Hay" Width="809px"
                                    OnDeleteCommand="GvwMacroprocesos_DeleteCommand" OnItemCommand="GvwMacroprocesos_ItemCommand"
                                    OnItemDeleted="RadGrid1_ItemDeleted">
                                    <MasterTableView>
                                        <CommandItemSettings ExportToPdfText="Export to Pdf" />
                                        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                        </RowIndicatorColumn>
                                        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                        </ExpandCollapseColumn>
                                        <Columns>
                                            <telerik:GridButtonColumn CommandName="Editar" Text="Editar" UniqueName="Editar">
                                            </telerik:GridButtonColumn>
                                            <telerik:GridBoundColumn DataField="NombreMacroproceso" HeaderText="Macroproceso"
                                                UniqueName="column2">
                                                <HeaderStyle Font-Names="Verdana" Font-Size="10pt" HorizontalAlign="Center" Width="647px" />
                                                <ItemStyle Font-Names="Verdana" Font-Size="10pt" />
                                            </telerik:GridBoundColumn>
                                            <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                                                ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                                                ImageUrl="~/App_Themes/Skin/ImgBotones/Elminar.jpg" UniqueName="DeleteColumn">
                                                <ItemStyle HorizontalAlign="Center" />
                                            </telerik:GridButtonColumn>
                                        </Columns>
                                        <EditFormSettings>
                                            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                            </EditColumn>
                                        </EditFormSettings>
                                    </MasterTableView>
                                    <PagerStyle Mode="NextPrev" />
                                    <ClientSettings>
                                        <Selecting AllowRowSelect="True" />
                                    </ClientSettings>
                                    <FilterMenu EnableImageSprites="False">
                                    </FilterMenu>
                                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Hay">
                                    </HeaderContextMenu>
                                </telerik:RadGrid>


Codigo aspx:
 protected void RadGrid1_ItemDeleted(object source, GridDeletedEventArgs e)
    {
        GridDataItem dataItem = (GridDataItem)e.Item;
        String id = dataItem.GetDataKeyValue("CodigoMacroproceso").ToString();
         object[] opParametros = new Object[3];
        if (e.Exception != null)
        {
                opParametros[0] = (int)dataItem .GetDataKeyValue("CodigoCliente");
                opParametros[1] = (int)dataitem.GetDataKeyValue("CodigoCompania");
                opParametros[2] = (int)dataitem.GetDataKeyValue("CodigoMacroproceso");
              
                    _fwAccesoDatos.ExecuteNonQuery(StrCadenaConexion, "spEliminarMacroproceso", opParametros);
        }
        else
        {
            ///
        }
    }






Error
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: 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.


3 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 02 May 2011, 10:03 AM
Hello Albert,

I could not see where you bind your grid, so I assume the problem might be caused by a databinding issue. Please confirm if you are using simple or advanced data-binding. Issues like this one have been reported when using simple data-binding.

All the best,
Tsvetina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Vi Le
Top achievements
Rank 1
answered on 07 Dec 2011, 11:31 PM
Any fix to this? I am using simple data binding and having this issue with a GridButtonColumn as well.
0
Iana Tsolova
Telerik team
answered on 08 Dec 2011, 10:52 AM
Hello,

We have an issue with the ImageButton type for the GridButtonColumn, however it was fixed long time ago. Can you elaborate a bit more on your scenario, the page and the grid setup so we try replicating the issue on our side and find what is causing it?

Regards,
Iana Tsolova
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
ALBERT
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Vi Le
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or