Telerik Forums
Kendo UI for jQuery Forum
4 answers
8.1K+ views
I have a grid that contains several columns.  In the code below I have removed a few just to make it easier to read.  The standard display of this grid has the rows alternating between a light blue and white row color.  I need to be able to change the color of a row based on a specific value in that row.  For example, if the "ReportClassDescription" column is equal to "Express" then the background color for that entire row should be red. 
If it is easier I could also just changed the color of that particular cell.  So again, if "ReportClassDescription" is "Express" then that cell could just be red. 
How can I accomplish either of these scenarios?

01.@(Html.Kendo().Grid(Model)
02.      .Name("ResultList")
03.      .HtmlAttributes(new { style = "font-size:.8em; height:auto;" })
04.      .Columns(columns =>
05.        {
06.                     
07.          columns.Bound(p => p.ReportID).Width("100px")
08.            .Filterable(filter => filter.Operators(o => o
09.              .ForString(str => str
10.                .Clear()
11.                .Contains("Contains")
12.                .DoesNotContain("Does Not Contain")
13.                .StartsWith("Starts With")
14.                .EndsWith("Ends With")
15.                .IsEqualTo("Equal To")
16.                .IsNotEqualTo("Not Equal To")
17.          )));
18. 
19.          columns.Bound(p => p.ClientReportName).Width("100px")
20.            .Filterable(filter => filter.Operators(o => o
21.              .ForString(str => str
22.                .Clear()
23.                .Contains("Contains")
24.                .DoesNotContain("Does Not Contain")
25.                .StartsWith("Starts With")
26.                .EndsWith("Ends With")
27.                .IsEqualTo("Equal To")
28.                .IsNotEqualTo("Not Equal To")
29.          )));
30. 
31.          columns.Bound(p => p.ReportClassDescription).Width("100px")
32.            .Filterable(filter => filter.Operators(o => o
33.              .ForString(str => str
34.                .Clear()
35.                .Contains("Contains")
36.                .DoesNotContain("Does Not Contain")
37.                .StartsWith("Starts With")
38.                .EndsWith("Ends With")
39.                .IsEqualTo("Equal To")
40.                .IsNotEqualTo("Not Equal To")
41.          )));
42. 
43.          columns.Bound(p => p.ReportTypeDescription).Width("100px")
44.            .Filterable(filter => filter.Operators(o => o
45.              .ForString(str => str
46.                .Clear()
47.                .Contains("Contains")
48.                .DoesNotContain("Does Not Contain")
49.                .StartsWith("Starts With")
50.                .EndsWith("Ends With")
51.                .IsEqualTo("Equal To")
52.                .IsNotEqualTo("Not Equal To")
53.          )));                     
54.        })
55.      .Pageable(page => page.Refresh(true).Input(true))
56.      .Scrollable()
57.      .Groupable()
58.      .Sortable(sort => sort.SortMode(GridSortMode.MultipleColumn))
59.      .Filterable()
60.      .DataSource(dataSource => dataSource
61.        .Ajax()
62.        .Read(read => read.Action("QueueSearch_Read", "Queue"))
63.        .PageSize(100)
64.        .ServerOperation(true)
65.        )
66.      .Resizable(resize => resize.Columns(true))
67.      .Reorderable(reorder => reorder.Columns(true))
68.      )
Dimo
Telerik team
 updated answer on 03 Apr 2024
0 answers
9 views

 

 

https://dojo.telerik.com/ahoKociN/2

 

 

1) normal select box : (in the iPAD)

<select id="size0" >
    <option>S - 6 3/4"</option>
    <option>M - 7 1/4"</option>
    <option>L - 7 1/8"</option>
    <option>XL - 7 5/8"</option>
</select>

 

2) kendo ui select box :

 

  Question : 

How can I input like 1) on mobile while using kendo jquery?

 

n/a
Top achievements
Rank 1
Iron
Iron
 asked on 30 Mar 2024
1 answer
10 views

I have a kendoGrid with filterable columns using jQuery. Let's say I have a column named Title. When I click on filter icon besides the column name a dropdown occurs that has "Filter" ption and on hovering over "Filter" option a new dropdown containing all the values from the columns is opened. I want this newly opened dropdown to the left always. How can I do so ?

 

$('#grid').data("kendoGrid");
            if (grid != undefined || grid != null)
                $('#grid').empty();

            var grid = $("#grid").kendoGrid({
                dataSource: DataSource,
                    schema: {
                        data: function (response) {
                            return response;
                        }
                    },
                },
                sortable: true,
                filterable: true,
                columnMenu: true,
                reorderable: true,
                resizable: true,
                multi: true,
                selectable: true,
                dataBinding: function () {
                    record = (this.dataSource.page() - 1) * this.dataSource.pageSize();
                },
                noRecords: true,
                messages: {
                    noRecords: "No records found"
                },
                pageable: {
                    pageSize: 5,
                    input: true
                },
                columns: [
                    {
                        title: "Sr. No.",
                        template: "#= ++record #",
                        width: 70
                    },
                    {
                        field: "Title", title: 'Title',
                        width: "25%",
                        attributes: {
                            style: 'white-space: nowrap;'
                        },
                        filterable: {
                            multi: true,
                            extra: false,
                            search: true,
                            operators: {
                                string: {
                                    eq: "Is equal to",
                                    neq: "Is not equal to",
                                    contains: "Contains"
                                }
                            }
                        }
                    },

                    {
                        command: [
                            { name: "edit1", text: "", iconClass: "k-icon k-i-eye", className: "ob-view" }],
                        title: "Action", lock: true, width: 80, headerAttributes: {
                            style: "text-align: center;"
                        }
                    }
                ]
            });

}

 

 

