Telerik Forums
UI for ASP.NET MVC Forum
1 answer
425 views
Hi 
I have a grid with child grid. What i need to achieve is, i should be able to select checkbox in child grid for multiple master rows and get the selected child grid row's ids.
Main grid code: 
  @Code
                     Html.Kendo().Grid(Of PatientEquipmentModel)() _
                         .Name("haemoGrid") _
                         .Columns(Sub(c)
                                      c.Bound(Function(p) p.FullName).ClientTemplate(String.Format("<a title='' href='{0}/{1}'><span style='font-weight:bold;'>#:FullName #</span></a>", Url.Action("EditBay", "Patient"), "#:PatientId#", Url.Action("GetExcel", "Patient"))) _
                                                          .Title("Bays").Filterable(False).Width(250)
                                  End Sub) _
                         .Pageable(Function(p) p.PageSizes(True)) _
                         .Sortable() _
                         .Filterable() _
                         .ClientDetailTemplateId("gridDetailtemplate") _
                         .Groupable() _
                         .Events(Sub(e) e.DataBound("dataBound")) _
                         .DataSource(Sub(d)
                                         d.Ajax() _
                                                         .Read(Function(r) r.Action("GetBays", "Patient").Data("searchCriteria")) _
                                                         .PageSize(20) _
                                                         .Model(Sub(m)
                                                                    m.Id(Function(p) p.PatientId)
                                                                End Sub)
                                     End Sub) _
                     .Render()

                End Code

child grid template:

<script id="gridDetailtemplate" type="text/x-kendo-template">
    @(Html.Kendo().Grid(Of PatientEquipmentModel)() _
                                         .Name("patientEquipmentGrid_#=PatientId#") _
                                         .Columns(Sub(c)
                                                      c.Select().Width(50)
                                                      c.Bound(Function(p) p.EquipmentType).Title("Equipment Type").Width("120")
                                                      c.Bound(Function(p) p.EquipmentModel).Title("Equipment Model").Width("120")
                                                      c.Bound(Function(p) p.EquipmentName).Title("Equipment Name").Width("120")
                                                      c.Bound(Function(p) p.RENNo).Title("REN No").Width("120")
                                                      c.Bound(Function(p) p.SAIDNo).Title("SAID No").Width("120")
                                                      c.Bound(Function(p) p.SerialNo).Title("Serial No").Width("120")
                                                  End Sub) _
                                                  .Events(Sub(e) e.Change("onSelect")) _
                                                 .DataSource(Sub(d)
                                                                 d.Ajax() _
                                                                 .Read(Function(r) r.Action("GetPatientEquipments", "Patient", New With {.patientid = "#=PatientId#"})) _
                                                                 .Model(Sub(m)
                                                                            m.Id(Function(p) p.EquipmentId)
                                                                        End Sub) _
                                                                 .PageSize(20)
                                                             End Sub) _
                                                 .ToClientTemplate())
</script>
Nikolay
Telerik team
 answered on 30 Sep 2020
3 answers
766 views

I have a grid with a column that when not editing I want to show a percentage as 20.00% then when you click to edit, use a NumercTextBoxFor that will limit what you enter to only numerics and a single decimal, then round and/or limit to 2 decimal places (either is fine).

cshtml:

@{
    List<AllocationProducts> alloc = new List<AllocationProducts>();
    alloc.Add(new AllocationProducts { ProductID = 1, ProductName = "productOne", ProductType = "Model", ProductDescription = "Description one", ProductAllocation = 0.1 });
    alloc.Add(new AllocationProducts { ProductID = 2, ProductName = "product2", ProductType = "Model", ProductDescription = "Description two", ProductAllocation = 0.2 });
    alloc.Add(new AllocationProducts { ProductID = 3, ProductName = "product3", ProductType = "Model", ProductDescription = "Description three", ProductAllocation = 0.3 });
    alloc.Add(new AllocationProducts { ProductID = 4, ProductName = "product4", ProductType = "Model", ProductDescription = "Description four", ProductAllocation = 0.4 });
 
}
 
<div class="summary-view">
    @(Html.Kendo().Grid<AllocationProducts>(alloc)
            .Name("allocationProducts")
            .Columns(columns =>
            {
                columns.Bound(o => o.ProductID).Hidden(true);
                columns.Bound(o => o.ProductType).Title("PRODUCT TYPE").HeaderHtmlAttributes(new { style = "text-align: left;" }).Width("10%").HtmlAttributes(new { style = "padding-left: 10px;" });
                columns.Bound(o => o.AllocationAsWholeNumber).Title("TARGET WEIGHT").HeaderHtmlAttributes(new { style = "text-align: right;" }).Template(@<text></text>)
                    .ClientTemplate("<input type='text' id='ProductAllocation_#= ProductID #' value='#= kendo.format('{0:p}', ProductAllocation) #' style='padding: 2px; width: 91%; border: none; text-align: right;' class='product-allocation-input' />")
                    .HtmlAttributes(new { style = "text-align: right; padding-right: 10px;", @class = "product-allocation-field" })
                    .EditorTemplateName("KendoNumericTextBox");
            })
            .DataSource(dataSource => dataSource
            .Ajax()
            .ServerOperation(false)
            .Batch(true)
            .Model(model =>
            {
                model.Id(o => o.ProductID);
            })
            )
            .Mobile()
            .Selectable()
            .PersistSelection()
            .Editable(editable => editable.Mode(GridEditMode.InCell).DisplayDeleteConfirmation(false))
            )
 
</div>

 

KendoNuericTextBox.cshtml:

@model double?
 
