In my application I have a grid within a grid using ClientDetailTemplateId
in my subgrid I want to have 5 tabs, but in one specific instance I would like to have 6.
What I actually want is something like this.
where only if MyId = 9212 the item should be added,
but whatever I try I can't get it to work.
is there someone who can help me?
Thank you in advance.
5 Answers, 1 is accepted
Thank you for the details.
Currently, the possible approach is in indeed using an if statement and based on condition to show 5 or 6 taps.
Another option can be after the TapStip is rendered to check some condition and based on that to remove the unnecessary tap using the remove method:
Still, the first approach is better as using the second one can just flash the 6tg tab making a confusing experience for the user.
Please share with us an example where we can reproduce the issue in IE and we will gladly assist further.
Thank you for your answer, the mentioned remove function works also in IE, so as a quick fix this is ok.
but I'd rather would like to use the if statement.
But If I use it like this
"#=MyId#" won't be replaced by mvc so the result always is false.
and If I remove the double quote I end up with an error.
is there a way to make this work?
When placed inside an if statement the id has to be set a regular value (MyId):
More details for the template syntax and the if statements in the templates can be found in the following article:
I hope this is helpful.
this syntax indeed works for the Content part or the title of the tab without any issue,
however my statement is outside the tabitem itself
and I cannot do this
because items.add is not plain content I think,
I think what I'm looking for it how to use the parent values in ClientDetailTemplates.
This if statement has to be added at begging of the DetailTemplate and based on that to return a tab strip with 5 or 6 items.
Placing it only for one of the taps will break to syntax and the rendering.
I do understand that this will create having identical code for both TabStrips, but currently, this is the supported syntax.