Telerik Forums
UI for ASP.NET MVC Forum
3 answers
3.5K+ views
I recently added Grid Column Menus to my grid, primarily to give the user the ability to hide/show columns.
.ColumnMenu(menu => menu.Columns(true).Sortable(false))

I want some columns hidden by default, and the user to have the ability to display them if needed. So, using the MVC helpers, I set Visible(false) like so:
column.Bound(c => c.Submitter).Title("Submitter").Visible(false);
However, to my surprise, columns hidden in this manner do not show up in the column menu. It's like they don't exist.

I was able to get it working correctly by loading all columns as normal and then hiding certain ones via JavaScript:

$(document).ready(function () {
    var grid = $('#issueGrid').data('kendoGrid');
    grid.hideColumn('Submitter');

But I have 2 issues with this:
A) There is some graphical stutter as the columns are noticably loaded and then hidden.
B) I shouldn't have to do this. Setting a column as .Visible(false) should still have that column appear in the Menus.

Is this a bug? Why does setting a column as .Visible(false) cause it to act like it does not exist, in regards to the Column Menu? I wish I didn't have to write 10+ extra lines of script to do this.

Thanks.
Dave
Top achievements
Rank 1
 answered on 15 Oct 2013
2 answers
892 views
I would like to get the text for a selected menu item from JavaScript/jQuery in a clean way. I would rather not use jQuery matching for specific classes if possible, I'm hoping for something like:

$("#myMenu").getSelectedItemText()

Alternatively, I guess I could populate a variable during a Select event handler or something. 

Any suggestions?  Thanks!
Ian
Top achievements
Rank 1
 answered on 14 Oct 2013
1 answer
118 views
Change skin to metro

Select dropdown here: http://demos.kendoui.com/web/combobox/serverfiltering.html

Notice how the ajax loading icon is the same color as background
Dimo
Telerik team
 answered on 14 Oct 2013
2 answers
98 views
Borwser : Chrome
Version : version 2013.2.918

Chrome:CHROME IMG
IE11:IE11 IMG


Plz Help fix it
Chia Hao
Top achievements
Rank 1
 answered on 14 Oct 2013
1 answer
605 views
I've got a menu bound to a model but I can't seem to set the LinkHtmlAttributes.

It looks like this:


