can you please tell me how to set a column in edit mode(in place) on the client through onrowclick event

9 posts, 1 answers
  1. R
    R avatar
    5 posts
    Member since:
    May 2011

    Posted 31 May 2011 Link to this post

    can you please tell me how to set a column in edit mode(in place) on the client through  onrowclick event
  2. Answer
    Gimmik
    Gimmik avatar
    170 posts
    Member since:
    May 2011

    Posted 31 May 2011 Link to this post

    Hi R,

    This shouldn't be too hard to do. First make sure you have the EditMode for your MasterTableView set to "InPlace".

    Wire-up the OnRowClick event for the RadGrid like this:
    <ClientSettings>
        <ClientEvents OnRowContextMenu="RowContextMenu" OnRowClick="RadGrid1_OnRowClick" />
    </ClientSettings>

    Finally, create a JavaScript function that look like this:
    function RadGrid1_OnRowClick(sender, args) {
     
        var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
        var row = args.get_itemIndexHierarchical();
        masterTable.editItem(masterTable.get_dataItems()[row].get_element());
    }

    Let me know if that works for you,

    -Gimmik
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. R
    R avatar
    5 posts
    Member since:
    May 2011

    Posted 01 Jun 2011 Link to this post

    that worked...thank you...
  5. Gimmik
    Gimmik avatar
    170 posts
    Member since:
    May 2011

    Posted 01 Jun 2011 Link to this post

    Glad I could help.

    -Gimmik
  6. Elliott
    Elliott avatar
    391 posts
    Member since:
    May 2010

    Posted 03 Jun 2011 Link to this post

    thanks!
    only problem - no edit button, no Update or Cancel buttons
  7. Gimmik
    Gimmik avatar
    170 posts
    Member since:
    May 2011

    Posted 03 Jun 2011 Link to this post

    Hi Marianne,

    I'm not sure what you're asking. Buttons aren't required for this solution. The row is placed in Edit Mode by setting a row property client-side. Can you please elaborate on what information you need?

    Thanks,
    -Gimmik
  8. Elliott
    Elliott avatar
    391 posts
    Member since:
    May 2010

    Posted 03 Jun 2011 Link to this post

    ordinarily, when a row is placed in Edit Mode using an Edit button, the Edit button is replaced by an Update button and a Cancel button
    if the row is placed in Edit Mode through a double click only I need to figure out how to trigger an update event - and possible a cancel event as well
  9. Gimmik
    Gimmik avatar
    170 posts
    Member since:
    May 2011

    Posted 03 Jun 2011 Link to this post

    Hi Marianne,

    There are a few ways to this. The solution you choose depends on the style you are trying to achieve.

    • You can include an edit column and have the DoubleClick be an additional way to place the row in edit mode.
    • You can have a hidden edit column that you make visible when a row is placed in edit mode, and hide again when the used clicks update or cancel.
    • You could bind those functions to RadButtons below the grid and use some custom logic to enable/disable those buttons when a row is in edit mode.
    • You can use a popup editor instead of inline editing.

    Hopefully one of these methods will work for you.
    -Gimmik
  10. Elliott
    Elliott avatar
    391 posts
    Member since:
    May 2010

    Posted 03 Jun 2011 Link to this post

    yes, thanks, I will see what the original page (written using Intersoft controls) does and try to mimic that behavior as closely as possible

    gotta ask - a Gypsy fan? ("You Gotta Get A Gimmick")
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017