Telerik Forums
UI for ASP.NET MVC Forum
2 answers
255 views
I am trying to setup a panel bar to open when clicked and closed when clicked again. I have tried everything I know to do and have tried the panelBar animation sample with the if statements but for some reason couldn't make it work. Can anyone tell me what I'm doing wrong? Here is my code:

<div id="organizer">
        @(Html.Kendo().PanelBar()
     .Name("panelBar")
     .Animation(true)
      
     .ExpandMode(PanelBarExpandMode.Single)
     .Items(PanelBar =>
         {
             PanelBar.Add()
                 .Expanded(false)                         
                 .Content(@<div>
                    <div class="col-md-5">
                        <div class="panel-body">
                            <div id="employeeInfo">
                                <dl class="dl-horizontal">
                                    <dt>Office:</dt>
                                    <dd>Asheville, NC</dd>
                                    <dt>Department:</dt>
                                    <dd>FTG</dd>
                                    <dt>Position:</dt>
                                    <dd>Manager</dd>
                                    <dt>Phone: </dt>
                                    <dd>336-822-4442</dd>
                                    <dt>Email: </dt>
                                    <dd>victor.canipe@dhgllp.com</dd>
                                </dl>
                            </div>
                        </div>
                    </div>
                    <div class="myTable">
                        <div class="table-responsive">
                            <table class="table table-bordered table-condensed" style="margin-bottom:0px;">
                                <tr>
                                    <th>Skills</th>
                                    <th>Industries</th>
                                    <th>Services</th>
                                </tr>
                                <tr>
                                    <td>Language</td>
                                    <td>Lorem Ipsum</td>
                                    <td>Lorem Ipsum</td>
                                </tr>
                                <tr>
                                    <td>Technology</td>
                                    <td>JAVA</td>
                                    <td>JAVA</td>
                                </tr>
                                <tr>
                                    <td>Technology</td>
                                    <td>Access</td>
                                    <td>Access </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <div class="panel-footer">
                        <div class="col-md-2 col-md-push-6">
                            <a id="more"><i class="fa fa-info-circle"></i>More</a>
                        </div>
                    </div>
                </div>
                 );
          })
        )
    </div>
Kamen Bundev
Telerik team
 answered on 01 Aug 2014
6 answers
378 views
I am having an issue creating a template for the Scheduler. What I am trying to do is set the event style class to one of four classes depending on the value of a given eventstate value from the model.  here is what I have for my whole kendo mvc schelduer with template. Can someone help show me how to write the template so it can do this and be in a valid state.

                @(Html.Kendo().Scheduler<SBAS_Web.Models.AppointmentModel>()
                      .Name("scheduler")
                      .Date(new DateTime(startdate.Year, startdate.Month, startdate.Day))
                      .StartTime(new DateTime(startdate.Year, startdate.Month, startdate.Day, 8, 00, 00))
                      .ShowWorkHours(true)
                      .Views(views => views.DayView(day => day.Selected(true)))
                      .Editable(false)
                      .AllDaySlot(false)
                      .EventTemplate(
                      "<div class='appointment-template  # if(AppointmentState == 'Default'){# DefaultColor #}#  if(AppointmentState == 'Completed'){# CompletedColor #}#  if(AppointmentState == 'ReadyForInvoicing'){# ReadyForInvoicingColor #}#  if(AppointmentState == 'Invoiced'){# InvoicedColor #}#'>" +
                        "<p>" +
                            "#= kendo.toString(start, 'hh:mm') # - #= kendo.toString(end, 'hh:mm') #" +
                        "</p>" +
                        "<p>#= title #</p>" +
                     "</div>")
                      .Timezone("Etc/UTC")
                      .DataSource(d => d
                          .Model(m =>
                          {
                              m.Id(f => f.AppointmentId);
                              m.Field(f => f.Title).DefaultValue("No title");
                              m.RecurrenceId(f => f.RecurrenceID);
                          })
                          .Events(e => e.Error("error_handler"))
                          .Read("Appointments_Read", "Appointment")

                        //.Update("Appointments_Update", "Appointment")
                      )
                      .Group(grp => grp.Orientation(SchedulerGroupOrientation.Vertical))
                )