@(Html.Kendo().Menu()
    .Name("menu")
    .BindTo(Model, mappings =>
        {
            mappings.For<MenuModel>(binding => binding
                .ItemDataBound((items, menu) =>
                    {
                        items.Text = menu.Text;
//I want to set the link attributes, but this isn't working
items.LinkHtmlAttributes = new { foo = "bar" };
                    })
)
Ignacio
Top achievements
Rank 1
 answered on 11 Oct 2013
3 answers
805 views
Hi all! 
So i have Upload on my page:

@(Html.Kendo().Upload()
    .Name("docUpload")
    .Multiple(false)
    .ShowFileList(false)
    .Events(e => e.Upload("onUpload").Success("onDocUploaded"))
    .Async(a => a
        .Save("DocUpload", "Documents")
        .AutoUpload(true)
    )
)
this one works fine and all events - onUpload and onDocUploaded - firing as expected.

But if i want to add custom messages:

@(Html.Kendo().Upload()
    .Name("docUpload")
    .Messages(x=>x.Select("Select document..."))
    .Multiple(false)
    .ShowFileList(false)
    .Events(e => e.Upload("onUpload").Success("onDocUploaded"))
    .Async(a => a
        .Save("DocUpload", "Documents")
        .AutoUpload(true)
    )
)
it will break events, and no events (except onComplete) are called in my JavaScript.
I have tested it on Chrome (last version) and IE 9. My KendoUI version is 2013.2.918.
Is there any workarounds?
Dimiter Madjarov
Telerik team
 answered on 11 Oct 2013
1 answer
8.3K+ views
Hi Support,

I am trying to use FLEET_CUSTOM_FIELD_VALUE field for multiple data type while editing in grid,

so i tried using if condition for value coming through FLEET_CUSTOM_FIELD_DATATYPE  field in column but it's giving me error.

Any suggestion will be great.


public class CustomFieldValue
    {
        public int FLEET_ID { get; set; }
        public int FLEET_CUSTOM_FIELD_ID { get; set; }
        public string FLEET_CUSTOM_FIELD_VALUE { get; set; }
        public string FLEET_CUSTOM_FIELD_DESCRIPTION { get; set; }
        public string FLEET_CUSTOM_FIELD_DATATYPE { get; set; }
        public short FIELD_POSITION { get; set; }
        public string USER_UPDATE { get; set; }
    }

@(Html.Kendo().Grid<CustomFieldValue>()
            .Name("CustomFieldValue" + @ViewData["FLEET_ID"]) 
        .Sortable()
        .Pageable(paging =>
        {
            paging.Enabled(true);
            paging.Info(true);
            paging.PageSizes(true);
            paging.Numeric(true);
            paging.PreviousNext(true);
            paging.Refresh(true);
            paging.PageSizes(new int[5] { 5, 10, 15, 20, 25 });
        })
        .DataSource(dataSource => dataSource
            .Ajax()
                .Events(events =>
                {
                    events.RequestEnd("onCustomFieldValueRequestEnd");
                    events.Error("onCustomFieldValueListError"); 
                  
                })
                
            .PageSize(15)
            .Model(model =>
                {
                    model.Id(f => f.FLEET_CUSTOM_FIELD_ID);
                    model.Field(f => f.FLEET_CUSTOM_FIELD_DESCRIPTION).Editable(false);
                })

            .Read(read => read.Action("_CustomFieldValueList", "CustomFieldValueList", new { fleetId = ViewData["FLEET_ID"] }))
            .Update(update => update.Action("_CustomFieldValueListEdit", "CustomFieldValueList"))                  
        )
        .Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
        .Editable(editable => 
        {
            editable.Mode(GridEditMode.InLine);            
        })
        .Reorderable(reorder => reorder.Columns(true))
        .Filterable()
        .Columns(columns =>
        {
            columns.Bound(f => f.FLEET_CUSTOM_FIELD_ID).Title(" ").Hidden();
            columns.Bound(f => f.FLEET_CUSTOM_FIELD_DATATYPE).Title(" ").Hidden();
            columns.Bound(f => f.FLEET_CUSTOM_FIELD_DESCRIPTION).Title("Description");

            if ("#=FLEET_CUSTOM_FIELD_DATATYPE#" == "D")
            {
                columns.Bound(f => f.FLEET_CUSTOM_FIELD_VALUE).Title("Field value").EditorTemplateName("_Date").Width(250);
            }
            else
            {
                columns.Bound(f => f.FLEET_CUSTOM_FIELD_VALUE).Title("Field value").Width(250);
            }
            
            
            columns.Command(command =>
            {
                command.Edit();
            }).Width(250).Title("Commands").HeaderHtmlAttributes(new { @style = "text-align:left; text-decoration:Underline;" });
        })
        .Events(e=>e.Edit("edit"))
        
    ) 
Dimo
Telerik team
 answered on 11 Oct 2013
1 answer
456 views
Please see attached code. I noticed that when the date portion was invalid I got the standard "date is not valid".  However if only the time portion was invalid, the form would validate.  So I added the custom rules scripting.  That seemed to do the trick.  However, now if the time is wrong, the message shows above the datetimepicker.  If the date is wrong, it shows below the datetimepicker.  If both are wrong it shows both messages duplicated.  I must be doing something wrong.  I've spend hours on this so I thought I'd ask.  thank you.

<script>

    $("#theform").kendoValidator({
        rules: {
            date: function (input) {
                if (!kendo.parseDate(input.val()))
                    return false;
                else return true;
            }
        },
        messages: {
            date: "Please enter a valid date/time."
        }
    });


</script>
<div id="sleepdelayform" class="centerform">
    <label>Select a date and time for when you'd like this task to be available:</label>

    <br /><br />
    @using (Ajax.BeginForm("SleepDelaySave", "Home", new AjaxOptions
    {
        UpdateTargetId = "sleepdelayform"
    }, new { id = "theform"}))
    {
        <input type="hidden" id="serialNumber" name="serialNumber" value="@(ViewBag.serialNumber)" />
        @(Html.Kendo().DateTimePicker()
            .Name("sleepdelaydatetimepicker")
            .Value(DateTime.Now)
        )  
        
        <br />
        <span class="k-invalid-msg" data-for="sleepdelaydatetimepicker"></span>
        <br />
        <input type="submit" class="k-button" value="Save" />
    }
</div>
Alexander Popov
Telerik team
 answered on 11 Oct 2013
1 answer
151 views
Hi,
I am trying to upgrade my ASP.Net MVC4 project to the latest version of Kendo UI. I used the upgrade wizard, but it broke my project and caused some issues. So now I am trying to upgrade manually.

My question is what is the purpose of creating bundles for the CSS and JavaScript files of Kendo UI in BundlesConfig.cs file. My current project has these bundles added, but if I remove them, everything runs fine.

Also my current project does not contain a reference to Kendo.Mvc assembly in the web.config file. So if this step is mandatory, then how is my project working now. And should I include it while upgrading to the latest version and what is the purpose of this

Thanks
Dimo
Telerik team
 answered on 11 Oct 2013
3 answers
167 views
I wanted to set the menu item selection based on a persisted item index but cannot see how I can access the menu item index from within the BindTo() section. I have worked around this in the code below by matching on the label but this is not ideal. Is it possible to compare the item index instead?  Thanks.

@(Html.Kendo().Menu()
      .Name("viewTypeMenu")
      .HighlightPath(false)
      .BindTo(Model.ViewTypeLabels, (item, value) =>
      {
          item.Text = value;
          item.Selected = (value == Model.SelectedViewTypeLabel);
      })
)
Ian
Top achievements
Rank 1
 answered on 10 Oct 2013
Narrow your results
Selected tags
Tags
Grid
General Discussions
Scheduler
DropDownList
Chart
Editor
TreeView
DatePicker
ComboBox
Upload
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
Dialog
MultiColumnComboBox
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
Security
ColorPicker
DateRangePicker
Wizard
Styling
Chat
DateInput
MediaPlayer
TileLayout
Drawer
SplitView
Template
Barcode
ButtonGroup (Mobile)
Drawer (Mobile)
ImageEditor
RadioGroup
Sparkline
Stepper
TabStrip (Mobile)
GridLayout
Badge
LinearGauge
ModalView
ResponsivePanel
TextArea
Breadcrumb
ExpansionPanel
Licensing
Rating
ScrollView
ButtonGroup
CheckBoxGroup
NavBar
ProgressBar
QRCode
RadioButton
Scroller
Timeline
TreeMap
TaskBoard
OrgChart
Captcha
ActionSheet
Signature
DateTimePicker
AppBar
BottomNavigation
Card
FloatingActionButton
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
SmartPasteButton
PromptBox
SegmentedControl
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?