color a cell of a KendoUI grid via MVC controller - asp.net-mvc

In a ASP.Net MVC application I wish to show in a kendo grid column a cell () colored via a color I receive in the form #FFAABB from the controller... how can I do that?
can I just apply the color via style received in the viewbag or is there a better way?
Thanks in advance

First of all, is the color is going to be only one that is being passed from the Controller and if so then you can use Viewbag or a Static variable.
But if the colors are going to differ with each rows of the Grid then its better to pass them along the Model and use a template to set the color, please see a demo I created for the same: Column Coloring from Model

Related

Recommended way to do the search and populating the grid in ASP.NET Core MVC 6

I am creating a project where I need to create a view with search textboxes and a dropdown which would be populated from the server. Same view also have a grid which would be populated based on the search criteria enter/selected by user.
I want to know what would be the design of the page in terms of showing both on same page. Should I create a partial view for the grid or Search panel or add both in the single view?
Note that dropdown list would need to be populated from the ViewModel. So what is the common practice in the situation. I am new to this I have done few pages but with lot of code, session and ViewBags and I think I am not following recommended practice.
Actually, the design for your web application is according to your requirement.
For example, if you want grid to work with other datasource or view, you could build it as a component, then if you want to use it, you could directly use this component to avoid write the same codes for multiple time.
If you want to use same grid to show in some other page, you could build it a partial view, then you could directly call this view to show something.

display multiple checkbox in a single row of kendo UI Grid

I am working on Kendo UI. How to display multiple checkbox in a single row of Kendo UI Grid ?
each Kendo component accepts a template which is in kendo's own format. You could setup that grid cell any way you want with as many checkboxes as you want.
have a look here for an example on how to do it :
http://www.telerik.com/forums/checkboxes-in-kendo-grid
http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/Selection/select-multiple-rows-with-checkboxes
You might want to use telerik's forums for this kind of questions, they are very good at answering and you get replies from the people who actually created it.

Manipulate Kendo Grid Column Design

How to displayed records in grouping,I mean hide the column data if its in same group.Please refer below screen shot.
Is it possible in Kendo Grid(with asp.net MVC)?
Thanks in advance.
You should consider using grid hierarchy or aggregates, whichever suits you best.
Here's a working demo for hierarchy and a working demo for aggregates.

how to add color flag dynamically to the dropdownlist in kendoUI

I am using colors drop down in list view.In this dropdown,From the datasource,I am able to display colors from my database.
what I want is that,In the drop down,For each value i want to display name of color and squarish box filled with this color.
I have implemented the below for displaying drop down,
<select STYLE="width:90px;height:auto" id="Flag" data-bind="value:prj_flag" data-text-field="usr_color" data-value-field="usr_id" data-source="FlagdatSource" data-role="dropdownlist"></select>
Do you know how to define it NOT using KendoUI? I mean, if you know how to do it using HTML select then you should be able implementing the same in KendoUI using template in DropDownList (check KendoUI DropDownList). Doing this, you reduce your problem to a CSS question instead of a KendoUI.
You should create your server to return not only the text of the for these colors but also the color codes. Then all you need to to is to create a template.
Here it is in action, the only difference is that it is using local data (not coming from a server).

ASP.Net MVC Webgrid custom pager

I just started using webgrid helper ,seem to be good, but having issue in creating pager. I want to create a pager on top and bottom of grid.
pager format is |dropdown| |previous button| |text|1-10 of 230 rows|text| |Nextbutton|
if i change dropdown number of rows shud change per selection . any thoughts how it can be implemented.
AFAIK this is not supported at the moment by the WebGrid helper. The pager only supports FirstLast, NextPrevious, Numeric and any combination of those. A dropdown is not supported.

Resources