Telerik Forums
UI for ASP.NET MVC Forum
1 answer
338 views
Hello,

I've made a command.Custom in my grid:
columns.Command(command =>
       {
          command.Custom("Details")
          .Text("<i class=" + "icon-globe" + "></i> Details")
          .SendDataKeys(true)
          .Click("archiveAppliance")
          .HtmlAttributes(new { @style = "width:100px" });
 
 
       }).Width(110);
   })
I also have a "add" button in the grid that opens a popup window
.Editable(editable =>
 
                editable.DisplayDeleteConfirmation("Är du säker på att du vill ta bort detta Delområde?")
                .Mode(GridEditMode.PopUp)
                 
                .TemplateName("PartAreaEdit")
                .Window(w => w.Title("Detaljer"))
            )

H
ow can i change the labels on the buttons "update" and "cancel" in the popup window without making a command.edit() button and use the .Text()
.CancelText().UpdateText() which gives me another button that i don't want.

Thanks.
Vladimir Iliev
Telerik team
 answered on 24 Sep 2013
6 answers
442 views
I am using a Kendo Grid in Server mode. I am using a popup editor for adding/editing records. The popup editor page has several text fields and checkbox list controls.

I am trying to use the checkboxlist control from mvccbl.com as below:


For examples see: http://mvccbl.com/Examples

@Html.CheckBoxListFor(x => x.PostedCities.CityIDs, // checkbox list name, 'PostedCities.CityIDs' in this case
x => x.AvailableCities, // List<City>()
x => x.Id, // City.Id
x => x.Name, // City.Name
x => x.SelectedCities) // List<City>() - should contain only cities to be selected

My requirement is that SelectedCities should be lazy loaded. So I am loading when the user clicks the Add/Edit button. Since there are several checkbox list controls on the editor page and all of them are required, so I am using data annotations [Required] on the posted values.  The problem is that if user forgets to check a box in one list and tries to update, model validation fails and that causes the popup editor to reload the data and thereby user selections are lost.

Any ideas on how to fix this?

Thanks
Daniel
Telerik team
 answered on 24 Sep 2013
1 answer
114 views
Hi,

I have a bug in my application but seems like I can reproduce this in your demo examples.

If you goto the Sorting example on the grid: http://demos.kendoui.com/web/grid/sorting.html

On the 2nd grid with Multiple column sorting supported, sort by Ship Country then Freight.  click on page 4.  Notice how the Freight is NOT sorted correctly.

Please advise,
Regards
Nga
Top achievements
Rank 1
 answered on 24 Sep 2013
3 answers
526 views
Hello,

I have a panel bar with just one item.   Once I have expanded it and then collapse it the highlight is still there.  Using firebug I can see that the "k-state-selected" class is still applied.    When I collapse I want it to go back to the original styling as if it was never expanded.

Please advise how I can accomplish this using the following example - preferable without having to manually remove the styling using Jquery as my implementation will be dynamic so I will not know what the IDs additionally I will have multiple panelbars on the page some of which may be open.

Thanks,
Carrie
@(Html.Kendo().PanelBar()
    .Name("IntroPanelBar")
    .Items(items =>
    {
        items.Add()
            .Text("Getting Started")
            .Content(@<text>
                Just some random content
            </text>);
    })
)
Dimo
Telerik team
 answered on 23 Sep 2013
1 answer
174 views
@(Html.Kendo().Grid<Zeus.Models.AnswerGroup>(Model.Groups)
    .Name("Grid")
    .Columns(columns =>
    {
        columns.Bound(p => p.Id);
        columns.Bound(p => p.QuestionGroupName);
    })
    .Sortable()
    .Pageable()
    .ClientDetailTemplateId("detailTemplate")
    .Events(e => e.DetailInit("onDetailInit"))
    .Events(e => e.DataBound("dataBound"))
)
 
<script id="detailTemplate" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<Zeus.Models.AnswerDetail>()
        .Name("answersGrid_#=Id#")
        .AutoBind(false)
        .DataSource(ds => ds
            .Ajax()
            .ServerOperation(false)).ToClientTemplate()
     )
</script>
 
<script type="text/javascript" language="javascript">
    function dataBound(e) {
        this.expandRow(this.tbody.find("tr.k-master-row").first());
    }
    function onDetailInit(e) {
        var grid = $("#answersGrid_" + e.data.Id).data("kendoGrid");
        grid.dataSource.data(e.Groups.Answers);
    }
</script>
Above is a set of code.  Its not working.  I'm not sure why, maybe there is something obvious.  The grid shows up, but there is no child grid, and the columns are off by one.

Dimiter Madjarov
Telerik team
 answered on 23 Sep 2013
2 answers
249 views
As per the title, is it possible to have the title field populated via a DropDown in the popup editor rather than a text field?

I'm using razor to generate the scheduler.

Thanks.
Sean
Top achievements
Rank 1
 answered on 23 Sep 2013
1 answer
99 views
I had a project with a cultures folder in the javascript directory, did the latest upgrade (918?) and the cultures folder disappeared.

I need the cultures folder for the Australia based date stuff.

I noticed this with other release, just couldn't be bothered to make a post about it.

Thanks
Missing User
 answered on 20 Sep 2013
1 answer
190 views
Hello,

Is it possible to have the panelbar nesting be recursive?   Let's say we are binding to a list of objects inside the model like this:
public class Activity
   {
       public string ActivityId { get; set; }
       public string Description { get; set; }
       public List<Activity> Activities { get; set; }       
   }
