Telerik Forums
UI for ASP.NET MVC Forum
3 answers
157 views
Hey, first of all thanks for providing such useful and beautiful components to asp.net. I am developing a mobile web site and would like to use a global drawer in _Layout page for navigation. But somehow i can't replace the default tabstrip with a drawer. Drawer button is visible and clickable but won't bring the drawer if pressed. Can you provide me with basic guidance and a sample code? 
Georgi Krustev
Telerik team
 answered on 20 May 2015
1 answer
2.3K+ views
Hi,

 I am trying to disable kendo
dropdown list in javascript,

And it is not working for me.

Here
the code:

$(“#entityId").data("kendoDropDownList").enable(false);


Thanks,
Iliana Dyankova
Telerik team
 answered on 19 May 2015
1 answer
270 views

 

Hello,

Please give me an idea how to do multiple nested subgrids.  please see the attachment for more details.

I have a main grid (one row), a subgrid1 (9 rows) and below the subgrid1 with 5 hyperlinks.

If a user clink on a hyperlink then a subgrid2 will show the data. If the user click on the different hyperlink then the subgrid2 will be updated.

My question:

how to add 5 hyperlinks below subgrid1.

how to show subgrid2 when a user click on a hyperlink.

Thank you!!! 

 

Plamen Lazarov
Telerik team
 answered on 19 May 2015
3 answers
700 views
Hello,
I have cascading dropdowns in my hierarchical grid (child rows) working fine. What I need is when the last dropdown value is selected that it would call my function (which it is doing fine), pass the id, look up the suggested price for the Price column and update the grid.

Here is what I have so far:

My child grid template:
<script id="orderdetailtemplate" type="text/kendo-tmpl">
    @(Html.Kendo().Grid<Trecero.Models.OrderDetail>()
            .Name("grid_#=OrderId#")
                    .HtmlAttributes(new {@class="MyDetails" })
            .Columns(columns =>
            {
                columns.Bound(o => o.OrderDetailId).Width(100).Title("Id");
                columns.Bound(o => o.DateOrder).Width(75).Title("Date").Width(130).Format("{0:MM/dd/yyyy}");
                columns.ForeignKey(p => p.CompanyId, (System.Collections.IEnumerable)ViewData["companies"], "CompanyId", "CompanyName").Title("Company").Width(100).HeaderHtmlAttributes(new { @title = "Company" }).Width(200).EditorTemplateName("CompanyId");
                columns.ForeignKey(p => p.OrderItemId, (System.Collections.IEnumerable)ViewData["orderitems"], "OrderItemId", "ItemCode").Title("Item").Width(300).HeaderHtmlAttributes(new { @title = "Item" }).Width(300).EditorTemplateName("OrderItem");
                columns.Bound(o => o.Price).Width(110);
                columns.Bound(o => o.OrderItem).ClientTemplate("#=OrderItem.Price#").Width(100);
                columns.Bound(o => o.Qty).Width(80);
                columns.ForeignKey(p => p.OrderStatusId, (System.Collections.IEnumerable)ViewData["orderstatus"], "OrderStatusId", "Description").Title("Status").Width(150);

                columns.Command(command => { command.Edit(); }).Width(150);
            })
                                  .ToolBar(toolbar => toolbar.Create().Text("Add Line").HtmlAttributes(new { @title = "Add Line" }))
                                .Editable(editable => editable.Mode(GridEditMode.InLine))
                                .DataSource(dataSource => dataSource
                                    .Ajax()
                                    .PageSize(10)
                                            .Model(model =>
                                            {
                                                model.Id(p => p.OrderDetailId);
                                                model.Field(p => p.EnteredByUserId).DefaultValue(ViewBag.CurrentUserId);
                                                model.Field(p => p.IsPosted).DefaultValue(false);
                                                model.Field(p => p.OrderId).Editable(false);
                                                model.Field(p => p.OrderDetailId).Editable(false);
                                                model.Field(p => p.DateOrder).DefaultValue(DateTime.Today).Editable(false);
                                                model.Field(p => p.Qty).DefaultValue(1);
                                                model.Field(p => p.OrderStatusId).DefaultValue(1);
                                                model.Field(p => p.Description).Editable(false);
                                            })
                                    .Read(read => read.Action("OrderDetail_Read", "Orders", new { id = "#=OrderId#" }))
                                    .Create(update => update.Action("OrderDetail_Create", "Orders"))
                                    .Update(update => update.Action("OrderDetail_Update", "Orders"))
                                    .Destroy(update => update.Action("OrderDetail_Destroy", "Orders"))
                                )
                                .Pageable()
                                .Sortable()
                                .ToClientTemplate()
    )
</script>

My editor template drop down that is doing the triggering:
@model int

@(Html.Kendo().DropDownListFor(m => m)
                  .AutoBind(false)
                  .OptionLabel("Select Item...")
                  .DataTextField("TextValue")
                  .DataValueField("Id")
                  .Events(e => e.Change("orderitemchanged"))
                  .DataSource(dataSource =>
                  {
                      dataSource.Read(read => read.Action("GetOrderItemListbyCompanyId", "Orders").Data("filterCompanies"))
                                .ServerFiltering(true);
                  })

                  
                  .CascadeFrom("CompanyId")
                  
)
@Html.ValidationMessageFor(m => m)

and finally the event where I need this magic to happen:

function orderitemchanged(e) {
        var tr = $(e.target).closest(".k-detail-row").closest('div.k-grid').data("kendoGrid");
        
        alert(tr);

        //alert(data);

        //var grid = $("#grid").data("kendoGrid"),
        //model = grid.dataItem(this.element.closest("tr"));

       
        //alert(model);

        //var x = e.dataItem['Price'].text;
        //alert(x);

        //var t = $("#OrderItemId").data("kendoDropDownList").value();

        //var items = this.dataSource.data();

        //for (var i = 0; i < items.length; i++) {

        //    alert('hit');

        //    //alert(items[i].value);

        //    items[i].set("Price", 100);
        //}

        //var x = $("#Price").data("kendoTextbox").text();

        //alert(x);

        //var tr = $(e.target).closest("tr"); //get the row

        //var data = this.dataItem(tr); //get the row data so it can be referred later

        //alert(data);
        //data.set("UnitPrice", data.UnitPrice * 10);
       
    }

As you can see, I've tried everything.





Rosen
Telerik team
 answered on 19 May 2015
1 answer
454 views

Hi,

I have one dropdownlist and one grid in my form.I fill grid from dropdownlist change event with script.I initialize the data from page load in the controller.I create dynamic grid with columns.In  dropdownlist item support has diffrent column count and names think about like table.When I selected the item on dropdownlist the grid data will come but columns number will not change how can I change the columns from selected item?.I get the columns and data from controller.Data will come but columns will not come and change.And also the view page(.cshtml) not trigger when grid read the data.How can I solve this issue changing the columns selecting from dropdownlist 

And my view page source codes is here.

Can any one help?

<div id="DropDown">
    @(Html.Kendo().DropDownList()
          .Name("DropDownList")
           
          .HtmlAttributes(new { style = "width: 350px" })
                    .DataTextField("text")
                    .DataValueField("value")
          .Filter("startswith")
          .OptionLabel("--SELECT--")
          .DataSource(source =>
          {
              source.Custom()
                  .Type("aspnetmvc-ajax")
                  .Transport(transport =>
                  {
                      transport.Read("CodesDropDownList", "GlobalSettings");
                  })
                  .Schema(schema =>
                  {
                      schema.Data("Data")
                          .Total("Total");
                  });
          })
           
          .Events(e =>
          {
              e.Change("onChange");
          })
 
    )
</div>

 

<div id="DynmicGrid">
        @(Html.Kendo().Grid<dynamic>()
              .Name("grid")
              .AutoBind(false)
              .Columns(columns =>
              {
                  foreach (DataColumn column in Model.Columns)
                  {
                      var c = columns.Bound(column.ColumnName);
                      c.Title(column.Caption);
                  }
              })
              .Pageable(pager => pager.Refresh(true))
              .Sortable()
              .ToolBar(toolbar => toolbar.Create())
              .Editable(ed => ed.Mode(GridEditMode.PopUp))
              .Selectable(selectable =>
              {
                  selectable.Mode(GridSelectionMode.Single);
                  selectable.Type(GridSelectionType.Row);
              })
              .Navigatable()
               
              .DataSource(dataSource => dataSource
                  .Ajax()
                  .Model(model =>
                  {
 
                      var id = Model.PrimaryKey[0];
 
                      foreach (var keyColumn in Model.PrimaryKey)
                      {
                          var field = model.Field(keyColumn.ColumnName, keyColumn.DataType);
                          field.Editable(false);
                      }
 
                      model.Id(id.ColumnName);
 
                  })
                  .Read(read => read.Action("Read", "GlobalSettings").Data("additionalData"))
                  .Update(update => update.Action("UpdateRecordINGrid", "GlobalSettings"))
                  .Create(read => read.Action("CreateNewRowDataINGrid", "GlobalSettings").Data("additionalData"))
 
              )
              .Events(e =>
              {
 
              })
    
              )
    </div>

var ddlItem;
 
    function onChange() {
 ddlItem = this.value();
var grid = $("#grid").data("kendoGrid");
grid.dataSource.read();
}
function additionalData(e) {
        return { item: ddlItem }
    }

Dimo
Telerik team
 answered on 19 May 2015
1 answer
106 views

I am using rad tree view in my project. Where i need to get all the child node details when i select the parent node alone without expanding for the first time.

 i found in forum that GetItemByPath() (http://docs.telerik.com/devtools/wpf/controls/radtreeview/how-to/get-item-by-path.html) is the only option. 

Please guide me on this..

 Thanks in advance..

Alex Gyoshev
Telerik team
 answered on 19 May 2015
0 answers
104 views

Hi,

Is it possible to have cascaded dropdown list in batch edit? If yes, can you provide us a sample?

 

Thanks,

 

 

 

Vinod
Top achievements
Rank 1
 asked on 18 May 2015
1 answer
105 views

I am using a grid that is inside a content pane for a single page application website.  My problem is that once I put the grid inside the Dojo ExpandoPane with splitter:true for resizing capability, I lose the sticky column headers when I scroll down.  

Here's the HTML I'm using for the grid inside the ExpandoPane... (grid-container is inside a BorderContainer)

<div id="grid-container" dojotype="dojox.layout.ExpandoPane" data-dojo-props="region:'bottom',splitter:true" class="resultsContainer">
    <div id="grid" class="k-content"></div>
</div>

And the css...

#grid-container {
    padding: 0;
    height: 40%;
}

#grid {
    height: auto;
    width: 100%;
    display: inline-table;
}

