RadGrid Show different column in List and Edit modes

7 posts, 0 answers
  1. Stephen Naughton
    Stephen Naughton avatar
    19 posts
    Member since:
    Apr 2010

    Posted 01 Jun 2011 Link to this post

    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)
  2. Gimmik
    Gimmik avatar
    170 posts
    Member since:
    May 2011

    Posted 01 Jun 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Stephen Naughton
    Stephen Naughton avatar
    19 posts
    Member since:
    Apr 2010

    Posted 01 Jun 2011 Link to this post

    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)
  5. Gimmik
    Gimmik avatar
    170 posts
    Member since:
    May 2011

    Posted 01 Jun 2011 Link to this post

    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
  6. Stephen Naughton
    Stephen Naughton avatar
    19 posts
    Member since:
    Apr 2010

    Posted 01 Jun 2011 Link to this post

    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).
  7. Gimmik
    Gimmik avatar
    170 posts
    Member since:
    May 2011

    Posted 01 Jun 2011 Link to this post

    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
  8. Stephen Naughton
    Stephen Naughton avatar
    19 posts
    Member since:
    Apr 2010

    Posted 02 Jun 2011 Link to this post

    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)
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017