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

RadGrid merge columns

2 Answers 149 Views
Grid
This is a migrated thread and some comments may be shown as answers.
hamda
Top achievements
Rank 1
hamda asked on 14 Jul 2010, 11:03 AM
hi again my friends
I have new question about radgrid, I have two columns one for Edit & the other for Delete & I want to merge the two actions under one column, can we do something like this in the radgrid? how?

kind regards...

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 14 Jul 2010, 11:50 AM
Hello,

Make use of GridTemplateColumn in order to achieve this. Place the Edit and Delete buttons in ItemTemplate and place the insert/update, cancel buttons in EditItemTemplate of GridTemplateColumn. See the sample code:


ASPX:
<telerik:GridTemplateColumn>
    <ItemTemplate>
        <asp:ImageButton ID="ImageButtonEdit" runat="server"  CommandName="Edit" />
        <asp:ImageButton ID="ImageButton1" runat="server" CommandName="Delete" />
    </ItemTemplate>
    <EditItemTemplate>
        <asp:ImageButton ID="ImageButtonUpdate" runat="server" runat="server" CommandName='<%# (Container is GridDataInsertItem) ? "PerformInsert" : "Update" %>' />
        <asp:LinkButton ID="LinkButtonUpdate" runat="server" Text='<%# (Container is GridDataInsertItem) ? "Insert" : "Update" %>'
            runat="server" CommandName='<%# (Container is GridDataInsertItem) ? "PerformInsert" : "Update" %>'>>Update</asp:LinkButton>
        <asp:ImageButton ID="ImageButtonCancel" runat="server" CommandName="Cancel" />
        <asp:LinkButton ID="LinkButtonCancel" runat="server" CommandName="Cancel">Cancel</asp:LinkButton>
    </EditItemTemplate>
</telerik:GridTemplateColumn>


Hope this helps,
Shinu.
0
hamda
Top achievements
Rank 1
answered on 19 Jul 2010, 05:40 AM
thank you Shinu :) this is working..
now I want to make confirm message for the delete command, how can it be done here? and how can I make the (update) ,(delete) and (cancel) as image button ?
I tried from poperties> master table view> EditFormSetting> EditClumn > for both (update) and (cancel) I put the button type = imageButton, but it still give me as link button :(
Tags
Grid
Asked by
hamda
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
hamda
Top achievements
Rank 1
Share this question
or