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

EnablePostBackOnRowClick and GridButtonColumn

1 Answer 136 Views
Grid
This is a migrated thread and some comments may be shown as answers.
François
Top achievements
Rank 1
François asked on 29 Oct 2008, 02:06 PM
Hi everybody,

I have a problem with the EnablePostBackOnRowClick when I also have a GridButtonColumn:

<telerik:RadGrid runat="server" AutoGenerateColumns="False" Skin="" CssClass="list"
    <MasterTableView AutoGenerateColumns="False" CssClass="list" AllowSorting="true"
        <HeaderStyle CssClass="listheader" /> 
        <ItemStyle CssClass="listline1" /> 
        <AlternatingItemStyle CssClass="listline2" /> 
        <Columns> 
            <telerik:GridBoundColumn UniqueName="src_id" DataField="src_id" HeaderText="ID" SortExpression="src_id"
                <HeaderStyle Width="20px" HorizontalAlign="center" /> 
                <ItemStyle Width="20px" HorizontalAlign="center" /> 
            </telerik:GridBoundColumn> 
            <telerik:GridButtonColumn UniqueName="DeleteColumn" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" Width="20px" /> 
            </telerik:GridButtonColumn> 
        </Columns> 
    </MasterTableView> 
    <ClientSettings EnablePostBackOnRowClick="true"
    </ClientSettings> 
</telerik:RadGrid> 

In the code behind :
protected void gridSources_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
    { 
         Trace.Log(e.CommandName);
    } 

When I click on a row, I have the RowClick CommandName, right.
But if I click on the ImageButton column, I have Delete CommandName and RowClick CommandName events. If I add a ConfirmText on GridButtonColumn, if I accept, I have Delete and RowClick events. If I decline, I have RowClick event.

Is there a method to disable RowClick event for GridButtonColumn to only have Delete event if I confirm action ?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 30 Oct 2008, 10:13 AM
Hello,

You can refer to the following forum link wherein a similar scenario is discussed.
http://www.telerik.com/community/forums/thread/b311D-bktckh.aspx

Thanks
Princy.
Tags
Grid
Asked by
François
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or