@(Html.Kendo().NumericTextBoxFor<double>(m => m)
            .Name("currency")
            .Spinners(false)
            .Decimals(2)
            .Format("p")
            .Min(0)
            .Max(100)
            .HtmlAttributes(new { style = "width: 100%", title = "currency" })
      )

 

Objects

public class AllocationProducts
{
    public int ProductID { get; set; }
    public int ClassID { get; set; }
    public string ProductType { get; set; }
    public string ProductName { get; set; }
    public string ProductDescription { get; set; }
    public double ProductAllocation { get; set; }
    public decimal ProductAllocationDecimal
    {
        get
        {
            return Convert.ToDecimal(ProductAllocation);
        }
    }
    public double AllocationAsWholeNumber
    {
        get
        {
            return ProductAllocation * 100;
        }
    }
    public string AllocationAsPercent
    {
        get
        {
            return ProductAllocation.ToString("p2");
        }
    }
}

 

When I run this, I get a standard input box rendered to HTML that allows characters and doesn't do any kind of rounding or limiting of chars.

Eyup
Telerik team
 answered on 30 Sep 2020
1 answer
191 views
I have installed Telerik UI for ASP.NET MVC R1 2020 SP2 and I'm trying to use the pager component as set in the docs https://demos.telerik.com/aspnet-mvc/pager/integration but I'm getting the following error: "error CS1061: 'Kendo.Mvc.UI.Fluent.WidgetFactory<*********>' does not contain a definition for 'Pager' and no extension method 'Pager' accepting a first argument of type." The project used to work with the Kendo MVC 2018 version so I don't know if I need to update some path in my project in order to be able to use the Pager component. Has anyone faced this issue?
Nikolay
Telerik team
 answered on 30 Sep 2020
7 answers
3.1K+ views

Hello,

I tried to conditional set Grid column Editable status at run time as below code but caused page error. Could anyone give me advice how to do it?  Thanks in advance.

 

      .Model(model =>

              {

                  model.Id(p => p.Id);

                  model.Field(p => p.JobTitle).Editable("isEditable");  <---

                  model.Field(p => p.FirstName).Editable(true);

                  model.Field(p => p.LastName).Editable(true);

              })

 

<script>

    function isEditable(dataItem) {

        return dataItem.Id !=3;

    }

</script>

Tsvetomir
Telerik team
 answered on 30 Sep 2020
2 answers
2.4K+ views
Hi, I just installed new version of Progress ASP NET MVC library, the installer ended without errors and updated my VS 2019 correctly, but now I don't have a telerik menu in VS UI and if I try to create a new Telerik project from: Extensions-> Telerik->Telerik UI ASP.NET MVC->Create new Telerik project it just open normal project template list without any Telerik template inside (see attach)
I tried to uninstall and reintall Telerik MVC Package, also reinstall just the VS extension but nothing changed
Vesko
Telerik team
 answered on 29 Sep 2020
12 answers
2.2K+ views

I'm not sure if this only happens in the Grid, but I have been consistently getting a 404 error upon getting http://localhost/Content/kendo/2015.2.902/images/kendoui.woff?v=1.1.  Any idea what might be happening?

Thanks.

Laurie

Misho
Telerik team
 answered on 29 Sep 2020
3 answers
238 views

Hello all, I am using telerik MVC grid in my application, i have problem with the loading indicator in chrome browser but is shown in firefox(laptop with resolution 1680*1050), but the loading image is shown in both chrome and fiefox browsers in desktop with resolution 1920*1080. What could be the problem? has anyone has encountered this problem?

 

 

Geetha
Top achievements
Rank 1
Veteran
 answered on 29 Sep 2020
8 answers
386 views

Hello,

Scheduler event color doesn't show with datasource autobind set to false

Datasource of the scheduler is being read after dropdownlist is loaded  ...

        var scheduler = $("#scheduler").data("kendoScheduler");
        scheduler.dataSource.read();

 

Once the editor was open and closed, the color of the events will be shown, see attachment.

 

Neli
Telerik team
 answered on 29 Sep 2020
1 answer
184 views

We have a problem that after implementing the localization as described in article https://docs.telerik.com/aspnet-mvc/globalization/overview the text "items per page" is only localized after hitting F5 once. Initially it is always displayed in English.

I then created a vanilla Telerik MVC project incl. the grid, from the the default Telerik templates. When I activate paging there, the text is automatically correctly localized.

What I am wondering about ist, that I don't see any localized JS files in that project. Can you tell me how your template project applies the localization? It seems to differ from the mentioned article in this regard.

 

Regards

Kai

Alex Hajigeorgieva
Telerik team
 answered on 25 Sep 2020
1 answer
241 views

Hello,

I have problem in my timelineWeekview, that if too many Events are shown, the Columns will be shorter than the Scheduler (EventRow.png).

so I have this class in my css file :

#scheduler .k-scheduler-timelineWeekview tr:nth-child(2) td:nth-child(2) .k-scheduler-content .k-scheduler-table tbody tr{
    height:100vh !important;
}

 

what i need, is doing this in jquery and every time the user adds an Event (scheduler changes its Height !), it should change the height of this row too.

so i tried this :

$("#scheduler .k-scheduler-timelineWeekview tr:nth-child(2) td:nth-child(2) .k-scheduler-content .k-scheduler-table tbody tr").css("height","widget.height");

 

so i thought that the problem is from the css widget height, that I'm not being able to get the new height, so i tried too many other functions (hide(), remove(), attr(), . . . . . .), but the problem is that i can't select this classes.

 

any help will be great 

thanks in advance

Blackout

Aleksandar
Telerik team
 answered on 25 Sep 2020
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
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
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?