
Thomas Salt
Top achievements
Rank 1
Thomas Salt
asked on 13 Oct 2009, 01:31 PM
I have a template edit form in a RadGrid that contains 4 RadComboBoxes. I would like to add items to these combo boxes on the client side while the grid is in Edit Mode. So for example I edit row #2, and then the user clicks a button to add another item to the RadComboBox. Is it possible to get a client side reference to this combo box for the row currently being edited? Then once I have reference to this combo box I can use the RadComboBox client side API to add the new combo box item.
Also if there is a way to do this, how would I loop through all of the items being edited if the grid is currently editing all items.
Please view attached image for an image that may help.
Thank you.
Also if there is a way to do this, how would I loop through all of the items being edited if the grid is currently editing all items.
Please view attached image for an image that may help.
Thank you.
6 Answers, 1 is accepted
0
Accepted

Shinu
Top achievements
Rank 2
answered on 14 Oct 2009, 05:55 AM
Hi Thomas,
You can find out the edited row index by using the following client side code;
var editIndex= $find("RadGrid1")._editIndexes;
You can use a global registry (an array really) that keeps control ID's and emit script for every server control that will add an item to the global registry. Then just loop over all registered elements and get the one that contains our server ID.
Checkout the code library for more information : Accessing server controls in a grid template on the client
-Shinu.
You can find out the edited row index by using the following client side code;
var editIndex= $find("RadGrid1")._editIndexes;
You can use a global registry (an array really) that keeps control ID's and emit script for every server control that will add an item to the global registry. Then just loop over all registered elements and get the one that contains our server ID.
Checkout the code library for more information : Accessing server controls in a grid template on the client
-Shinu.
0

Thomas Salt
Top achievements
Rank 1
answered on 14 Oct 2009, 01:57 PM
Hi Shinu,
Thanks for the help, but the code example provided uses the <EditItemTemplate> of a <GridTemplateColumn>.
I use the <FormTemplate> of the <EditFormSettings> tag. I've tried modifying the supplied code example to work with my project however I cannot get the javascript method [registeredElements.push()] to fire when using the <FormTemplate>. Do you have any other ideas?
Thanks for the help, but the code example provided uses the <EditItemTemplate> of a <GridTemplateColumn>.
I use the <FormTemplate> of the <EditFormSettings> tag. I've tried modifying the supplied code example to work with my project however I cannot get the javascript method [registeredElements.push()] to fire when using the <FormTemplate>. Do you have any other ideas?
0

Thomas Salt
Top achievements
Rank 1
answered on 14 Oct 2009, 02:42 PM
I was able to get this to work by registering my elements using the "OnClientLoad" event of the RadComboBoxes.
Thanks a lot Shinu.
Thanks a lot Shinu.
0

omar treviño
Top achievements
Rank 1
answered on 12 Mar 2010, 09:44 PM
Hi Thomas Salt I have the same problem as yours, could you please help me? and show your code as a example please???
I'm inexpert and my english is not well, sorry for this. Take care and thanks
0

race maine
Top achievements
Rank 1
answered on 11 Mar 2011, 11:18 PM
Using
var editIndex= $find("RadGrid1")._editIndexes;
to access the edited index does not seem to work. What I would like to do is, when user clicks to select to add a new row to my grid, I want to capture and access the fields in the edit form displayed. How do I achieve this please??
always seems to return 0.
var editIndex= $find("RadGrid1")._editIndexes;
to access the edited index does not seem to work. What I would like to do is, when user clicks to select to add a new row to my grid, I want to capture and access the fields in the edit form displayed. How do I achieve this please??
var grid = $find("<%= <
span
class
=
"Apple-style-span"
style
=
"line-height: 19px; "
>RadGrid1</
span
>.ClientID %>");
<
br
> var MasterTable = grid.get_masterTableView();
<
br
> var selectedRows = MasterTable .get_selectedItems();
always seems to return 0.
0

Princy
Top achievements
Rank 2
answered on 14 Mar 2011, 07:41 AM
Hello Race,
Give a try with the approach mentioned in the following forum to get the insert form cell value from client side.
Getting the new data row in client side
Thanks,
Princy.
Give a try with the approach mentioned in the following forum to get the insert form cell value from client side.
Getting the new data row in client side
Thanks,
Princy.