Telerik Forums
UI for ASP.NET MVC Forum
1 answer
1.2K+ views
I've got a grid that I'm creating using the MVC wrapper.  I have fields defined as numeric but when I edit the fields they show a large textbox (not sure why they are so large) and never a numeric box.  I have found that when I add a client template that is a numeric text box the box shows up but doesn't appear with proper styling.  When I edit and cancel the box suddenly shows proper formatting.  I've looked at the HTML document and it seems that the wrapper objects are not being added.  I'm not sure what I'm doing wrong.  

Here is my MVC view code:
@(Html.Kendo().Grid<eLuminate.Radar.Web.Provider.Model.Procedures.Price>().Name("prices").Columns(columns =>
    {
        columns.Bound(c => c.Name).Width(250);
        columns.Bound(c => c.RelatedProviderName).Title(Model.IsFacility ? "Professional" : "Facility").Width(150);
        columns.Bound(c => c.High).Format("{0:C0}").Groupable(false).Filterable(false).Width(75).Hidden();
        columns.Bound(c => c.Low).Format("{0:C0}").Groupable(false).Filterable(false).Width(75).Hidden();
        columns.Bound(c => c.Average).Format("{0:C0}").Groupable(false).Filterable(false).Width(75);
        columns.Bound(c => c.MyPrice).Format("{0:C0}").Filterable(false).Width(125)
            .ClientTemplate(Html.Kendo().NumericTextBox().Name("mp_#=ID#").Min(0).HtmlAttributes(new { value = "#=MyPrice#", style = "width: 100px;" }).ToClientTemplate().ToHtmlString());
        columns.Command(command => { command.Edit(); command.Destroy(); }).Width(200);
    })
    .ToolBar(toolbar => toolbar.Create())
    .Resizable(r => r.Columns(true))
    .Filterable()
    .ColumnMenu()
    .DataSource(dataSource => dataSource
        .Ajax()
        .Batch(false)
        .Events(events => events.Error("error_handler"))
        .Model(m =>
        {
            m.Id(p => p.ID);
            m.Field(p => p.Name).Editable(false);
            m.Field(p => p.RelatedProviderName).Editable(false);
            m.Field(p => p.High).Editable(false);
            m.Field(p => p.Low).Editable(false);
            m.Field(p => p.Average).Editable(false);
        })
        .Update(update => update.Action("UpdatePrice", "Procedures", new { id = Model.ID }))
        .Read(read => read.Action("ReadPrice", "Procedures", new { id = Model.ID }))
        .Destroy(destroy => destroy.Action("DeletePrice", "Procedures", new { id = Model.ID }))
        .Create(create => create.Action("AddPrice", "Procedures", new { id = Model.ID }))
    )
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Selectable()
    .ClientDetailTemplateId("analytics")
    .Groupable()
    .HtmlAttributes(new { style = "width: 800px;" }))
Daniel
Telerik team
 answered on 29 Jan 2013
2 answers
247 views
I've got several dropdown lists in an editor template, for use with a grids pop-up edit window.

They are displayed fine, and if a value other than the default one is selected, data is returned to the controller.

However, if the user leaves the default values as presented, null values are returned to the controller.

The definition is:
@(Html.Kendo().DropDownListFor(c=>c.Site)
.Name("Site")
.DataTextField("SiteDescription")
.DataValueField("Site")
 
 
.DataSource(source=>source
    .Read(read=>read.Action("GetSiteLookUpList","ManualData"))))
@Html.ValidationMessageFor(c => c.Site  )
Do I need to set anything else so the default value is posted back?



AP
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 29 Jan 2013
1 answer
65 views
Is it possible to initialise grid from table that only contains one page of datasource and use remote datasource for another pages?

Ie. there will be HTML table containing page 5 and I want to generate kendo grid from this table and need to tell kendo that its page 5 and to load another pages to use datasource.
Vladimir Iliev
Telerik team
 answered on 29 Jan 2013
4 answers
601 views
Hi,

I have a straight forward implementation of cascading comboxes that doesn't seem to recognize the DataBound event.  I have downloaded the latest keno js files, but nothing seems to work.  When referencing the events I can see these actions available: Change, Close, Open and Select.

Here is the code:
@(Html.Kendo().ComboBox()
                   .Name("classes")
                   .HighlightFirst(true)
                   .Filter("contains")
                   .Placeholder("Select Class...")
                   .HtmlAttributes(new { style = "width: 300px;" })
                   .Suggest(true)
                   .DataTextField("Name")
                   .DataValueField("Id")
                   .DataSource(source => source.Read(read => read.Action("GetClassList", "RCS"))).AutoBind(true))
 
            @(Html.Kendo().ComboBox()
                  .Name("vendorsforClass")
                  .CascadeFrom("classes")
                  .AutoBind(false)
                  .Value("Select Vendor...")
                  .HtmlAttributes(new { style = "width: 300px;" })
                  .DataTextField("Name")
                  .DataValueField("Id")
                  .Events(e => { e.DataBound("vendorForClassChangeEvent")})
                  .DataSource(source =>
                      {
                          source.Read(read =>
                              {
                                  read.Action("GetVendorListByClass", "RCS").Data("filterProducts");
                              }).ServerFiltering(true);
                      }))
 
            <script type="text/javascript">
 
                function vendorForClassChangeEvent() {
                    alert('here');
                    var combobox = $("#vendorsforClass").data("kendoComboBox");
                    combobox.open();
                }
                 
                function filterProducts() {
 
                    return {
                        classes: $("#classes").val()
                    };
                }
