Get the value of a near by cell on a row

1 Answer 23 Views
Grid
Mike
Top achievements
Rank 1
Mike asked on 14 May 2021, 06:48 PM

Hi,

I have a RadGrid that uses a DropDownList to give the user choices. I'm using the batch editing features. I don't know until run time what the contents of the dropdownlist will be. I am doing a preliminary population of the dropdownlist in the PreRender event. Essentially, this gives the user a list with too many choices. During runtime, the user will click the list to select an option.

At this point, the dropdownlist's population will be affected by the item in another row's cell. For example, if the cell in column A has a value of xxx, I need the drop down list to show X, Y, Z. If the cell in column A has a value of yyy, the drop down should show X,Y.

I've been looking at the ClientSide BatchEditing article and I believe I want to use the javascript OnBatchEditOpened function to adjust the dropdownlist. The API talks about using getCellValue(cell), and I think I can use that to get the value of the neighboring cell (the column A cell mentioned above). Something like this:

function OnBatchEditOpened(sender, args) {
        var AccessLevel = getCellValue(______)
    }

I'm not sure what the function argument should be to get the Column A data.

Also, is there documentation for the getCellValue function? I just haven't had any luck finding it.

 

Thanks,

Mike

1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 19 May 2021, 02:13 PM

Hi Mike,

We have an example Knowledge Base article demonstrating the Cascading Values in Grid with BatchEditing, see Cascading ComboBoxes in Grid with BatchEdit

Another example we have is with RadMultiColumnComboboxes. The data of one combo depends on the selection of the other, see Cascading MultiColumnComboBox in Grid with BatchEdit

In case you would only like to edit the cells programmatically using JavaScript, the How to update batch edit grids from outside button and also save external user input article has an example for that case.

Regards,
Attila Antal
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.

Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Share this question
or