This is a migrated thread and some comments may be shown as answers.

How many interrelated pieces need to be changed when a model is changed in MVC Telerik Reporting?

0 Answers 7 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Clay
Top achievements
Rank 1
Clay asked on 15 May 2013, 06:46 PM
So with html/razor code in the View like so:

            <tr id="trBeginDate">
                <td>
                </td>
                <td>
                    @Html.LabelFor(m => m.BeginDate)
                </td>
                <td style="padding-right: 20px;">
                    @Html.TextBoxFor(m => m.BeginDate, new { alt = "date-us", style = "width: 164px;" })
                </td>
                <td>
                    @Html.LabelFor(m => m.BeginTime)
                </td>
                <td style="padding-right: 20px;">
                    @Html.TextBoxFor(m => m.BeginTime, new { style = "width: 109px;" })
                </td>
            </tr>

...does the TextBoxFor() construct/syntax perform two-way binding to the model? That is to say, does this assign the values entered into the textboxes thus generated to the BeginDate and BeginTime model members? I assume so; just want to verify.

Now, to combine the Date and Time values I want to pass into one control, I imagine I can replace the BeginDate and BeginTime on the model with a BeginDateTime, and then change the code above to:

            <tr id="trBeginDate">
                <td>
                </td>
                <td>
                    @Html.LabelFor(m => m.BeginDateTime)
                </td>
                <td style="padding-right: 20px;">
                    @Html.TextBoxFor(m => m.BeginDateTime, new { alt = "date-us", style = "width: 164px;" })
                </td>
            </tr>

...right? But...how do I change the associated Telerik code, which presumably is expecting a Date and a Time, not a combined DateTime?

BTW, I tested using "format code block" for the snippets above, but the preview looked like Dallas warmed over.

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Clay
Top achievements
Rank 1
Share this question
or