Georgi Krustev
Telerik team
 answered on 01 Aug 2014
1 answer
284 views
Hi,

I'm wondering if it's possible to separate the input from the icon picker in the DateTimePicker.  To be more clear, I want to use the input to enter the time and have the user select the date from the calendar (it's much quicker and easier to type times, and repetitive to type the date over and over again when it changes far less frequently).

Right now if I apply a format and mask to a DateTimePicker to only display the time and change it, the value reverts to today at whatever time I've entered.  I'm also not sure how I could perhaps hide the clock icon to save some space.

Thanks for any help you can provide,
Kevin
Georgi Krustev
Telerik team
 answered on 31 Jul 2014
2 answers
125 views
Hello,

I'm looking for some guidance on how to implement a page where the user can drag items from a treeview control on to a grid.
The constraints are:
Don't allow the tree to be reorganized via drag and drop function.
The tree is to be lazy loaded.

I've tried to implement this using the kendoDraggable (using a selector to identify the nodes on the treeView) and a kendoDropTarget (with the gird as the target) this allowed me to drag the items, however the drop event never fired on the kendoDropTarget.

I've tried to implement this using the treeView's DragAndDrop functionality, however I don't know how to retrieve the treeView node information from the parameter passed into the kendoDropTarget's drop event.

any suggestions?

thanks in advance
-bill
Bill
Top achievements
Rank 1
 answered on 31 Jul 2014
5 answers
214 views
I have modified the  filter-menu-customization example to perfor server side filtering based on the filter value. I created this action method:

public ActionResult FilterMenuCustomization_Titles([Bind(Prefix="filter[filters][0][value]")]string filterValue)
{
    var db = new SampleEntities();
    var employeeTitles = db.Employees
                           .Select(e => e.Title)
                           .Where(t => t.StartsWith(filterValue))
                           .Distinct();
    return Json(employeeTitles, JsonRequestBehavior.AllowGet);
}

This works fine, but the Bind attribute and the prefix string looks fragile to me. I'm pretty sure there should be a better way to perform the filterValue binding. I imagine there should be a IModelBinder for FIlterDescriptor, so that I could leverage the other aspects of the filter descriptor (starts with, equals, logic operator etc). But I failed to find it.

I posted my example here on Github.

Any suggestions?



Marijn
Top achievements
Rank 1
 answered on 31 Jul 2014
1 answer
87 views
I copied the ListView example - and each time I edit a record, the save and cancel buttons are somehow obscured from view so I can never save.


However I define my EditorTemplate, whenever I edit my record, the same thing happens...

How can you 'control' your controls to stay nicely in the 'record box' like when you're just viewing the records?
Eric
Top achievements
Rank 2
 answered on 30 Jul 2014
1 answer
136 views
Hi,
I'm following the example "binding markers to remote data"
My question is: is it possible to center the map programmatically after the Datasource.read is being called? My datasource contains a list of possible stores. However, I would like to center the map (add a marker) with the initial longitude/latitude of my search request?

Next question : would it be possible (after datasource.read) to center/zoom the map around that layer?

So my code looks more or less as follow:
 @(Html.Kendo().Map()
    .Name("map")
    .Zoom(3)
    .Layers(layers =>
    {
        layers.Add()
            .Type(MapLayerType.Tile)
            .UrlTemplateId("http://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png")
            .Subdomains("a", "b", "c")
            .Attribution("&copy; <a href='http://osm.org/copyright'>OpenStreetMap contributors</a>");

        layers.Add()
            .Type(MapLayerType.Marker)
            .DataSource(dataSource => dataSource
                  .Read(read => read.Action("_StoreLocations", "Order", new { OrderId = Request.QueryString["OrderId"] }))
                  )
            .LocationField("LatLng")

            .TitleField("Name");

    })
Hristo Germanov
Telerik team
 answered on 30 Jul 2014
1 answer
108 views
Is it possible to show inline editable grid in popup editor of parent grid?
There is no success so far - popup window is not showing up but it is showed inline and parent table layout is broken.

Similar question can be found here: 
http://www.telerik.com/forums/editable-grid-in-a-grid-s-popup-editor
http://stackoverflow.com/questions/13402092/editable-grid-in-a-grids-popup-editor
Nikolay Rusev
Telerik team
 answered on 30 Jul 2014
2 answers
183 views
I'm using the MVC TreeView and I'm binding to a datasource as below:

@(Html.Kendo().TreeView()
        .Name("tvDocumentDirs")
        .DataTextField("Name")
        .DataSource(dataSource => dataSource
            .Model(m => m.Id("Path").HasChildren("HasChildren"))
            .Read("ReadDirectoryGetDirs", "Documents").Events(e=>e.RequestEnd("tvDocumentDirs_onRequestEnd").Error("tvDocumentDirs_onError"))
        )
        .Events(events => events
          .Select("tvDocumentDirs_onSelect")
          .Change("tvDocumentDirs_onChange")
        )
    )


The .Read("ReadDirectoryGetDirs", "Documents") - everything works fine. However in the controller action if any error occurs the TreeView hangs (waits indefinitely) what I want to do is handle any errors in the controller action return the error to page, handle the error and then cancel the databind on the treeview. Is it possible to cancel the databind for the treeview?
Petur Subev
Telerik team
 answered on 30 Jul 2014
1 answer
91 views
We use Kendo menu to create main menu items. Some of the menu items have a text box for user to enter search data. The menu is working on IE (version 9.0.8112.16421) but not in Chrome (version 36.0.1985.125). We are using version 2014.1.415.340 of the Kendo.Mvc.dll assembly.

Here is the code for creating the menu:

@(Html.Kendo().Menu()
        .Name("MainMenu2")
        .Items(mainMenu =>
        {
            mainMenu.Add()
                .Text("Order Maintenance");
            mainMenu.Add()
                .Text("Admin")
                .Items(menuItem =>
                {
                    menuItem.Add()
                       .Text("Branch");
                    menuItem.Add()
                        .Text("Container");
                    menuItem.Add()
                        .Text("Employee");
                    menuItem.Add()
                        .Text("Event");
                    menuItem.Add()
                        .Text("Product");
                });
            mainMenu.Add()
                .Text("Invoicing");
            mainMenu.Add()
                .Text("Go To Order")
                .Content(@<text>
                            <table>
                                <tr>
                                    <td>
                                        <input id="DirectOrderNumber" type="text" />
                                        <br />
                                        <span>Order Number</span>
                                    </td>
                                    <td>
                                        <input id="DirectOrderNumberGoButton" type="button" value="Go" />
                                    </td>
                                </tr>
                            </table>
                          </text>
                        );
                        
            mainMenu.Add()
                .Text("Go To Container")
                .Content(@<text>
                            <table>
                                <tr>
                                    <td>
                                        <input id="DirectContainerNumber" type="text" />
                                        <br />
                                        <span>Container Number</span>
                                    </td>
                                    <td>
                                        <input id="DirectContainerNumberGoButton" type="button" value="Go" />
                                    </td>
                                </tr>
                            </table>
                          </text>
                        );
                
            mainMenu.Add()
                .Text("Go To Invoice")
                .Content(@<text>
                            <table>
                                <tr>
                                    <td>
                                       <input id="DirectInvoiceNumber" type="text" />
                                        <br />
                                        <span>Invoice Number</span>
                                    </td>
                                    <td>
                                        <input id="DirectInvoiceNumberGoButton" type="button" value="Go" />
                                    </td>
                                </tr>
                            </table>
                          </text>
                        );
        }))


Please advise how it can be fixed.

Thanks
Iliana Dyankova
Telerik team
 answered on 30 Jul 2014
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
MultiColumnComboBox
Dialog
DropDownTree
Checkbox
Slider
Switch
Notification
Accessibility
ListView (Mobile)
Pager
ColorPicker
DateRangePicker
Wizard
Security
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
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?