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

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

8 Answers 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
R
Top achievements
Rank 1
R asked on 31 May 2011, 05:54 PM
can you please tell me how to set a column in edit mode(in place) on the client through  onrowclick event

8 Answers, 1 is accepted

Sort by
0
Accepted
Gimmik
Top achievements
Rank 1
answered on 31 May 2011, 09:32 PM
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
0
R
Top achievements
Rank 1
answered on 01 Jun 2011, 06:00 PM
that worked...thank you...
0
Gimmik
Top achievements
Rank 1
answered on 01 Jun 2011, 06:16 PM
Glad I could help.

-Gimmik
0
Elliott
Top achievements
Rank 2
answered on 03 Jun 2011, 08:59 PM
thanks!
only problem - no edit button, no Update or Cancel buttons
0
Gimmik
Top achievements
Rank 1
answered on 03 Jun 2011, 09:23 PM
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
0
Elliott
Top achievements
Rank 2
answered on 03 Jun 2011, 09:27 PM
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
0
Gimmik
Top achievements
Rank 1
answered on 03 Jun 2011, 09:55 PM
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
0
Elliott
Top achievements
Rank 2
answered on 03 Jun 2011, 09:58 PM
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")
Tags
Grid
Asked by
R
Top achievements
Rank 1
Answers by
Gimmik
Top achievements
Rank 1
R
Top achievements
Rank 1
Elliott
Top achievements
Rank 2
Share this question
or