3 Answers, 1 is accepted
0
Hello Steven,
The KeyValuePairs (ID/Value) for particular ForeignKey column could be found the following way:
You can use the function in yourRow template and pass the data to it to retrieve the Text.
e.g.
Regards,
Petur Subev
the Telerik team
The KeyValuePairs (ID/Value) for particular ForeignKey column could be found the following way:
var
collection;
// global object which you can use as dictionary to get text for particular id
function
getTextByValue(data) {
//if the collection is empty - get it from the grid
if
(!collection) {
grid = $(
"#GridName"
).data(
"kendoGrid"
);
valuesCollection = grid.options.columns[1].values;
//Set the correct FKColumn index
collection = {};
for
(
var
value
in
valuesCollection) {
collection[valuesCollection[value].value] = valuesCollection[value].text;
}
}
return
collection[data.EmployeeID];
}
You can use the function in yourRow template and pass the data to it to retrieve the Text.
e.g.
Text is :
#= getTextByValue(data)#
Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

pratik
Top achievements
Rank 1
answered on 03 Oct 2015, 05:24 AM
Can You Give Me a Demo Project of Foreign key use within the ClientRowTemplate of a Kendo Grid ?
Your Regard,
Pratik R. Panchal
0
Hello pratik,
I am not able to understand completely the functionality you are trying to achieve. Could you please elaborate a bit more on your scenario?
Regards,
Boyan Dimitrov
Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items