And populating the grid...

                $("#grid").kendoGrid({
                    columns: columns,
                    navigatable: true,
                    dataSource: results
                });

 

I can get a grid that works as intended if I fix the grid height to 100% as shown below, but I lose the nice resize capability of the ExpandoPane, plus you have to scroll all the way to the right of the grid for the vertical scrollbar.  

#grid {
    height: 100%;
    width: 100%;
    display: inline-table;
}

 So is there any way I can have the resize functionality while retaining the sticky column headers?

Dimo
Telerik team
 answered on 18 May 2015
3 answers
110 views

Hi,

I'm trying to implement an imagebrowser and I want to have one controller for several editors with imageBrowser. but I want to use different root in each one.

how can I make the "path" send a prefix with the file name?

or how can I send more data with the read request (or any other request the imageBrowser allow)?

Thanks

Dekel
Top achievements
Rank 1
 answered on 18 May 2015
6 answers
591 views
I am trying to put a sparkline bullet chart in one column of my grid, and I can't figure out how to pass in the data that is currently in my grid. Do you have an example of using a sparkline in a grid in this manner?

Here is what I currently have. However, 1) I had to hardcode the data as an example, since I have not yet figured out how to pass in the data, and 2) it doesn't work, as it's complaining there is a runtime error of an Invalid template

