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

RadGrid Show different column in List and Edit modes

6 Answers 203 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stephen Naughton
Top achievements
Rank 1
Stephen Naughton asked on 01 Jun 2011, 04:47 PM
Hi waht I an after here is, is there a way to show fewer columns in List than in the Edit/Insert modes (this is with Inline edit enabled)

I am using Dynamic Data and have a method of showing an hiding columns based on metadata and page template I want to replicate this with RadGrid in inline edit. I already have the columns that are showin in List mode working but I can't see where to hook-in to the columns generated in Edit/Insert templates.

Steve (MVP)

6 Answers, 1 is accepted

Sort by
0
Gimmik
Top achievements
Rank 1
answered on 01 Jun 2011, 09:23 PM
Hi Stephen,

This is an interesting issue. So for starters, every column you want to be able to edit will need to be bound to the RadGrid. You can hide some columns if you don't want to see them, but they must be part of the dataset if you need to edit them. Now, you should be able to dynamically show/hide the columns when you enter edit mode by wiring up some client-side events. The only issue is that the columns will display for every row, not just the row you are editing.

I had a project similar to this a while back. I found that using a popup editor provided a much cleaner interface for editing a RadGrid with hidden columns. You may want to consider trying that first.

Let me know what you think,
-Gimmik
0
Stephen Naughton
Top achievements
Rank 1
answered on 01 Jun 2011, 10:15 PM
Hi Gimmik, this is Dynamic Data all that is done for me out of the box and it's the same table I just want to intercept the part bit where the RadGrid get's the list of columns for the Edit template.

Steve (MVP)
0
Gimmik
Top achievements
Rank 1
answered on 01 Jun 2011, 11:49 PM
Hi Stephen,

I think this forum post might help you.
http://www.telerik.com/community/forums/aspnet-ajax/grid/hide-grid-column-but-show-in-editmode-inplace.aspx

Let me know if that's what you're looking for.
-Gimmik
0
Stephen Naughton
Top achievements
Rank 1
answered on 02 Jun 2011, 12:00 AM
That's nearly it Gimmik, the only issue the way the RadGrid works under Dynamic Data I would want to show columns that are no in the collection I need to be able to override the Columns collection and only make available the ones I want in the relavent mode (List,Edit.Insert)

Steve (MVP).
0
Gimmik
Top achievements
Rank 1
answered on 02 Jun 2011, 12:29 AM
Hi Stephen,

I don't think there is a way to specify the columns that display for each unique state of the RadGrid. The only thing I know that you can do is show and hide specific columns based on what ItemCommand was recently invoked. Hopefully that will be sufficient to complete your project. Otherwise, you may want to submit a ticket to Telerik's support if you don't get a better solution here on the forums.

I hope some of this is useful to you,
-Gimmik
0
Stephen Naughton
Top achievements
Rank 1
answered on 02 Jun 2011, 09:25 AM
Hi Gimmik, there will be, I may have to create a new MasterTableView to which will be easy it's how to make my Dynamic Data version of RadGrid use the new MasterTableView.

Steve (MVP)
Tags
Grid
Asked by
Stephen Naughton
Top achievements
Rank 1
Answers by
Gimmik
Top achievements
Rank 1
Stephen Naughton
Top achievements
Rank 1
Share this question
or