Skip to content

Commit 67664a2

Browse files
committed
DataGrid CheckBoxList with OData demo updated
Fix #2252
1 parent eefbe00 commit 67664a2

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

RadzenBlazorDemos/Pages/DataGridCheckBoxListFilterOData.razor

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,24 @@
6161

6262
string GetODataExpand(string property)
6363
{
64-
var properties = property.Split("/");
65-
return properties.Count() > 1 ? $"{string.Join("/", properties.Take(properties.Length - 1))}($select={properties.LastOrDefault()})" : null;
64+
var parts = property.Split('.');
65+
if (parts.Length <= 1)
66+
return null;
67+
68+
parts = parts.Take(parts.Length - 1).ToArray();
69+
70+
string result = "";
71+
for (int i = 0; i < parts.Length; i++)
72+
{
73+
if (i == 0)
74+
result += $"$expand={parts[i]}";
75+
else
76+
result += $"($expand={parts[i]}";
77+
}
78+
79+
for (int i = 1; i < parts.Length; i++)
80+
result += ")";
81+
82+
return result;
6683
}
6784
}

0 commit comments

Comments
 (0)