Telerik Forums
Kendo UI for jQuery Forum
2 answers
3.8K+ views
Hi,

I'm using Kendo UI Professional with Angular 4. I have a kendo grid with a bunch of rows and I'd like alternate rows to be colored. Ex. 1,3,5 rows in blue and 2,4,6 in gray.

How do I achieve this? Assigning a class to the kendo-grid-column and then changing its background obviously changes color for all the rows.

Thanks!
Stefan
Telerik team
 answered on 13 Jul 2017
3 answers
479 views

Hi,

It's a bug?
In hierarchy grid, and Inline Edit mode.

When I updated, and the RETURN result is null,
But why the Grid still has data?

MVC APSX:

<%:
        Html.Kendo().Grid<CarryingCapacityMD>()
            .Name("Grid").ToolBar(commands => commands.Create())
            .Columns
            (
                columns =>
                {
                    columns.Bound(o => o.Tonnage).Width(75).Format("{0:0.00}");
                    columns.Bound(o => o.CageCount).Width(75);
                    columns.Command
                    (
                        commands =>
                        {
                            commands.Edit();
                            commands.Destroy();
                        }
                    ).Width(180).Title("操作");
                }
            )
            .ClientDetailTemplateId("freightInformationTemplate")
            .DataSource
            (
                dataSource =>
                    dataSource.Ajax()
                        .Model
                        (
                            model =>
                            {
                                model.Id(p => p.CarryingCapacityID);
                            }
                        )
                        .Read("_AjaxCarryingCapacityList", "Configurations")
                        .Update("_AjaxCarryingCapacityUpdate", "Configurations")
                        .Destroy("_AjaxCarryingCapacityDelete", "Configurations")
                        .Create("_AjaxCarryingCapacityInsert", "Configurations")
            )
            .Editable(editing => editing.Mode(GridEditMode.PopUp))
    %>
    <script id="freightInformationTemplate" type="text/kendo-tmpl">
        <%:
            Html.Kendo().Grid<FreightInformation>()
                .Name("FreightInfo_#=CarryingCapacityID#")
                .Columns
                (
                    columns =>
                    {
                        columns.Bound(o => o.LocationName).Width(75);
                        columns.Bound(o => o.Mileage).Width(75);
                        columns.Bound(o => o.Freight).Width(75).Format("{0:¥0.00}");
                        columns.Command(command => { command.Edit(); });
                    }
                )
                .DataSource
                (
                    dataSource => dataSource.Ajax().ServerOperation(true)
                        .Model
                        (
                            model =>
                            {
                                model.Id(p => p.FreightID);
                                model.Field(p => p.LocationName).Editable(false);
                                model.Field(p => p.Mileage).Editable(false);
                            }
                        )
                        .Read("_AjaxGetFreightInfoListByCarryingCapacityID", "Configurations", new { carryingCapacityID = "#=CarryingCapacityID#" })
                        .Update("_AjaxLocationUpdateForCarryingCapacity", "Configurations")
                )
                //.Events(events => { events.SaveChanges("onSave");})
                .Editable(editing => editing.Mode(GridEditMode.InLine))
                //.ToolBar(commands => { commands.Save(); })
                .ToClientTemplate()
         %>

Behind Code:

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult _AjaxLocationUpdateForCarryingCapacity(FreightInformation updatedFreightInformation)
{
    if (ModelState.IsValid)
    {
        freightRepository.UpdateForCarryingCapacity(updatedFreightInformation);
    }
    freightRepository = new FreightRepository();
    return Json(freightRepository.GetFreightInfoByCarryingCapacityID(updatedFreightInformation.CarryingCapacityID)); //this result is null
}

But after update,
the grid is still show data.

Please see attachment file.

Kevin
Top achievements
Rank 1
 answered on 12 Jul 2017
1 answer
156 views

Hi guys I am trying to figure out how to set my center coordinates marker to a different color or a different image if that is easier. 

Scenario:

Based on the center coordinates we would like to place a marker on the map that identifies the center location. This marker should be identifiable by color. A good example of this would be the "You Are Here" on a map program like Around Me.  

It would also be ideal if there were a way to tag specific markers and change their colors. Example all the red markers are restaurants, all the blue markers are pubs, etc.

I have been working with the markerActivate function since from what I have read this is the opportunity to change marker color before rendering. However, I have not discovered a way to get a specific marker by name or coordinates. 

i.e. if (e.marker.someidentifier == 'foo') {

// change marker color code. 

}

Any help you could provide would be greatly appreciated. 

Nathan
Top achievements
Rank 1
 answered on 12 Jul 2017
2 answers
335 views

Hello,

After update to the latest kendo version imageClass for custom commands seems to be not working anymore, what is the replacement for this?

Thanks

Anton
Top achievements
Rank 1
 answered on 12 Jul 2017
3 answers
2.1K+ views

In our grid we have some columns locked. There is an edit option to edit data in columns. The editable columns have a multi-select box and when we select more than three options the hegith of the locked and unlocked columns starts mismatching.

If we remove the locked column property than there is no issue.

We are using kendo version "2015.3.1111".

Thanks

Stefan
Telerik team
 answered on 12 Jul 2017
5 answers
735 views

I want to listen Kendo ui Gantt Chart's expand event.

Main goal is loading summary rows first and when user clicked expand icon loading detail rows (Tasks).

Is there a way to find out which row is expanded and get its data (id maybe), or a lazy loading feature will be awesome?

Thanks.

Dimitar
Telerik team
 answered on 12 Jul 2017