Any help or thoughts would be appreciated.

Thank you,
Tad
TAD RHODES
Top achievements
Rank 1
 answered on 28 Jan 2013
2 answers
221 views
I have a tabstrip set up with multiple grids on a page - one grid per tab.  For each grid i have virtual scrolling set up.  The grid on the first tab works properly, but if I go to any of the subsequent tabs the scroll handle is not present on the scrollbar.  If I edit a cell or sort or filter the grid, then the scroll handle shows up and all is good.  It's just in the initial view for grids that aren't on the initial active tab.  Any ideas if it's something I'm doing wrong or if it might be a bug with the code?

I'm using IE9 as my browser.  If you want a sample to duplicate it on, you could probably throw the virtualization grid demo into a tabstrip and should be able to see this behavior.

Thanks for your help!

Regards,
Brian
Brian Roth
Top achievements
Rank 1
 answered on 28 Jan 2013
1 answer
90 views
Hi,

I have a grid with 2 cascade dropdownlist. When I am in the edit mode of the grid using a popup, and i change the value of the parent dropdownlist, the second dropdownlist is repopulated correctly. But if the user doesn't choose anything from the second dropdownlist and just submits. The old value of the second dropdownlist is sent to the controller in the bound model. Although this seems correct by design since the user didn't actually change the value of the second dropdownlist but for data integration this is incorrect.

What I want to be able to do is change the value of the second dropdownlist when the first one changes into a default value of zero for example or null, so that it would trigger the validation error of the dropdownlist.

Best regards,
Sameh
Petur Subev
Telerik team
 answered on 28 Jan 2013
1 answer
439 views
Hi

I have a grid with a detail template that includes a tabstrip with a grid. This works fine but when I select a row on the grid in the detail template I want it to load data based on that row in the grid in the second tab.

This is the code for the details template

<script id="employeesTemplate" type="text/kendo-tmpl">

    @(Html.Kendo().TabStrip()

            .Name("TabStrip_#=ReqId#")

            .SelectedIndex(0)

            .Items(items =>

            {

                items.Add().Text("Exposure Scenarios").Content(@<text>

                    @(Html.Kendo().Grid<Sypol.Matcon.Infrastructure.Models.ExpScen>()

                        .Name("Orders_#=ReqId#")

                        .Columns(columns =>

                        {

                            columns.Bound(o => o.ExpId).Width(101);

                            columns.Bound(o => o.Quantity).Width(140);

                            columns.Bound(o => o.Freq).Width(200);

                            columns.Bound(o => o.Number);

                            columns.Bound(o => o.ContCode);

                            columns.Bound(o => o.SubCont);

                            //columns.ForeignKey(o => o.EXPID, (IEnumerable)ViewData["activities"], "EXPID", "METHOD");

 

                        })

                        .DataSource(dataSource => dataSource

                            .Ajax()

                            .Read(read => read.Action("HierarchyBinding_Orders", "InTray", new { reqID = "#=ReqId#" }))

 

                        )

                        .AutoBind(true)

                        .ToClientTemplate())

                </text>                        

                );

                items.Add().Text("Details").Content(

                    "<div class='employee-details'>" +

                        "<ul>" +

                            "<li><label>Code:</label>#= ExpId#</li>" +

                        "</ul>" +

                    "</div>"

                );               

            })

            .ToClientTemplate())

</script>

I basically want to fill the 'Details' tab with data from the selected row on the grid. At the moment I can only manage to add data from the Parent grid. Is it possible to do this or would I have to create another details template to get this information?

Thanks
Vladimir Iliev
Telerik team
 answered on 28 Jan 2013
6 answers
272 views
Today I updated to 2012.3.1315 and the menu's work differently. I have a horizontal menu and the menus drop down fine, but sub-menus rather than flying out to the right (or left if collision is detected) just pop-over the existing menu. Here is a screen cast of it:

http://screencast.com/t/ItUsyEGtB

Not good. Is there a new option I need to set. While I am using KendoUI MVC complete I am not using the wrappers for the menu... I just use the client side API.

BOb

Dimo
Telerik team
 answered on 28 Jan 2013
2 answers
96 views
I am doing a manual Jquery.Ajax post as my screen has data outside the grid that has to be posted to the Action.

I am able to do an Jquery.each to populate the model from the grid.dataSource.data, but even if I do a date.toUTCString() the HttpPost Action receives the date incorrectly after I do a JSON.stringify(model) in the Ajax post.

From Jquery AJAX post in View: 
1/25/2013 (resolved to "Fri, 25 Jan 2013 05:00:00 GMT" with the .toUTCstring())
NOTE: I did try this without a .toUTCstring pior, as well as .toDateString()

Resolved To Controller Action: 
{1/23/2013 11:01:57 AM}

Has anyone encountered something like this? If so, how have you resolved it?
Sean
Top achievements
Rank 1
 answered on 25 Jan 2013
2 answers
576 views
I've implemented a right-click context menu for some of the grids in our project.  One of these grids is set up to allow multiple row selection.  I was hoping that when the user right-clicks I could have some options for them which would operate on all currently selected rows.  But it seems that the right-click is interpreted as a "Select" click and proceeds to select the row that the user has clicked over, which causes all the other rows to be deselected.  Is there a way to treat a right-click differently and have it not affect which rows are selected?

Thanks for your help!

Brian
Brian Roth
Top achievements
Rank 1
 answered on 25 Jan 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
ColorPicker
DateRangePicker
Security
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
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?