Daniel
Telerik team
 answered on 20 Sep 2013
2 answers
378 views
I have a grid to display audits with a datetime field.

I want to have a separate datetimepicker to the grid that i can use to filter the grid results.

I am struggling to get the value of the datetimepicker in the correct format for C# when the request gets posted back.

I receive 'String was not recognized as a valid DateTime'.

The format of the date is en-gb so DD/MM/YYYY HH:mm

If I manually make the format US ie MM/DD/YYYY etc then this works, but we are english and want the format of the datetimepicker to be in en-gb.

How can i get this to work. I really need the time as well as the date.

Here is my grid

@(Html.Kendo().Grid(Model)

    .Name("Grid")
    .Columns(columns =>
        {
            columns.Bound(p => p.AuditCode);
            columns.Bound(p => p.AuditId).Width(60);
            columns.Bound(p => p.AuditText1).Width(200);
            columns.Bound(p => p.AuditText2);
            columns.Bound(p => p.AuditText3);
            columns.Bound(p => p.AuditValue1);
            columns.Bound(p => p.AuditValue2);
            columns.Bound(p => p.DateTime);
        })

     .Pageable(p => p.PageSizes(true))
     .Sortable()
          .Scrollable()
     .HtmlAttributes(new { style = "height:355px;" })
     .Resizable(resize => resize.Columns(true))
     .DataSource(dataSource => dataSource
         .Ajax()
         .PageSize(20)
         .Read(read => read.Action("Audit_Read", "Support"))

     )
)

Here is my date picker

<td>@(Html.Kendo().DateTimePicker().Name("datetimepicker"))</td>

This is the script for searching the grid

<script>
    $(document).ready(function () {
        $("#GO").click(function () {
            $filter = new Array();

            $fromDateTime = $("#datetimepicker").val();

            $toDateTime = $("#datetimepicker2").val();

            dateFromFilter = $fromDateTime; 
            dateToFilter = $toDateTime; 

            if (dateFromFilter) { $filter.push({ field: "DateTime", operator: "isgreaterthanorequalto", value: dateFromFilter }); }
            if (dateToFilter) { $filter.push({ field: "DateTime", operator: "islessthanorequalto", value: dateToFilter }); }

            var grid = $("#Grid").data("kendoGrid");

            grid.dataSource.filter($filter);
        });
    });

</script>
Zac Everett
Top achievements
Rank 1
 answered on 20 Sep 2013
1 answer
578 views
Hi,

I use Kendo UI ASP.NET MVC with VB.NET. My question is:
How I can define the width for the @Html.EditorFor() width css?


SampleView.vbhtml
        <td class="editor-field">
            @Html.EditorFor(Function(model) model.Tel1)        
            @Html.ValidationMessageFor(Function(model) model.Tel1)
        </td>

I tried to define a css style like this:


Site.css

#small-editfor
{
width:30px;
border-bottom-left-radius:0px;
border-bottom-right-radius:0px;
border-top-left-radius:0px;
border-top-right-radius:0px;
}

SampleView.vbhtml
        <td class="editor-field">
            @Html.EditorFor(Function(model) model.Tel1,Nothing, "small-editfor",Nothing)
            @Html.ValidationMessageFor(Function(model) model.Tel1)
        </td>

With this solution I see the width
30px, but the value of the property Tel1 would’t be available on the server.

I tried this also without success:

SampleView.vbhtml
        <td class="editor-field">
            @Html.EditorFor(Function(model) model.Tel1 New With { .class=”small-editfor”})
            @Html.ValidationMessageFor(Function(model) model.Tel1)
        </td>

        <td class="editor-field">
            @Html.EditorFor(Function(model) model.Tel1 New With { .style=”width:30px”})  
            @Html.ValidationMessageFor(Function(model) model.Tel1)
        </td>

Does anyone have an idea?
Dimo
Telerik team
 answered on 20 Sep 2013
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
Upload
ComboBox
MultiSelect
ListView
Window
TabStrip
Menu
Installer and VS Extensions
Spreadsheet
AutoComplete
TreeList
Gantt
PanelBar
NumericTextBox
Filter
ToolTip
Map
Diagram
Button
PivotGrid
Form
ListBox
Splitter
Application
FileManager
Sortable
Calendar
View
MaskedTextBox
PDFViewer
TextBox
Toolbar
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
ListView (Mobile)
Pager
Accessibility
ColorPicker
DateRangePicker
Wizard
Security
Styling
Chat
MediaPlayer
TileLayout
DateInput
Drawer
SplitView
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Template
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
Licensing
Localization
MultiViewCalendar
PopOver (Mobile)
Ripple
ScrollView (Mobile)
Switch (Mobile)
PivotGridV2
FlatColorPicker
ColorPalette
DropDownButton
AIPrompt
PropertyGrid
ActionSheet (Mobile)
BulletGraph
Button (Mobile)
Collapsible
Loader
CircularGauge
SkeletonContainer
Popover
HeatMap
Avatar
ColorGradient
CircularProgressBar
SplitButton
StackLayout
TimeDurationPicker
Chip
ChipList
DockManager
ToggleButton
Sankey
OTPInput
ChartWizard
SpeechToTextButton
InlineAIPrompt
TimePicker
StockChart
RadialGauge
ContextMenu
ArcGauge
AICodingAssistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?