Hi,
Row Edit Template can be activated by double click..etc.
Is there anyway to activate it by Javascript?
Thanks!
David
What version was this for? I'm using 10.3 and I cannot get past the rowEditingTemplate. I get an error when trying to do get_dropDownBehavior().
var rowEditingTemplate = grid.get_behaviors().get_editingCore().get_behaviors().get_rowEditingTemplate() ;
var container = rowEditingTemplate.get_dropDownBehavior().get_targetContainer();
and I get
'rowEditingTemplate.get_dropDownBehavior()' is null or not an object
Nevermind, I found my typo.
The above code works, except opening it this way does not fire the RowEditing_TemplateOpened event.
What I am doing is this, I have an "Edit" button in a templated column of my WebDataGrid. I have set the OnClientClick event of that button to do the javascript to enterEditMode on the row.
I need it to fire the TemplateOpened event after that so I can position my Edit Template in the center of the screen.
I have tried putting the code to center it on the screen right after the enterEditMode but the problem is it does not work the first time I click on the Edit button, only the 2nd.
var grid = $find("<%=WebDataGraphics1.WdgGraphics.ClientID %>"); var gridRows = grid.get_rows(); var selectedRows = grid.get_behaviors().get_selection().get_selectedRows(); var row = selectedRows.getItem(0); var rowEditingTemplate = grid.get_behaviors().get_editingCore().get_behaviors().get_rowEditingTemplate(); rowEditingTemplate.set_dropDownEnableAutomaticPositioning(false); rowEditingTemplate.enterEditMode(row) var container = rowEditingTemplate.get_dropDownBehavior().get_targetContainer(); var cntStyle = container.style; cntStyle.position = 'absolute'; cntStyle.marginLeft = "0px"; cntStyle.martinTop = "0px;"; cntStyle.left = (document.documentElement.offsetWidth / 2 + document.body.scrollLeft); cntStyle.top = (document.documentElement.offsetHeight / 2 + document.body.scrollTop);
Hi DesaiDarshan,
The code that I posted is for the Aikido WebDataGrid. If your id is any indication, you are using the UltraWebGrid. You'll either have to convert your grid or post the question in the correct forum.
regards,Dave
hi Dave ,
the code you mentioned is not workin
here is the code :
var grid = document.getElementById("ctl00_ContentPlaceHolder1_xxxx_UltraGridRates"); var row = grid.get_rows().get_row(0); var ret = grid.get_behaviors().get_editingCore().get_behaviors().get_rowEditingTemplate(); ret.enterEditMode(row);
it gives an exception on var row = grid.get_rows().get_row(0);
Please let me know
thanks