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

grid edit

1 Answer 61 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 12 Mar 2009, 07:25 PM
Issue 1

I have a radgrid inside a tree view control.  Is it possible to put that grid into inline edit mode.  I figure I have to use the client side OnCommand function to put the identifying data for the row that needs to be edited into a hidden variable so when the grid is recreated on the server side that row can be put into edit mode.  The problem I am having is how to get the data I need from the grid on the client side.

Here is what I have so far.

serverside grid definition (partial)

_TreeGrid =

new RadGrid();

 

_TreeGrid.ID =

"radDG" + _gridType;

 

_TreeGrid.Skin =

"Office2007";

 

_TreeGrid.Width = 800;

_TreeGrid.AutoGenerateColumns =

false;

 

_TreeGrid.ClientSettings.Selecting.AllowRowSelect =

true;

 

_TreeGrid.AllowMultiRowSelection =

true;

 

 

//bind the client side events

 

_TreeGrid.ClientSettings.ClientEvents.OnRowCreated =

"RowCreated";

 

_TreeGrid.ClientSettings.ClientEvents.OnRowCreating =

"RowCreating";

 

_TreeGrid.ClientSettings.ClientEvents.OnRowSelected =

"RowSelected";

 

_TreeGrid.ClientSettings.ClientEvents.OnRowDeselected =

"RowUnselected";

 

_TreeGrid.ClientSettings.ClientEvents.OnCommand =

"GridCommand";

 



server side javascript

 

function GridCommand(sender, args)

 

{

 

grid = sender;

 

dataItems = grid.get_masterTableView().get_dataItems();

 

}

Thanks

John

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 16 Mar 2009, 12:31 PM
Hello John,

On the client, you can either use the editItem client side handler for a single item, or the editselecteditems to edit multiple items. In addition, you can use the fireCommand client side method, to fire a custom command, which can be used to put multiple items in edit mode from the server.
I hope these suggestions help.

Best wishes,
Yavor
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
TreeView
Asked by
John
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or