8 answers
868 views
I'm working on Asp.net MVC3 application with KendoUI. Database is MySql.
Its a sample movie application.
This is my model:-
        public int Movie_ID { get; set; }
        public string Movie_Name { get; set; }
        public Nullable<System.DateTime> Release_Date { get; set; }
        public string Movie_Type { get; set; }
        public string Movie_Cert { get; set; }
        public string Movie_Poster { get; set; }
        public string Movie_Budget { get; set; }
        public bool Awards { get; set; }

This is the view:-
<h2>Add a Movie:-</h2>
 
 <br/>
 @using (Html.BeginForm("Create", "New_Movie",FormMethod.Post, new { id = "uploadForm", enctype = "multipart/form-data" }))
 {
    @Html.ValidationSummary(true)
    <fieldset>
 <label class="k-label">Movie Name:</label>
 <div class="k-textbox">
 @Html.TextBoxFor(m => m.Movie_Name)
 </div>

  <br/>
  <br/>
  <label class="k-label">Release Date:</label>
  @(Html.Kendo().DatePickerFor(m => m.Release_Date)

        .Name("Release_Date")

   )

  <br/>
  <br/>

 <label class="k-label">Movie Type:</label>

    @(Html.Kendo().ComboBoxFor(m => m.Movie_Type)
    .Name("Mov_Type")
    .Placeholder("Select Type...")
    .BindTo(new string[]
                {"Action",
                "Comedy",
                "Documentary",
               "Suspense Thriller"}
            )
)
<label class="k-label">Movie Budget:</label>
      @(Html.Kendo().DropDownListFor(m => m.Movie_Budget)
                    .Name("Budget")
                    .BindTo(new string[] {
                              "1 to 25 crores",
                              "26 to 50 crores",
                              "51 to 75 crores",
                              "above 76"
                          })
  )
<input type="submit" name="submit" value="Submit" />      
       
       </fieldset>
 }

Now when i submit this page to the controller create()

  [HttpPost]
        public ActionResult Create( movie_master movie_record)
        {
                 using (var insert = new moviesEntities())
                {
                    insert.movie_master.Add(movie_record);
                    insert.SaveChanges();
                }
                return RedirectToAction("Index");
        }
 the model object movie_record contains Movie_Type=null and Movie_Budget=null.
 The Kendo datapicker returns the date value selected.
What am i doing wrong ? Please help me.
Dimitar
Telerik team
 answered on 12 Jul 2017
5 answers
302 views

Hi

Is it possible to use templates in a databound panelbar?

Pseudo:

<ul kendo-panel-bar k-data-source="files.panelData.data()" k-rebind="files.panelData.data()">
    <span k-template>
        <i class="fa fa-folder-open" ng-hide="{{!dataItem.expanded}}"></i>
        <i class="fa fa-folder" ng-hide="{{dataItem.expanded}}"></i>
        {{dataItem.text}} <span ng-show="dataItem.count!= 0">({{dataItem.count}})</span>
    </span>
</ul>

(gives --> k-template without a matching parent widget found. It can be one of the following: ?^^kendoTreeMap, ?^^kendoMobileListView, ?^^kendoMobileScrollView, ?^^kendoListView, ?^^kendoTreeView )

 

 

 

 

Nencho
Telerik team
 answered on 12 Jul 2017
3 answers
426 views

<script type="text/javascript">
function ImgTemplate(data) {
var html = "<img src='" + data + "' />";
return html;
}
</script>
@(Html.Kendo().Grid(Model)
.Name("ObjGrid")
.Mobile(MobileMode.Tablet)
.HtmlAttributes(new { style = "height: 300px;" })
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
if (Model != null)
{
foreach (System.Data.DataColumn column in Model.Columns)
{
model.Field(column.ColumnName, column.DataType);
}
}
})
.ServerOperation(false)
)
.Columns(columns =>
{
for (int i = 0; i < ViewBag.ListHeader.GetLength(0); i++)
{
if(ViewBag.ListHeader[i, 0] != null){
if (ViewBag.ListHeader[i, 1] == "imagePath")
{
columns.Bound(ViewBag.ListHeader[i, 0]).Title("Typ").ClientTemplate("#= ImgTemplate(imagePath) #").Width(12);
}

               
else
{
columns.Bound(ViewBag.ListHeader[i, 0]).Title(ViewBag.ListHeader[i, 1]).Width(150);
}
}
}
})
.Selectable(selectable => selectable
.Mode(GridSelectionMode.Single))
.ToClientTemplate()
)

 

This code Displays Image properly when run on Desktop Browsers. But the view for tablet with same code does not diosplay Image but Displays the path. This partial view gets embeded in a tab using LoadContentFrom

 

What can cause this

 

Thanks

Anamika

Preslav
Telerik team
 answered on 12 Jul 2017
11 answers
2.9K+ views
Hi
I created a grid using this code
$("#grid").kendoGrid({
          dataSource: {
              transport: {
                   read: { url: "@Url.Action("GridDataSource")", contentType:"application/json; charset=utf-8" }
          }
          },
          columns:[{field:"Name",title:"Name"}]
      });
as You can see data for grid are downloaded from server using function GridDataSource. This function return JSon object.
public JsonResult GridDataSource()
       {
           return Json(ProductsList, JsonRequestBehavior.AllowGet);
       }

For time to time I have to refresh grid however it seems that refresh function doesnt affect grid. So far I've tried
$("#grid").data("kendoGrid").dataSource.read();
 $("#grid").data("kendoGrid").refresh();
$("#grid").data("kendoGrid").dataSource.sync();

Unfortunatelly non of methods presented above is working. Is there any way to force grid to refresh ?
Stefan
Telerik team
 answered on 12 Jul 2017
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
ScrollView
Switch
TextArea
BulletChart
Licensing
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?