I'm trying to have a group of 2 radio buttons (each button in different
column but the same row) in my Kendo grid popup template but without success. I defined the type of the parameter as a string. But after clicking the radio button, it will set it to null type.
It works fine
with checkboxes, though
<div class="editor-field">
@Html.RadioButtonFor(model => model.Status, "Avail")Available
@Html.RadioButtonFor(model => model.Status, "Not Avail") Not Available
</div>
when I debuged, model.Status = null, every time.
14 Answers, 1 is accepted
Since you used check-boxes before, I am assuming that the actual type of the Status property is bool. If that is the case you should set the values of the radio buttons to true and false.
E.g.
<div class=
"editor-field"
>
@Html.RadioButtonFor(model => model.Status,
"true"
)Available
@Html.RadioButtonFor(model => model.Status,
"false"
) Not Available
</div>
I am also attaching a sample project to demonstrate the implementation. Please let me know if it covers the current scenario.
Kind regards,
Dimiter Madjarov
the Telerik team
Thank you for your reply. I check your project , it works fine, But when on my project , I don't know why it doesn't work
In the attched picture , you can see the first entry in the grid view. PIDX column is true, but in the popup the PIDX radio button is No, I cannot figure out this issue. Could you give me some suggestions?
Thank you
the code with issue
<
div
class
=
"editor-row"
>
<
div
class
=
"selector-type-column"
> </
div
>
<
div
class
=
"float-left editor-label"
style
=
"width: 80px;"
>
@Html.LabelFor(model => model.IsPidx)
</
div
>
<
div
class
=
"editor-field"
>
@Html.RadioButtonFor(model => model.IsPidx,"true")Yes
@Html.RadioButtonFor(model => model.IsPidx,"false")No
<
span
style
=
"color:red"
>*</
span
>
</
div
>
<
div
class
=
"clear"
></
div
>
</
div
>
<
div
class
=
"selector-type-column"
> </
div
>
<
div
class
=
"float-left editor-label"
style
=
"width: 80px;"
>
@Html.LabelFor(model => model.IsPidx)
</
div
>
<
div
class
=
"editor-field"
>
@Html.CheckBoxFor(model => model.IsPidx) <
span
style
=
"color:red"
>*</
span
>
</
div
>
There are no errors in the code that you attached. Could you modify my solution to reproduce the issue or send me a copy of your project, so I could test it locally and assist you further?
The version should not be an issue in the current scenario.
Dimiter Madjarov
the Telerik team
The default behavior of the Grid is to display a confirmation window when deleting a record. If you also want to display it when inserting or updating a record, you could bind to the save event of the grid and do it in the event handler.
If you are referring to a window with a success (or error) message after the corresponding operation is over, you should handle the sync and error events of the dataSource.
Kind regards,
Dimiter Madjarov
the Telerik team
Sorry, for the confusion. The sync event will be triggered even when there is a problem with the operation. Instead I can suggest to use the requestEnd event. I attached a sample project which demonstrates one possible implementation.
Kind regards,Daniel
the Telerik team
.DataSource(dataSource => dataSource
.Ajax()
.Events(e =>
{
e.RequestEnd("requestEnd");
e.Error("onError");
})
.Read(reader => reader.Action("Read", "MaterialCodeMapping").Data("getSearchCriteria"))
.Create(reader => reader.Action("Create", "MaterialCodeMapping"))
.Update(reader => reader.Action("Update", "MaterialCodeMapping"))
.Destroy(reader => reader.Action("Destroy", "MaterialCodeMapping"))
.Model(model =>
{
model.Id(row => row.Id);
model.Field(row => row.TerminalId).DefaultValue(0);
}))
)
Could you check what is the response from the server when creating a record? The event will not be triggered if there is an exception.
Kind regards,Daniel
the Telerik team
. It's 2012.3.1114.0. I think that's the issue. I just check your app and my. the property of events of two versions are different
I tested the sample with the specified version but the event seems to be triggered correctly on my side. Could you check the attached updated project and let me know if I am missing something?
Also, does updating to the service pack(2012.3.1315) resolves the problem on your side?
Daniel
the Telerik team