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

GridButtonColumn CommandName Delete

5 Answers 320 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jean-Marc Windholz
Top achievements
Rank 1
Jean-Marc Windholz asked on 31 Jan 2011, 11:31 AM
It must be very simple but I can't work it out
I've got a grid
<telerik:RadGrid ID="RadGrid1"                           
                            runat="server"
                            ShowHeader="False"
                            AutoGenerateColumns="False"                                                                                                                 
                            >                       
                             
                <MasterTableView                                 
                                    DataKeyNames="AppID, IDCart, IDOrder">
                                     
                    <Columns>
                         
..............                       
 
                        <telerik:GridTemplateColumn UniqueName="TemplateColumn" >
                            <HeaderStyle Width="335px" />                                     
                        <ItemTemplate>
                                <asp:Literal ID="myLiteral" runat="server" />
                          </ItemTemplate>  
                       </telerik:GridTemplateColumn>
                               
                        <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"                       
                            ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                            UniqueName="DeleteColumn">
                            <HeaderStyle Width="15px" />
                            <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                        </telerik:GridButtonColumn>
                         
                    </Columns>                  
                </MasterTableView>                  
        </telerik:RadGrid>

(myliteral is filled on temDataBound event.)
I bind the grid on code behind needdatasource event. It works fine.
If I click the GridButton to delete, raising RadGrid1_DeleteCommand event, it performs the delete function. It works fine


Now I just need to add Ajax to this.
so
<telerik:RadAjaxManager ID="RadAjaxManagerCart" runat="server">
            <AjaxSettings>           
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />                            
                        <telerik:AjaxUpdatedControl ControlID="myLiteral" />                                                   
                    </UpdatedControls>
                </telerik:AjaxSetting>           
            </AjaxSettings>
        </telerik:RadAjaxManager>

It is not working. The RadGrid1_DeleteCommand event is performed, but it does not refresh the grid

Could you help me please?

5 Answers, 1 is accepted

Sort by
0
Jean-Marc Windholz
Top achievements
Rank 1
answered on 01 Feb 2011, 10:52 AM
any idea anyone?
0
Daniel
Telerik team
answered on 03 Feb 2011, 10:30 AM
Hello Jean-Marc,

There is no visible reason as to why this approach is not working in your scenario. I created a runnable website based on your code - it is working as expected on my end.
Please give it a try and let me know if I'm missing something.

Note that you don't have to update the nested Literal since the parent control is already ajaxfied.

Regards,
Daniel
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
Jean-Marc Windholz
Top achievements
Rank 1
answered on 16 Feb 2011, 04:02 PM
My problem had a completely different source. Sorry for that.
I forgot an earlier Response.write in the page load event in the If Page.IsPostBack. Ajax does not like that too much
http://encosia.com/2007/06/19/the-easiest-way-to-break-aspnet-ajax-pages/

0
Rohan
Top achievements
Rank 1
answered on 19 Oct 2012, 01:03 PM
Hi all,

I want some information about  GridButtonColumn's default images or default command name , for example when columns name set to delete - then delete image get display .


0
Eyup
Telerik team
answered on 24 Oct 2012, 10:59 AM
Hello Rohan,

You could refer to the GridButtonColumn section of the following topic and the provided link there to get a better idea of command names:
http://www.telerik.com/help/aspnet-ajax/grid-column-types.html

In case you set the CommandName of the ButtonColumn to Delete or Edit and set the ButtonType as ImageButton, a corresponding Image will be displayed depending on the chosen Skin. This is similar to the scenario when you have GridEditCommandColumn or GridClientDeleteColumn with ButtonType as ImageButton.

I hope this will prove helpful. 

Kind regards,
Eyup
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
Ajax
Asked by
Jean-Marc Windholz
Top achievements
Rank 1
Answers by
Jean-Marc Windholz
Top achievements
Rank 1
Daniel
Telerik team
Rohan
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or