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

RadGrid Btach Edit value of Combo Selected item

2 Answers 25 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 05 Mar 2015, 03:14 PM
Hi All,

OK I've now done a fair bit of stuff with batch editing but have only just tried to work on it with a combo box while doing the saving myself.

I want to send the values to the server for bulk processing after the user has finished admin.  To that end after each row change I am parsing all the rows and adding the changed value to a comma delimited hidden field.  I wish there was a way to access all the changes fror all rows on teh server but until that day I need to do this fairly awful work around.

The problem that I have is that text fields are fine BUT when I am trying to work out the selected value of a combo box I draw a blank.  Sample code below.

-- The javascript
 
uxRadGrid_MasterTable_row.get_cell("ContactId").innerText
 
-- the column def
 
<telerik:GridTemplateColumn DataField="ContactId" HeaderText="Contact" UniqueName="ContactId" >
<ItemTemplate><%# Eval("Name")%></ItemTemplate>
<EditItemTemplate>
<span>
<telerik:RadComboBox ID="uxContactId" Runat="server"  .....></telerik:RadComboBox>
</span>
</EditItemTemplate>
</telerik:GridTemplateColumn>

I have tried all kinds of things but just cannot access the ID field.  Accessing the selected text is easy but not the id..

Any suggestions?

Regards

Jon

2 Answers, 1 is accepted

Sort by
0
Accepted
Angel Petrov
Telerik team
answered on 10 Mar 2015, 08:28 AM
Hi Jon,

I am not sure about the exact setup but if I am correct you should be able to make things work by executing the following logic.

JavaScript:
var grid = $telerik.findControl(document, "uxRadGrid");
var batchManager = grid.get_batchEditingManager();
var cellValue=batchManager(uxRadGrid_MasterTable_row.get_cell("ContactId"));
var comboValue = $telerik.findControl(document, "uxContactId").findItemByText(cellValue).get_value();

If the above code does not prove helpful please share with us the entire page contents so we could examine the implementation and suggest an alternative solution.

Regards,
Angel Petrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jon
Top achievements
Rank 1
answered on 10 Mar 2015, 09:06 AM
Hi Angel,

With one tweak that worked perfectly thank you.  That should help greatly in a few different scenarios.

If anyone else needs this the tweak was to add .getCellValue to the 3rd line: 

var grid = $telerik.findControl(document, "uxRadGrid");
var batchManager = grid.get_batchEditingManager();
var cellValue=batchManager.getCellValue(uxRadGrid_MasterTable_row.get_cell("ContactId"));
var comboValue = $telerik.findControl(document, "uxContactId").findItemByText(cellValue).get_value();

Cheers

Jon
Tags
Grid
Asked by
Jon
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Jon
Top achievements
Rank 1
Share this question
or