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

[Solved] RadGrid GridEditCommandColumn

8 Answers 727 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Manisha Shivjiani
Top achievements
Rank 1
Manisha Shivjiani asked on 15 Jun 2010, 07:12 PM
Hi,
I am using Telerik Radgrid with inline Editing feature.

Grid in the edit mode shows update/cancel commands as images.
I would like to disply both updateimage and updatetext.
Currently when I set the UpdateText with updateimage, it shows the text as tooltip when user hovers over the updateimage. I would like to display the updatetext even without hovering over the image.

I would appreciate help on this.

Thanks,
Manisha

8 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Jun 2010, 07:20 AM
Hello Manisha,

A better approach is using GridTemplateColumn with ImageButtons and LinkButtons placed inside as per your requirement. Here is a a small example on how to accomplish this.

ASPX:
 
    <telerik:GridTemplateColumn> 
        <ItemTemplate> 
            <asp:ImageButton ID="ImageButtonEdit" runat="server" CommandName="Edit" /> 
        </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> 


-Shinu.
0
Manisha Shivjiani
Top achievements
Rank 1
answered on 16 Jun 2010, 05:14 PM
Shinu,
Thank you very much for your suggestion.
That worked like a charm!

Manisha
0
Lobna
Top achievements
Rank 1
answered on 29 Apr 2013, 10:56 AM
I have a question, please.
I use GridEditCommandColumn in RadGrid,when I click Edit the data disappears from grid.
What do I miss?

Thanks,
0
Shinu
Top achievements
Rank 2
answered on 29 Apr 2013, 11:18 AM
Hi,

In order to implement adanced features in grid like paging, editing etc..make sure that grid is binded with advanced data binding using its NeedDataSource event. Check the following help documentation for more.
Advanced Data-binding (using NeedDataSource event)

Thanks,
Shinu
0
Lobna
Top achievements
Rank 1
answered on 29 Apr 2013, 11:41 AM
Thanks for you reply.
The point is the datasource is from database, so using needdatasource works fine with Edit.
But when clicking update it goes to needdatasource event and doesn't reflect the update in data.
same issue when insert new record.
how can I fix this?

thanks,
0
Shinu
Top achievements
Rank 2
answered on 30 Apr 2013, 06:28 AM
Hi,

If you are manually inserting data, you should handle it in InsertCommand event. The changes will be automatically reflected if grid is using advanced data binding. Also check the following demo for more.
Grid - LinqToSql Manual Operations

Thanks,
Shinu
0
Lobna
Top achievements
Rank 1
answered on 06 May 2013, 09:51 PM
Hi Shinu,
Sorry for too many questions.
you are right my grid uses advanced data binding so I use need data source and when clicking edit and cancel it works fine.
but when insert, update and delete I don't want to hit the database I just want to reflect on grid, how can acheive this while when update and insert it goes to need data source?

Thanks alot 
Lobna
0
Lobna
Top achievements
Rank 1
answered on 07 May 2013, 03:45 AM
hi,
I fix the issue.
Thanks and sorry again.
Tags
Grid
Asked by
Manisha Shivjiani
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Manisha Shivjiani
Top achievements
Rank 1
Lobna
Top achievements
Rank 1
Share this question
or