Apr 09, 2013, 4:19 PM
X().Panel() Items issue
Hi,
I'm working with Ext.Net in Razor C#.Net and I don't know if what I trying to do is posible, I'm building an app that reproduces previews of some tests like "exams" from courses, to do this I manage a full entity for every test (every entity contains another one inside, something like: test > questions > answers).
This is how my entity looks like
I tried something like:
Hope somebody can help me.
EDIT:
I achieved this, thank you. You can close this post.
I'm working with Ext.Net in Razor C#.Net and I don't know if what I trying to do is posible, I'm building an app that reproduces previews of some tests like "exams" from courses, to do this I manage a full entity for every test (every entity contains another one inside, something like: test > questions > answers).
This is how my entity looks like
public class Test
{
public QuestionContaier questions { get; set; } //my container works an IList<T> class.
}
public class Question
{
public AnswerContainer answers { get; set; } //same here
}
I'm need to do a preview of a test, inside I need a Radio Group (MAX 5) for each question and Radio or RadioFor (MAX 4) for each answer. I tried a lot of things to achieve this but nothing seems to works for me.I tried something like:
@model BE.Test
@{
var panel = Html.X().Panel()
.ID("panel");
foreach (BE.Question q in Model.questions.Items)
{
panel.Items(i =>
{
i.Add
(
Html.X().Panel()
.Title(q.question)
.Items(item =>
{
item.Add
(
Html.X().RadioGroup()
.Items
(
from a in q.answers.Items
select new Radio
{
ID = a.idAnswer.ToString(),
FieldLabel = a.answer
}
)
);
})
);
});
}
var winTestPreview = Html.X().Window()
.Title(Model.test)
.Width(600)
.Modal(true)
.Height(450)
.Layout(LayoutType.Fit)
.Items
(
panel
);
}
@(
winTestPreview.Show()
)
But It throws and exception with a legend "ItemTag validation (_tkn_5): Reference token (13_ClientInit) was not found." Hope somebody can help me.
EDIT:
I achieved this, thank you. You can close this post.
Last edited by alexiism; Apr 09, 2013 at 5:08 PM.