@(Html.Kendo().Grid<LabResult>(Model.LabResults)
    .Name("grLabResult")
    .Pageable()
    .Sortable(sorting => sorting.SortMode(GridSortMode.SingleColumn))
    .Columns(columns => {
        columns.Bound(a => a.Name);
        columns.Bound(a => a.Value).ClientTemplate("#= Value # #= Unit #");
        columns.Bound(a => a.Range);
        columns.Bound(a => a.Unit).Visible(false);
        columns.Bound(a => a.MaxValue).ClientTemplate(
            Html.Kendo().Sparkline()
            .Name("varSpark_#=LabResultId#")
            .Type(SparklineType.Bullet)
            .Series( series => series.Bullet(new double[]{70}))
            .ValueAxis(axis => axis
                .Numeric()
                .Min(25)
                .Max(75)
                .PlotBands(bands =>
                    {
                        bands.Add().From(0).To(25).Color("#2890cc").Opacity(0.6);
                        bands.Add().From(25).To(75).Color("#2890cc").Opacity(0.8);
                        bands.Add().From(75).To(100).Color("#2890cc").Opacity(0.6);
                    })
                )
            .ToClientTemplate()
            .ToHtmlString()
        );
        })
    .DataSource(dataSource => dataSource
        .Ajax()
        .Model(model =>
        {
            model.Id(a => a.LabResultId);
        })
        .Events(events => events.Error("error_handler"))
        .Sort(sorting => sorting.Add("Name"))
    )
)
This was my attempt to pass in the data, which failed:
.Series( series => series.Bullet(new double[]{Double.Parse("#=Value#")}))
.ValueAxis(axis => axis
            .Numeric()
            .Min(Double.Parse("#=MinValue#"))
            .Max(Double.Parse("#=MaxValue#"))
            .PlotBands(bands =>
            {
                bands.Add().From(0).To(Double.Parse("#=MinValue#")).Color("#2890cc").Opacity(0.6);
                bands.Add().From(Double.Parse("#=MinValue#")).To(Double.Parse("#=MaxValue#")).Color("#2890cc").Opacity(0.8);
                bands.Add().From(Double.Parse("#=MaxValue#")).To(100).Color("#2890cc").Opacity(0.6);
            })
            )
    
Thanks for your help!
Nikolay Rusev
Telerik team
 answered on 18 May 2015
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
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
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?