Neli
Telerik team
 answered on 29 Mar 2024
0 answers
11 views

Hi there! I'm not a developer but working with one to try and get a fix for my web application. This specific issue is not happening on any desktop computer but appears to be happening on my MacBook Pro when using Safari (not Chrome) and my 5th Gen iPad in both Safari and Chrome. When access a specific section of the program it begins to 'tab' through every field on that page endlessly. When I check the network log it states  'PerformValidationActions' appears to be in a loop cycling through 'text1_enter' 'text1_leave' 'text2_enter' 'text2_leave' 'text3_enter' 'text3_leave'  etc.  It EVENTUALLY ends but then when you try to log out you get the error Object reference not set to an instance of an object.

 

Any help would be GREATLY appreciated!

Stephen
Top achievements
Rank 1
 asked on 28 Mar 2024
1 answer
14 views
Is there any way to make a FileManager widget that will allow for the uploading of both files and folders? I see that the 'directory' option of the Upload prevents the selection of files - https://docs.telerik.com/kendo-ui/api/javascript/ui/upload/configuration/directory - but I can't understand the logic here. Why would this be the case? In any event, if this must be the case, then is there a way to replace the upload widget inside of the FileManager widget on the fly, via a custom toolbar option? Even that would suffice. Or possibly have two upload widgets associated with the FileManager? One for files, and one for directories? If I have to, I'll implement a complete destruction and rebuild of the FileManager in order to facilitate this, but that's obviously far from ideal, especially if users are wanting to upload several different things in a single sitting.
Martin
Telerik team
 answered on 27 Mar 2024
1 answer
14 views

Hi all,

I'm currently having a problem to try to change the focus one cell up/down using the key arrows when the focus is on a DatePicker component and it is located inside a Grid. The current behavior is that the focus is on the DatePicker and the up/down arrows change the segment value of the date. (It only changes the day, month or years).

Can you please give an idea how to override this kendo behavior?

Additionally, can you share with me more information about the keyboard navigation inside the DatePickers components?

I read this information DatePicker Component - Keyboard Navigation | Kendo UI for Angular (telerik.com) but it doesn't mention anything about the behavior pressing just the up/down arrows without opening the calendar component. 

 

Thank you in advance. 

Martin
Telerik team
 answered on 27 Mar 2024
1 answer
11 views

I have a DropDownTree on my site. When the text of the item is too long to fit I am seeing a horizontal scrollbar and the gray colored background does not expand. I don't want auto width as that makes the container grow larger than the input control is. How can I instead have it wrap? 

Neli
Telerik team
 answered on 27 Mar 2024
1 answer
23 views

I have a kendo dropdown tree with a selected value that was there on initialization. When the user clicks on the dropdown for the first time, I want the list to auto expand the selected node so the user can see it the child item. How do I do this? 

Similarly, I would like the user to be able to click on a parent node and, instead of selecting the parent node, since that isn't allowed in my case, it should just expand so they can see the children. 

Neli
Telerik team
 answered on 27 Mar 2024
1 answer
10 views

Hi support team.

 

how to get the row data?  the following is currently not working..

 


<div id="grid"></div>
<script>
  $("#grid").kendoGrid({
    columns: [
      { field: "id" },
      { field: "name" },
      { command: [
        {
          // for click to work when there is template, add class "k-grid-[command.name]" to some element, otherwise the click handler will not be triggered
          name: "settings",
          template: "#= data.id # text in the command column <a class='k-button k-grid-settings'><span class='k-icon k-i-settings'></span>Settings</a>",
          click(e){
            kendo.alert("how to")
          }
        }
      ]
      }
    ],
    dataSource: [{ id: 1, name: "Jane Doe", bib: 1 }, { id: 2, name: "Jane Doe 2", bib: 1 }]
  });
</script>
</body>
</html>

Neli
Telerik team
 answered on 27 Mar 2024
1 answer
8 views

Hi support team,

 

when setting the content using the setOptions method we only see a white window. Why is not loading?

 


 var window = $('#kendo-window')
            
         	if(!window.data("kendoWindow")) {
            window.kendoWindow({})
          }
          
         window.data("kendoWindow").setOptions({
                 title: title,
           			 content: "../content/web/window/ajax/ajaxContent1.html",
           			 modal: true,
                 actions: ["maximize","close"],
                 position: {
                     top: "10",
                     left: "10"
                 },
                 width: width,
                 minHeight: 900,
               	 scrollable: true,
                 animation: {
                     open: {
                         effects: "fade:in",
                         duration: 500
                     },
                     close: {
                         effects: "fade:out",
                         duration: 500
                     }
                 }
             })
         
         window.data("kendoWindow").center().open()

Stefan
Top achievements
Rank 1
Iron
 updated answer on 26 Mar 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?