<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Products &#8211; Sibeesh Passion</title>
	<atom:link href="https://sibeeshpassion.com/category/products/feed/" rel="self" type="application/rss+xml" />
	<link>https://sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Wed, 02 Jun 2021 15:15:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>Products &#8211; Sibeesh Passion</title>
	<link>https://sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Working With IgniteUI Chart igDataChart Control</title>
		<link>https://sibeeshpassion.com/working-with-igniteui-chart-igdatachart-control/</link>
					<comments>https://sibeeshpassion.com/working-with-igniteui-chart-igdatachart-control/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 14 Jul 2016 16:10:01 +0000</pubDate>
				<category><![CDATA[Ignite UI]]></category>
		<category><![CDATA[igDataChart]]></category>
		<category><![CDATA[igDataChart In MVC]]></category>
		<category><![CDATA[MVC]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11824</guid>

					<description><![CDATA[In this post we will see how we can use an IgniteUI chart control in our MVC application. If you are new IgniteUI controls I strongly recommend you to read my previous post related to IgniteUI grid here Working With IgniteUI Grid Control. Here we are going to use the chart control available in the kit. We will create an MVC application in Visual Studio. I hope you will like this. Download source code IgniteUI Chart igDataChart Control Background I hope you have already gone though my previous article about IgniteUI grid control. You can consider that as an introduction [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can use an <a href="http://sibeeshpassion.com/category/products/" target="_blank">IgniteUI</a> chart control in our <a href="http://sibeeshpassion.com/category/mvc" target="_blank">MVC</a> application. If you are new IgniteUI controls I strongly recommend you to read my previous post related to IgniteUI grid here <a href="http://sibeeshpassion.com/working-with-igniteui-grid-control/" target="_blank">Working With IgniteUI Grid Control</a>. Here we are going to use the chart control available in the kit. We will create an MVC application in <a href="http://sibeeshpassion.com/category/visual-studio/" target="_blank">Visual Studio</a>. I hope you will like this. </p>
<p><strong>Download source code</strong></p>
<li><a href="https://code.msdn.microsoft.com/Working-With-IgniteUI-a217dad6" target="_blank">IgniteUI Chart igDataChart Control</a></li>
<p><strong>Background</strong></p>
<p>I hope you have already gone though my previous article about <a href="http://sibeeshpassion.com/working-with-igniteui-grid-control/" target="_blank">IgniteUI grid control</a>. You can consider that as an introduction to the control kit. Now as I mentioned, we will try to create a chart using the chart control. Is that fine? </p>
<p><strong>Prerequisites</strong></p>
<p>As I said in the introduction part, we are going to create an IgniteUI grid in MVC application, so you must have a visual studio installed in your machine. </p>
<li>Visual Studio</li>
<li>SQL</li>
<li>IgniteUI control</li>
<p><strong>Table of Contents</strong></p>
<li>Download and install IgniteUI</li>
<li>Set up database</li>
<li>Creating models and entity</li>
<li>Configure MVC application</li>
<li>Creating IgniteUI Chart</li>
<p><strong>Download and install IgniteUI</strong></p>
<p>Please see my <a href="http://sibeeshpassion.com/working-with-igniteui-grid-control/" target="_blank">previous post</a> to see the steps to install the Ignite UI in your machine. </p>
<p><strong>Set up database</strong></p>
<p>[sql]<br />
USE [master]<br />
GO</p>
<p>/****** Object:  Database [TrialsDB]    Script Date: 07/14/2016 10:56:41 AM ******/<br />
CREATE DATABASE [TrialsDB]<br />
 CONTAINMENT = NONE<br />
 ON  PRIMARY<br />
( NAME = N&#8217;TrialsDB&#8217;, FILENAME = N&#8217;C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\TrialsDB.mdf&#8217; , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )<br />
 LOG ON<br />
( NAME = N&#8217;TrialsDB_log&#8217;, FILENAME = N&#8217;C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\TrialsDB_log.ldf&#8217; , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET COMPATIBILITY_LEVEL = 110<br />
GO</p>
<p>IF (1 = FULLTEXTSERVICEPROPERTY(&#8216;IsFullTextInstalled&#8217;))<br />
begin<br />
EXEC [TrialsDB].[dbo].[sp_fulltext_database] @action = &#8216;enable&#8217;<br />
end<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ANSI_NULL_DEFAULT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ANSI_NULLS OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ANSI_PADDING OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ANSI_WARNINGS OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ARITHABORT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_CLOSE OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_CREATE_STATISTICS ON<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_SHRINK OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_UPDATE_STATISTICS ON<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET CURSOR_CLOSE_ON_COMMIT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET CURSOR_DEFAULT  GLOBAL<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET CONCAT_NULL_YIELDS_NULL OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET NUMERIC_ROUNDABORT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET QUOTED_IDENTIFIER OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET RECURSIVE_TRIGGERS OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET  DISABLE_BROKER<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_UPDATE_STATISTICS_ASYNC OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET DATE_CORRELATION_OPTIMIZATION OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET TRUSTWORTHY OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ALLOW_SNAPSHOT_ISOLATION OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET PARAMETERIZATION SIMPLE<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET READ_COMMITTED_SNAPSHOT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET HONOR_BROKER_PRIORITY OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET RECOVERY FULL<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET  MULTI_USER<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET PAGE_VERIFY CHECKSUM<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET DB_CHAINING OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF )<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET TARGET_RECOVERY_TIME = 0 SECONDS<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET  READ_WRITE<br />
GO<br />
[/sql]</p>
<p><strong>Create table with data</strong></p>
<p>[sql]<br />
USE [TrialsDB]<br />
GO<br />
/****** Object:  Table [dbo].[Product]    Script Date: 5/12/2016 10:54:48 AM ******/<br />
SET ANSI_NULLS ON<br />
GO<br />
SET QUOTED_IDENTIFIER ON<br />
GO<br />
CREATE TABLE [dbo].[Product](<br />
	[ProductID] [int] NOT NULL,<br />
	[Name] [nvarchar](max) NOT NULL,<br />
	[ProductNumber] [nvarchar](25) NOT NULL,<br />
	[MakeFlag] [bit] NOT NULL,<br />
	[FinishedGoodsFlag] [bit] NOT NULL,<br />
	[Color] [nvarchar](15) NULL,<br />
	[SafetyStockLevel] [smallint] NOT NULL,<br />
	[ReorderPoint] [smallint] NOT NULL,<br />
	[StandardCost] [money] NOT NULL,<br />
	[ListPrice] [money] NOT NULL,<br />
	[Size] [nvarchar](5) NULL,<br />
	[SizeUnitMeasureCode] [nchar](3) NULL,<br />
	[WeightUnitMeasureCode] [nchar](3) NULL,<br />
	[Weight] [decimal](8, 2) NULL,<br />
	[DaysToManufacture] [int] NOT NULL,<br />
	[ProductLine] [nchar](2) NULL,<br />
	[Class] [nchar](2) NULL,<br />
	[Style] [nchar](2) NULL,<br />
	[ProductSubcategoryID] [int] NULL,<br />
	[ProductModelID] [int] NULL,<br />
	[SellStartDate] [datetime] NOT NULL,<br />
	[SellEndDate] [datetime] NULL,<br />
	[DiscontinuedDate] [datetime] NULL,<br />
	[rowguid] [uniqueidentifier] ROWGUIDCOL  NOT NULL,<br />
	[ModifiedDate] [datetime] NOT NULL<br />
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]<br />
GO<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (1, N&#8217;Adjustable Race&#8217;, N&#8217;AR-5381&#8242;, 0, 0, NULL, 1000, 750, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;694215b7-08f7-4c0d-acb1-d734ba44c0c8&#8242;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (2, N&#8217;Bearing Ball&#8217;, N&#8217;BA-8327&#8242;, 0, 0, NULL, 1000, 750, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;58ae3c20-4f3a-4749-a7d4-d568806cc537&#8242;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (3, N&#8217;BB Ball Bearing&#8217;, N&#8217;BE-2349&#8242;, 1, 0, NULL, 800, 600, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;9c21aed2-5bfa-4f18-bcb8-f11638dc2e4e&#8217;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (4, N&#8217;Headset Ball Bearings&#8217;, N&#8217;BE-2908&#8242;, 0, 0, NULL, 800, 600, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;ecfed6cb-51ff-49b5-b06c-7d8ac834db8b&#8217;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (316, N&#8217;Blade&#8217;, N&#8217;BL-2036&#8242;, 1, 0, NULL, 800, 600, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;e73e9750-603b-4131-89f5-3dd15ed5ff80&#8242;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (317, N&#8217;LL Crankarm&#8217;, N&#8217;CA-5965&#8242;, 0, 0, N&#8217;Black&#8217;, 500, 375, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, NULL, N&#8217;L &#8216;, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;3c9d10b7-a6b2-4774-9963-c19dcee72fea&#8217;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (318, N&#8217;ML Crankarm&#8217;, N&#8217;CA-6738&#8242;, 0, 0, N&#8217;Black&#8217;, 500, 375, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, NULL, N&#8217;M &#8216;, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;eabb9a92-fa07-4eab-8955-f0517b4a4ca7&#8217;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
[/sql]</p>
<p><strong>Creating models and entity</strong></p>
<p>If you don&#8217;t know how to create an entity in your solution, please read that <a href="http://sibeeshpassion.com/web-api-with-angular-js/" target="_blank">here</a>. I have mentioned the steps to be followed in that article. Once you have created the entity, you are good to go.</p>
<p>Here I am assuming that you have created an entity and got a model class as preceding.</p>
<p>[csharp]<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
// &lt;auto-generated&gt;<br />
//     This code was generated from a template.<br />
//<br />
//     Manual changes to this file may cause unexpected behavior in your application.<br />
//     Manual changes to this file will be overwritten if the code is regenerated.<br />
// &lt;/auto-generated&gt;<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>namespace IgniteUI.Models<br />
{<br />
    using System;<br />
    using System.Collections.Generic;</p>
<p>    public partial class Product<br />
    {<br />
        public int ProductID { get; set; }<br />
        public string Name { get; set; }<br />
        public string ProductNumber { get; set; }<br />
        public bool MakeFlag { get; set; }<br />
        public bool FinishedGoodsFlag { get; set; }<br />
        public string Color { get; set; }<br />
        public short SafetyStockLevel { get; set; }<br />
        public short ReorderPoint { get; set; }<br />
        public decimal StandardCost { get; set; }<br />
        public decimal ListPrice { get; set; }<br />
        public string Size { get; set; }<br />
        public string SizeUnitMeasureCode { get; set; }<br />
        public string WeightUnitMeasureCode { get; set; }<br />
        public Nullable&lt;decimal&gt; Weight { get; set; }<br />
        public int DaysToManufacture { get; set; }<br />
        public string ProductLine { get; set; }<br />
        public string Class { get; set; }<br />
        public string Style { get; set; }<br />
        public Nullable&lt;int&gt; ProductSubcategoryID { get; set; }<br />
        public Nullable&lt;int&gt; ProductModelID { get; set; }<br />
        public System.DateTime SellStartDate { get; set; }<br />
        public Nullable&lt;System.DateTime&gt; SellEndDate { get; set; }<br />
        public Nullable&lt;System.DateTime&gt; DiscontinuedDate { get; set; }<br />
        public System.Guid rowguid { get; set; }<br />
        public System.DateTime ModifiedDate { get; set; }<br />
    }<br />
}<br />
[/csharp]</p>
<p><strong>Configure MVC application</strong></p>
<p>As you have finished your installing, we can create a MVC application now. Open your <a href="http://sibeeshpassion.com/category/visual-studio/" target="_blank">Visual Studio</a> and click on new project. Name your project, here I am going to name my project as IgniteUIGrid. Select MVC template and click OK.</p>
<p>Click on the reference and add DLL reference of IgiteUI from C:\Program Files (x86)\Infragistics\2016.1\Ignite UI\MVC\MVC6\Bin\dnx451 or from which ever the folder you installed IgniteUI.</p>
<p><strong>Create controller and actions</strong></p>
<p>Now create a controller as follows.</p>
<p>[csharp]<br />
using System.Web.Mvc;</p>
<p>namespace IgniteUI.Controllers<br />
{<br />
    public class ChartController : Controller<br />
    {<br />
        private IgniteUI.Models.TrialsDBEntities db = new IgniteUI.Models.TrialsDBEntities();</p>
<p>        public ActionResult Index()<br />
        {<br />
            return View();<br />
        }<br />
    }<br />
}<br />
[/csharp]</p>
<p>Now we will create a JsonResult action for fetching the products from database.</p>
<p>[csharp]<br />
[HttpGet]<br />
        public JsonResult Getproducts()<br />
        {<br />
            var model = db.Products.AsQueryable().GroupBy(g =&gt; g.Name, g =&gt; g.ReorderPoint, (key, g) =&gt; new<br />
            {<br />
                Name = key,<br />
                ReorderPoint = g.Take(1)<br />
            }).Take(10);<br />
            return Json(model, JsonRequestBehavior.AllowGet);<br />
        }<br />
[/csharp]</p>
<p>Here I am just grouping the items together and taking the first value for Y axis. And as you know we will we setting &#8216;Name&#8217; as X axis value in chart. </p>
<p>Now shall we create a view?</p>
<p><strong>Create view</strong></p>
<p>[html]<br />
@using Infragistics.Web.Mvc;<br />
@using IgniteUI.Models;<br />
@model IQueryable&lt;IgniteUI.Models.Product&gt;<br />
[/html]</p>
<p><strong>Creating IgniteUI Chart</strong></p>
<p>So our view is ready, now we will create an element where we can render our chart.</p>
<p>[html]<br />
&lt;div style=&quot;width: 100%;&quot;&gt;<br />
    &lt;div id=&quot;chart&quot;&gt;&lt;/div&gt;<br />
&lt;/div&gt;<br />
[/html]</p>
<p>What is next? Yes you are right. We need an ajax call. </p>
<p>[js]<br />
&lt;script&gt;<br />
    $(function () {<br />
        $.ajax({<br />
            type: &#8216;GET&#8217;,<br />
            url: &#8216;http://localhost:39044/chart/Getproducts&#8217;,<br />
            beforeSend: function () {<br />
            },<br />
            success: function (data) {<br />
                GenerateChart(data);<br />
            },<br />
            error: function (e) {<br />
                console.log(&#8216;Error occured: &#8216; + e.message);<br />
            }<br />
        });<br />
    });<br />
&lt;/script&gt;<br />
[/js]</p>
<p>Here <em>GenerateChart</em> is where we actually build our chart.</p>
<p>[js]<br />
 function GenerateChart(chartData) {<br />
        $(&quot;#chart&quot;).igDataChart({<br />
            width: &quot;100%&quot;,<br />
            height: &quot;500px&quot;,<br />
            title: &quot;Product vs Reorder Point&quot;,<br />
            subtitle: &quot;Final products and reorder Point&quot;,<br />
            dataSource: chartData,<br />
            axes: [<br />
                {<br />
                    name: &quot;NameAxis&quot;,<br />
                    type: &quot;categoryX&quot;,<br />
                    title: &quot;Product Name&quot;,<br />
                    label: &quot;Name&quot;<br />
                },<br />
                {<br />
                    name: &quot;YAxisReorderPoint&quot;,<br />
                    type: &quot;numericY&quot;,<br />
                    minimumValue: 0,<br />
                    title: &quot;Reorder Point&quot;,<br />
                }<br />
            ],<br />
            series: [<br />
                {<br />
                    name: &quot;NameReorderPoint&quot;,<br />
                    type: &quot;column&quot;,<br />
                    isHighlightingEnabled: true,<br />
                    isTransitionInEnabled: true,<br />
                    xAxis: &quot;NameAxis&quot;,<br />
                    yAxis: &quot;YAxisReorderPoint&quot;,<br />
                    valueMemberPath: &quot;ReorderPoint&quot;<br />
                }<br />
            ]<br />
        });<br />
    }<br />
[/js]</p>
<p>Go to your shared view folder, open _Layout.cshtml and add the following references to the view.</p>
<p>[html]<br />
 &lt;!&#8211; Ignite UI Required Combined CSS Files &#8211;&gt;<br />
    &lt;link href=&quot;http://cdn-na.infragistics.com/igniteui/2016.1/latest/css/themes/infragistics/infragistics.theme.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
    &lt;link href=&quot;http://cdn-na.infragistics.com/igniteui/2016.1/latest/css/structure/infragistics.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
    &lt;!&#8211;CSS file specific for chart styling &#8211;&gt;<br />
    &lt;link href=&quot;http://cdn-na.infragistics.com/igniteui/2016.1/latest/css/structure/modules/infragistics.ui.chart.css&quot; rel=&quot;stylesheet&quot; /&gt;</p>
<p>    &lt;script src=&quot;http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.8.3.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://code.jquery.com/jquery-1.9.1.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://code.jquery.com/ui/1.10.3/jquery-ui.min.js&quot;&gt;&lt;/script&gt;</p>
<p>    &lt;!&#8211; Ignite UI Required Combined JavaScript Files &#8211;&gt;<br />
    &lt;script src=&quot;http://cdn-na.infragistics.com/igniteui/2016.1/latest/js/infragistics.core.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://cdn-na.infragistics.com/igniteui/2016.1/latest/js/infragistics.lob.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://cdn-na.infragistics.com/igniteui/2016.1/latest/js/infragistics.dv.js&quot;&gt;&lt;/script&gt;<br />
[/html]</p>
<p>Now please run your application and go to the <em>http://localhost:39044/Chart</em>, there you can see a chart with the data you have given. </p>
<div id="attachment_11825" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/07/Ignite_UI_Chart_Control.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-11825" src="http://sibeeshpassion.com/wp-content/uploads/2016/07/Ignite_UI_Chart_Control-1024x446.png" alt="Ignite_UI_Chart_Control" width="634" height="276" class="size-large wp-image-11825" srcset="/wp-content/uploads/2016/07/Ignite_UI_Chart_Control-1024x446.png 1024w, /wp-content/uploads/2016/07/Ignite_UI_Chart_Control-300x131.png 300w, /wp-content/uploads/2016/07/Ignite_UI_Chart_Control-768x335.png 768w, /wp-content/uploads/2016/07/Ignite_UI_Chart_Control-400x174.png 400w, /wp-content/uploads/2016/07/Ignite_UI_Chart_Control.png 634w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11825" class="wp-caption-text">Ignite_UI_Chart_Control</p></div>
<p>Sounds good? I hope you have got some knowledge about the Ignite UI chart control. That&#8217;s all for today. See you soon with other Ignite UI controls.</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/working-with-igniteui-chart-igdatachart-control/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Working With IgniteUI Grid Control</title>
		<link>https://sibeeshpassion.com/working-with-igniteui-grid-control/</link>
					<comments>https://sibeeshpassion.com/working-with-igniteui-grid-control/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 10 Jul 2016 12:02:53 +0000</pubDate>
				<category><![CDATA[Ignite UI]]></category>
		<category><![CDATA[Column fixing in igGrid]]></category>
		<category><![CDATA[igGrid]]></category>
		<category><![CDATA[igGrid with MVC]]></category>
		<category><![CDATA[Ignite UI grid]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11795</guid>

					<description><![CDATA[In this post we will see how we can use an IgniteUI grid in our MVC project. IgniteUI is a product kit introduced by the company Infragistics. Here we are going to use the Grid controls available in the kit. We will create an MVC application in Visual Studio. I hope you will like this. Download source code Working With IgniteUI Grid Control In MVC Background As I am an MVP in C # Corner, I have got a chance to be a part of C# corner annual conference 2016, there we had been offered ultimate license of the IgniteUI [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can use an IgniteUI grid in our <a href="http://sibeeshpassion.com/category/mvc" target="_blank">MVC</a> project. IgniteUI is a <a href="http://sibeeshpassion.com/category/products/" target="_blank">product </a>kit introduced by the company Infragistics. Here we are going to use the Grid controls available in the kit. We will create an MVC application in <a href="http://sibeeshpassion.com/category/visual-studio/" target="_blank">Visual Studio</a>. I hope you will like this. </p>
<p><strong>Download source code</strong></p>
<li><a href="https://code.msdn.microsoft.com/Working-With-IgniteUI-Grid-b24bda3d" target="_blank">Working With IgniteUI Grid Control In MVC</a></li>
<p><strong>Background</strong></p>
<p>As I am an <a href="http://www.c-sharpcorner.com/members/sibeesh-venu" target="_blank">MVP in C # Corner</a>, I have got a chance to be a part of C# corner annual conference 2016, there we had been offered ultimate license of the IgniteUI product. I would like to thank Mr.Jason Beres and Mr.Dhananjay Kumar for this. </p>
<p>Now let us come to the point, if you don&#8217;t have any license with, no worries you can always give an evaluation try. If you wish to do so, please download the toolkit from <a href="http://www.infragistics.com/products/ultimate" target="_blank">here</a>.</p>
<p><strong>Prerequisites</strong></p>
<p>As I said in the introduction part, we are going to create an IgniteUI grid in MVC application, so you must have a visual studio installed in your machine. </p>
<li>Visual Studio</li>
<li>SQL</li>
<p><strong>Table of Contents</strong></p>
<li>Download and install IgniteUI</li>
<li>Configure MVC application</li>
<li>Set up database</li>
<li>Creating models and entity</li>
<li>Creating IgniteUI Grid</li>
<p><strong>Download and install IgniteUI</strong></p>
<p>Once you download the needed files from the download link provided above, you are good to go and install it in your machine. Extract the downloaded file. Now double click on the exe file named Infragistics_20161_Platform. Please apply your license key if you have such a one, or you can use it as a trial. I am going to apply the license key I got.</p>
<div id="attachment_11796" style="width: 1009px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/07/Apply-License-Key-e1468140531276.png"><img decoding="async" aria-describedby="caption-attachment-11796" src="http://sibeeshpassion.com/wp-content/uploads/2016/07/Apply-License-Key-e1468140531276.png" alt="Apply License Key" width="999" height="749" class="size-full wp-image-11796" srcset="/wp-content/uploads/2016/07/Apply-License-Key-e1468140531276.png 476w, /wp-content/uploads/2016/07/Apply-License-Key-e1468140531276-300x225.png 300w, /wp-content/uploads/2016/07/Apply-License-Key-e1468140531276-400x300.png 400w" sizes="(max-width: 999px) 100vw, 999px" /></a><p id="caption-attachment-11796" class="wp-caption-text">Apply License Key</p></div>
<p>Select the components you need.</p>
<div id="attachment_11797" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/07/Platform-Installer-e1468140790563.png"><img decoding="async" aria-describedby="caption-attachment-11797" src="http://sibeeshpassion.com/wp-content/uploads/2016/07/Platform-Installer-e1468140790563.png" alt="Platform Installer" width="650" height="488" class="size-full wp-image-11797" srcset="/wp-content/uploads/2016/07/Platform-Installer-e1468140790563.png 476w, /wp-content/uploads/2016/07/Platform-Installer-e1468140790563-300x225.png 300w, /wp-content/uploads/2016/07/Platform-Installer-e1468140790563-400x300.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11797" class="wp-caption-text">Platform Installer</p></div>
<p>Now the installing will get started. </p>
<div id="attachment_11798" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/07/Installing-IgniteUI-e1468140972636.png"><img decoding="async" aria-describedby="caption-attachment-11798" src="http://sibeeshpassion.com/wp-content/uploads/2016/07/Installing-IgniteUI-e1468140972636.png" alt="Installing IgniteUI" width="650" height="487" class="size-full wp-image-11798" srcset="/wp-content/uploads/2016/07/Installing-IgniteUI-e1468140972636.png 476w, /wp-content/uploads/2016/07/Installing-IgniteUI-e1468140972636-300x225.png 300w, /wp-content/uploads/2016/07/Installing-IgniteUI-e1468140972636-400x300.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11798" class="wp-caption-text">Installing IgniteUI</p></div>
<p>Once the installing is finished, you will see a pop up as preceding. And you will be given a chance to register your product there and be a part of the forum and community.</p>
<div id="attachment_11799" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/07/Install-Finished-e1468141510355.png"><img decoding="async" aria-describedby="caption-attachment-11799" src="http://sibeeshpassion.com/wp-content/uploads/2016/07/Install-Finished-e1468141510355.png" alt="Install Finished" width="650" height="488" class="size-full wp-image-11799" srcset="/wp-content/uploads/2016/07/Install-Finished-e1468141510355.png 476w, /wp-content/uploads/2016/07/Install-Finished-e1468141510355-300x225.png 300w, /wp-content/uploads/2016/07/Install-Finished-e1468141510355-400x300.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11799" class="wp-caption-text">Install Finished</p></div>
<p><strong>Configure MVC application</strong></p>
<p>As you have finished your installing, we can create a MVC application now. Open your <a href="http://sibeeshpassion.com/category/visual-studio/" target="_blank">Visual Studio</a> and click on new project. Name your project, here I am going to name my project as IgniteUIGrid. Select MVC template and click OK.</p>
<p>Click on the reference and add DLL reference of IgiteUI from C:\Program Files (x86)\Infragistics\2016.1\Ignite UI\MVC\MVC6\Bin\dnx451 or from which ever the folder you installed IgniteUI.</p>
<div id="attachment_11800" style="width: 385px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/07/Add-IgniteUI-Reference.png"><img decoding="async" aria-describedby="caption-attachment-11800" src="http://sibeeshpassion.com/wp-content/uploads/2016/07/Add-IgniteUI-Reference.png" alt="Add IgniteUI Reference" width="375" height="239" class="size-full wp-image-11800" srcset="/wp-content/uploads/2016/07/Add-IgniteUI-Reference.png 375w, /wp-content/uploads/2016/07/Add-IgniteUI-Reference-300x191.png 300w" sizes="(max-width: 375px) 100vw, 375px" /></a><p id="caption-attachment-11800" class="wp-caption-text">Add IgniteUI Reference</p></div>
<p>So we have set our application ready for action.</p>
<p><strong>Set up database</strong></p>
<p>[sql]<br />
USE [master]<br />
GO</p>
<p>/****** Object:  Database [TrialsDB]    Script Date: 5/12/2016 10:56:41 AM ******/<br />
CREATE DATABASE [TrialsDB]<br />
 CONTAINMENT = NONE<br />
 ON  PRIMARY<br />
( NAME = N&#8217;TrialsDB&#8217;, FILENAME = N&#8217;C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\TrialsDB.mdf&#8217; , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )<br />
 LOG ON<br />
( NAME = N&#8217;TrialsDB_log&#8217;, FILENAME = N&#8217;C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\TrialsDB_log.ldf&#8217; , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET COMPATIBILITY_LEVEL = 110<br />
GO</p>
<p>IF (1 = FULLTEXTSERVICEPROPERTY(&#8216;IsFullTextInstalled&#8217;))<br />
begin<br />
EXEC [TrialsDB].[dbo].[sp_fulltext_database] @action = &#8216;enable&#8217;<br />
end<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ANSI_NULL_DEFAULT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ANSI_NULLS OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ANSI_PADDING OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ANSI_WARNINGS OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ARITHABORT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_CLOSE OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_CREATE_STATISTICS ON<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_SHRINK OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_UPDATE_STATISTICS ON<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET CURSOR_CLOSE_ON_COMMIT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET CURSOR_DEFAULT  GLOBAL<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET CONCAT_NULL_YIELDS_NULL OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET NUMERIC_ROUNDABORT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET QUOTED_IDENTIFIER OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET RECURSIVE_TRIGGERS OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET  DISABLE_BROKER<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET AUTO_UPDATE_STATISTICS_ASYNC OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET DATE_CORRELATION_OPTIMIZATION OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET TRUSTWORTHY OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET ALLOW_SNAPSHOT_ISOLATION OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET PARAMETERIZATION SIMPLE<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET READ_COMMITTED_SNAPSHOT OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET HONOR_BROKER_PRIORITY OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET RECOVERY FULL<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET  MULTI_USER<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET PAGE_VERIFY CHECKSUM<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET DB_CHAINING OFF<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF )<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET TARGET_RECOVERY_TIME = 0 SECONDS<br />
GO</p>
<p>ALTER DATABASE [TrialsDB] SET  READ_WRITE<br />
GO<br />
[/sql]</p>
<p><strong>Create table with data</strong></p>
<p>[sql]<br />
USE [TrialsDB]<br />
GO<br />
/****** Object:  Table [dbo].[Product]    Script Date: 5/12/2016 10:54:48 AM ******/<br />
SET ANSI_NULLS ON<br />
GO<br />
SET QUOTED_IDENTIFIER ON<br />
GO<br />
CREATE TABLE [dbo].[Product](<br />
	[ProductID] [int] NOT NULL,<br />
	[Name] [nvarchar](max) NOT NULL,<br />
	[ProductNumber] [nvarchar](25) NOT NULL,<br />
	[MakeFlag] [bit] NOT NULL,<br />
	[FinishedGoodsFlag] [bit] NOT NULL,<br />
	[Color] [nvarchar](15) NULL,<br />
	[SafetyStockLevel] [smallint] NOT NULL,<br />
	[ReorderPoint] [smallint] NOT NULL,<br />
	[StandardCost] [money] NOT NULL,<br />
	[ListPrice] [money] NOT NULL,<br />
	[Size] [nvarchar](5) NULL,<br />
	[SizeUnitMeasureCode] [nchar](3) NULL,<br />
	[WeightUnitMeasureCode] [nchar](3) NULL,<br />
	[Weight] [decimal](8, 2) NULL,<br />
	[DaysToManufacture] [int] NOT NULL,<br />
	[ProductLine] [nchar](2) NULL,<br />
	[Class] [nchar](2) NULL,<br />
	[Style] [nchar](2) NULL,<br />
	[ProductSubcategoryID] [int] NULL,<br />
	[ProductModelID] [int] NULL,<br />
	[SellStartDate] [datetime] NOT NULL,<br />
	[SellEndDate] [datetime] NULL,<br />
	[DiscontinuedDate] [datetime] NULL,<br />
	[rowguid] [uniqueidentifier] ROWGUIDCOL  NOT NULL,<br />
	[ModifiedDate] [datetime] NOT NULL<br />
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]<br />
GO<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (1, N&#8217;Adjustable Race&#8217;, N&#8217;AR-5381&#8242;, 0, 0, NULL, 1000, 750, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;694215b7-08f7-4c0d-acb1-d734ba44c0c8&#8242;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (2, N&#8217;Bearing Ball&#8217;, N&#8217;BA-8327&#8242;, 0, 0, NULL, 1000, 750, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;58ae3c20-4f3a-4749-a7d4-d568806cc537&#8242;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (3, N&#8217;BB Ball Bearing&#8217;, N&#8217;BE-2349&#8242;, 1, 0, NULL, 800, 600, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;9c21aed2-5bfa-4f18-bcb8-f11638dc2e4e&#8217;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (4, N&#8217;Headset Ball Bearings&#8217;, N&#8217;BE-2908&#8242;, 0, 0, NULL, 800, 600, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;ecfed6cb-51ff-49b5-b06c-7d8ac834db8b&#8217;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (316, N&#8217;Blade&#8217;, N&#8217;BL-2036&#8242;, 1, 0, NULL, 800, 600, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;e73e9750-603b-4131-89f5-3dd15ed5ff80&#8242;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (317, N&#8217;LL Crankarm&#8217;, N&#8217;CA-5965&#8242;, 0, 0, N&#8217;Black&#8217;, 500, 375, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, NULL, N&#8217;L &#8216;, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;3c9d10b7-a6b2-4774-9963-c19dcee72fea&#8217;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
INSERT [dbo].[Product] ([ProductID], [Name], [ProductNumber], [MakeFlag], [FinishedGoodsFlag], [Color], [SafetyStockLevel], [ReorderPoint], [StandardCost], [ListPrice], [Size], [SizeUnitMeasureCode], [WeightUnitMeasureCode], [Weight], [DaysToManufacture], [ProductLine], [Class], [Style], [ProductSubcategoryID], [ProductModelID], [SellStartDate], [SellEndDate], [DiscontinuedDate], [rowguid], [ModifiedDate]) VALUES (318, N&#8217;ML Crankarm&#8217;, N&#8217;CA-6738&#8242;, 0, 0, N&#8217;Black&#8217;, 500, 375, 0.0000, 0.0000, NULL, NULL, NULL, NULL, 0, NULL, N&#8217;M &#8216;, NULL, NULL, NULL, CAST(0x0000921E00000000 AS DateTime), NULL, NULL, N&#8217;eabb9a92-fa07-4eab-8955-f0517b4a4ca7&#8217;, CAST(0x00009A5C00A53CF8 AS DateTime))<br />
[/sql]</p>
<p><strong>Creating models and entity</strong></p>
<p>If you don&#8217;t know how to create an entity in your solution, please read that <a href="http://sibeeshpassion.com/web-api-with-angular-js/" target="_blank">here</a>. I have mentioned the steps to be followed in that article. Once you have created the entity, you are good to go.</p>
<p>Here I am assuming that you have created an entity and got a model class as preceding.</p>
<p>[csharp]<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
// &lt;auto-generated&gt;<br />
//     This code was generated from a template.<br />
//<br />
//     Manual changes to this file may cause unexpected behavior in your application.<br />
//     Manual changes to this file will be overwritten if the code is regenerated.<br />
// &lt;/auto-generated&gt;<br />
//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>namespace IgniteUIGrid.Models<br />
{<br />
    using System;<br />
    using System.Collections.Generic;</p>
<p>    public partial class Product<br />
    {<br />
        public int ProductID { get; set; }<br />
        public string Name { get; set; }<br />
        public string ProductNumber { get; set; }<br />
        public bool MakeFlag { get; set; }<br />
        public bool FinishedGoodsFlag { get; set; }<br />
        public string Color { get; set; }<br />
        public short SafetyStockLevel { get; set; }<br />
        public short ReorderPoint { get; set; }<br />
        public decimal StandardCost { get; set; }<br />
        public decimal ListPrice { get; set; }<br />
        public string Size { get; set; }<br />
        public string SizeUnitMeasureCode { get; set; }<br />
        public string WeightUnitMeasureCode { get; set; }<br />
        public Nullable&lt;decimal&gt; Weight { get; set; }<br />
        public int DaysToManufacture { get; set; }<br />
        public string ProductLine { get; set; }<br />
        public string Class { get; set; }<br />
        public string Style { get; set; }<br />
        public Nullable&lt;int&gt; ProductSubcategoryID { get; set; }<br />
        public Nullable&lt;int&gt; ProductModelID { get; set; }<br />
        public System.DateTime SellStartDate { get; set; }<br />
        public Nullable&lt;System.DateTime&gt; SellEndDate { get; set; }<br />
        public Nullable&lt;System.DateTime&gt; DiscontinuedDate { get; set; }<br />
        public System.Guid rowguid { get; set; }<br />
        public System.DateTime ModifiedDate { get; set; }<br />
    }<br />
}<br />
[/csharp]</p>
<p><strong>Creating IgniteUI Grid</strong></p>
<p>Now we are going to create a controller and view to show the grid. Click on the controller-> Add-> Controller. That will show you a pop up as preceding. </p>
<div id="attachment_11801" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/07/Ignite-UI-Controlelr-With-View.png"><img decoding="async" aria-describedby="caption-attachment-11801" src="http://sibeeshpassion.com/wp-content/uploads/2016/07/Ignite-UI-Controlelr-With-View-1024x715.png" alt="Ignite UI Controlelr With View" width="634" height="443" class="size-large wp-image-11801" srcset="/wp-content/uploads/2016/07/Ignite-UI-Controlelr-With-View-1024x715.png 1024w, /wp-content/uploads/2016/07/Ignite-UI-Controlelr-With-View-300x210.png 300w, /wp-content/uploads/2016/07/Ignite-UI-Controlelr-With-View-768x536.png 768w, /wp-content/uploads/2016/07/Ignite-UI-Controlelr-With-View-400x279.png 400w, /wp-content/uploads/2016/07/Ignite-UI-Controlelr-With-View-859x600.png 859w, /wp-content/uploads/2016/07/Ignite-UI-Controlelr-With-View.png 1177w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11801" class="wp-caption-text">Ignite UI Controlelr With View</p></div>
<p>Have you noticed that there are two new items, Ignite UI controller with view and Ignite UI view. Click on the first option. This will generate a controller and a view according to your model selection. Lets do that.</p>
<p>In the next pop up you can see the options to set your view and also your IgniteUI control.</p>
<div id="attachment_11802" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/07/Configure-view-and-controller-e1468146554193.png"><img decoding="async" aria-describedby="caption-attachment-11802" src="http://sibeeshpassion.com/wp-content/uploads/2016/07/Configure-view-and-controller-e1468146554193.png" alt="Configure view and controller" width="650" height="651" class="size-full wp-image-11802" srcset="/wp-content/uploads/2016/07/Configure-view-and-controller-e1468146554193.png 356w, /wp-content/uploads/2016/07/Configure-view-and-controller-e1468146554193-150x150.png 150w, /wp-content/uploads/2016/07/Configure-view-and-controller-e1468146554193-300x300.png 300w, /wp-content/uploads/2016/07/Configure-view-and-controller-e1468146554193-130x130.png 130w, /wp-content/uploads/2016/07/Configure-view-and-controller-e1468146554193-400x401.png 400w, /wp-content/uploads/2016/07/Configure-view-and-controller-e1468146554193-599x600.png 599w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11802" class="wp-caption-text">Configure view and controller</p></div>
<p>In the next tab, you can configure your widget according to your need. Now please select the features you would like to have in your grid. As of now I am going to select Filtering, Sorting, paging. </p>
<div id="attachment_11803" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/07/Configure-IgniteUI-widget-e1468146710432.png"><img decoding="async" aria-describedby="caption-attachment-11803" src="http://sibeeshpassion.com/wp-content/uploads/2016/07/Configure-IgniteUI-widget-e1468146710432.png" alt="Configure IgniteUI widget" width="650" height="654" class="size-full wp-image-11803" srcset="/wp-content/uploads/2016/07/Configure-IgniteUI-widget-e1468146710432.png 355w, /wp-content/uploads/2016/07/Configure-IgniteUI-widget-e1468146710432-150x150.png 150w, /wp-content/uploads/2016/07/Configure-IgniteUI-widget-e1468146710432-298x300.png 298w, /wp-content/uploads/2016/07/Configure-IgniteUI-widget-e1468146710432-130x130.png 130w, /wp-content/uploads/2016/07/Configure-IgniteUI-widget-e1468146710432-400x402.png 400w, /wp-content/uploads/2016/07/Configure-IgniteUI-widget-e1468146710432-596x600.png 596w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11803" class="wp-caption-text">Configure IgniteUI widget</p></div>
<p>This will generate a controller named Scaffold and a view accordingly, Let us rename it to MyGrid. So your MyGridController.cs file will be looking as preceding. </p>
<p>[csharp]<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Data.Entity;<br />
using System.Web;<br />
using System.Web.Mvc;</p>
<p>using Infragistics.Web.Mvc;</p>
<p>namespace IgniteUIGrid.Controllers<br />
{<br />
    public class MyGridController : Controller<br />
    {<br />
        private IgniteUIGrid.Models.TrialsDBEntities db = new IgniteUIGrid.Models.TrialsDBEntities();</p>
<p>        public ActionResult View()<br />
        {<br />
            var model = db.Products.AsQueryable();<br />
            return View(model);<br />
        }<br />
    }<br />
}<br />
[/csharp]</p>
<p>Now what about the view? Yes it is also being generated for you. Cool right? Below is the view generated. </p>
<p>[csharp]<br />
@using Infragistics.Web.Mvc;<br />
@model IQueryable&lt;IgniteUIGrid.Models.Product&gt;</p>
<p>@(Html.Infragistics()<br />
    .Grid(Model)<br />
    .ID(&quot;igGrid&quot;)<br />
    .Width(&quot;100%&quot;)<br />
    .AutoGenerateColumns(false)<br />
    .Columns(column =&gt;<br />
    {<br />
    })<br />
    .Features(f =&gt;<br />
    {<br />
		f.Filtering()<br />
			.Mode(FilterMode.Simple);<br />
		f.Paging()<br />
			.PageSize(5);<br />
		f.Resizing();<br />
		f.Sorting()<br />
			.Mode(SortingMode.Single);<br />
    })<br />
    .DataBind()<br />
    .Render())<br />
[/csharp]</p>
<p>By default grid width is set to 600px, here I have changed it to 100%. </p>
<p>Once you have set everything, go to your shared view folder, open _Layout.cshtml and add the following references to the view.</p>
<p>[html]<br />
 &lt;!&#8211; Ignite UI Required Combined CSS Files &#8211;&gt;<br />
    &lt;link href=&quot;http://cdn-na.infragistics.com/igniteui/2016.1/latest/css/themes/infragistics/infragistics.theme.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
    &lt;link href=&quot;http://cdn-na.infragistics.com/igniteui/2016.1/latest/css/structure/infragistics.css&quot; rel=&quot;stylesheet&quot; /&gt;</p>
<p>    &lt;script src=&quot;http://ajax.aspnetcdn.com/ajax/modernizr/modernizr-2.8.3.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://code.jquery.com/jquery-1.9.1.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://code.jquery.com/ui/1.10.3/jquery-ui.min.js&quot;&gt;&lt;/script&gt;</p>
<p>    &lt;!&#8211; Ignite UI Required Combined JavaScript Files &#8211;&gt;<br />
    &lt;script src=&quot;http://cdn-na.infragistics.com/igniteui/2016.1/latest/js/infragistics.core.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;http://cdn-na.infragistics.com/igniteui/2016.1/latest/js/infragistics.lob.js&quot;&gt;&lt;/script&gt;<br />
[/html]</p>
<p>Now run your application, you can see a grid is populated as preceding.</p>
<p><a href="http://sibeeshpassion.com/wp-content/uploads/2016/07/Ignite-UI-Grid.png"><img decoding="async" src="http://sibeeshpassion.com/wp-content/uploads/2016/07/Ignite-UI-Grid-1024x664.png" alt="Ignite UI Grid" width="634" height="411" class="alignnone size-large wp-image-11804" srcset="/wp-content/uploads/2016/07/Ignite-UI-Grid-1024x664.png 1024w, /wp-content/uploads/2016/07/Ignite-UI-Grid-300x195.png 300w, /wp-content/uploads/2016/07/Ignite-UI-Grid-768x498.png 768w, /wp-content/uploads/2016/07/Ignite-UI-Grid-400x259.png 400w, /wp-content/uploads/2016/07/Ignite-UI-Grid-925x600.png 925w, /wp-content/uploads/2016/07/Ignite-UI-Grid.png 1260w" sizes="(max-width: 634px) 100vw, 634px" /></a></p>
<p>Yes, you are right. It looks clumsy, we will solve this by selecting only the needed columns. For that you need to change the grid settings as follows. </p>
<p>[csharp]<br />
@(Html.Infragistics()<br />
    .Grid(Model)<br />
    .ID(&quot;igGrid&quot;)<br />
    .Width(&quot;100%&quot;)<br />
    .AutoGenerateColumns(false)<br />
    .Columns(column =&gt;<br />
    {<br />
        column.For(x =&gt; x.ProductID).HeaderText(&quot;Product ID&quot;).Width(&quot;30%&quot;);<br />
        column.For(x =&gt; x.Name).HeaderText(&quot;Name&quot;).Width(&quot;30%&quot;);<br />
        column.For(x =&gt; x.ProductNumber).HeaderText(&quot;Number&quot;).Width(&quot;20%&quot;);<br />
        column.For(x =&gt; x.SellEndDate).HeaderText(&quot;Sell End Date&quot;).Width(&quot;20%&quot;);<br />
        column.For(x =&gt; x.SellStartDate).HeaderText(&quot;Sell Start Date&quot;).Width(&quot;30%&quot;);<br />
        column.For(x =&gt; x.Size).HeaderText(&quot;Size&quot;).Width(&quot;30%&quot;);<br />
    })<br />
    .Features(f =&gt;<br />
    {<br />
        f.Filtering()<br />
            .Mode(FilterMode.Simple);<br />
        f.Paging()<br />
            .PageSize(5);<br />
        f.Resizing();<br />
        f.Sorting()<br />
            .Mode(SortingMode.Single);<br />
    })<br />
    .DataBind()<br />
    .Render())<br />
[/csharp]</p>
<p>Run your application and see the result. </p>
<div id="attachment_11805" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/07/Ignite-UI-Grid-With-Only-Selected-Columns.png"><img decoding="async" aria-describedby="caption-attachment-11805" src="http://sibeeshpassion.com/wp-content/uploads/2016/07/Ignite-UI-Grid-With-Only-Selected-Columns-1024x670.png" alt="Ignite UI Grid With Only Selected Columns" width="634" height="415" class="size-large wp-image-11805" srcset="/wp-content/uploads/2016/07/Ignite-UI-Grid-With-Only-Selected-Columns-1024x670.png 1024w, /wp-content/uploads/2016/07/Ignite-UI-Grid-With-Only-Selected-Columns-300x196.png 300w, /wp-content/uploads/2016/07/Ignite-UI-Grid-With-Only-Selected-Columns-768x502.png 768w, /wp-content/uploads/2016/07/Ignite-UI-Grid-With-Only-Selected-Columns-400x262.png 400w, /wp-content/uploads/2016/07/Ignite-UI-Grid-With-Only-Selected-Columns-917x600.png 917w, /wp-content/uploads/2016/07/Ignite-UI-Grid-With-Only-Selected-Columns.png 1258w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11805" class="wp-caption-text">Ignite UI Grid With Only Selected Columns</p></div>
<p>Now let us add few more columns, set the grid width, fix one column as stable (Should not move while scrolling), and set primary key. To add these features, you must change your settings as follows. </p>
<p>[csharp]<br />
@(Html.Infragistics()<br />
    .Grid(Model)<br />
    .ID(&quot;igGrid&quot;)<br />
    .Width(&quot;100%&quot;)<br />
    .Height(&quot;500px&quot;)<br />
    .PrimaryKey(&quot;ProductID&quot;)<br />
    .AutoGenerateColumns(false)<br />
    .AutoGenerateLayouts(false)<br />
    .Columns(column =&gt;<br />
    {<br />
        column.For(x =&gt; x.ProductID).HeaderText(&quot;Product ID&quot;).Width(&quot;30%&quot;);<br />
        column.For(x =&gt; x.Name).HeaderText(&quot;Name&quot;).Width(&quot;30%&quot;);<br />
        column.For(x =&gt; x.ProductNumber).HeaderText(&quot;Number&quot;).Width(&quot;20%&quot;);<br />
        column.For(x =&gt; x.SellEndDate).HeaderText(&quot;Sell End Date&quot;).Width(&quot;20%&quot;);<br />
        column.For(x =&gt; x.SellStartDate).HeaderText(&quot;Sell Start Date&quot;).Width(&quot;30%&quot;);<br />
        column.For(x =&gt; x.Size).HeaderText(&quot;Size&quot;).Width(&quot;30%&quot;);<br />
    })<br />
    .Features(f =&gt;<br />
    {<br />
        f.Filtering()<br />
            .Mode(FilterMode.Simple);<br />
        f.Paging()<br />
            .PageSize(5);<br />
        f.Sorting()<br />
            .Mode(SortingMode.Single);<br />
        f.ColumnFixing().FixingDirection(ColumnFixingDirection.Left);<br />
        f.ColumnFixing();<br />
    })<br />
    .DataBind()<br />
    .Render())<br />
[/csharp]</p>
<p>Now if you run your grid, you may get an error as <em>infragistics.lob.js:160 Uncaught Error: Column Fixing requires a different column width setting. The width of column with key ProductID should be set in pixels.</em>. This is why because of we have set the column width of our keys in percentage. Let us change it to pixel and try again.</p>
<p>[csharp]<br />
.Columns(column =&gt;<br />
    {<br />
        column.For(x =&gt; x.ProductID).HeaderText(&quot;Product ID&quot;).Width(&quot;130px&quot;);<br />
        column.For(x =&gt; x.Name).HeaderText(&quot;Name&quot;).Width(&quot;250px&quot;);<br />
        column.For(x =&gt; x.ProductNumber).HeaderText(&quot;Number&quot;).Width(&quot;150px&quot;);<br />
        column.For(x =&gt; x.SellEndDate).HeaderText(&quot;Sell End Date&quot;).Width(&quot;270px&quot;);<br />
        column.For(x =&gt; x.SellStartDate).HeaderText(&quot;Sell Start Date&quot;).Width(&quot;270px&quot;);<br />
        column.For(x =&gt; x.Size).HeaderText(&quot;Size&quot;).Width(&quot;130px&quot;);<br />
        column.For(x =&gt; x.ListPrice).HeaderText(&quot;List Price&quot;).Width(&quot;150px&quot;);<br />
    })<br />
[/csharp]</p>
<p>Run your grid. You can see the option to fix the columns. </p>
<div id="attachment_11806" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/07/Fix_column_in_Ignite_UI_Grid.png"><img decoding="async" aria-describedby="caption-attachment-11806" src="http://sibeeshpassion.com/wp-content/uploads/2016/07/Fix_column_in_Ignite_UI_Grid-1024x407.png" alt="Fix_column_in_Ignite_UI_Grid" width="634" height="252" class="size-large wp-image-11806" srcset="/wp-content/uploads/2016/07/Fix_column_in_Ignite_UI_Grid-1024x407.png 1024w, /wp-content/uploads/2016/07/Fix_column_in_Ignite_UI_Grid-300x119.png 300w, /wp-content/uploads/2016/07/Fix_column_in_Ignite_UI_Grid-768x305.png 768w, /wp-content/uploads/2016/07/Fix_column_in_Ignite_UI_Grid-400x159.png 400w, /wp-content/uploads/2016/07/Fix_column_in_Ignite_UI_Grid.png 1261w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11806" class="wp-caption-text">Fix_column_in_Ignite_UI_Grid</p></div>
<p>So once you fix the column and try to scroll, the column you fixed will not move. You can set the same for other columns too.</p>
<div id="attachment_11807" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/07/After_fixed_columns_in_Ignite_UI_Grid.png"><img decoding="async" aria-describedby="caption-attachment-11807" src="http://sibeeshpassion.com/wp-content/uploads/2016/07/After_fixed_columns_in_Ignite_UI_Grid-1024x449.png" alt="After_fixed_columns_in_Ignite_UI_Grid" width="634" height="278" class="size-large wp-image-11807" srcset="/wp-content/uploads/2016/07/After_fixed_columns_in_Ignite_UI_Grid-1024x449.png 1024w, /wp-content/uploads/2016/07/After_fixed_columns_in_Ignite_UI_Grid-300x132.png 300w, /wp-content/uploads/2016/07/After_fixed_columns_in_Ignite_UI_Grid-768x337.png 768w, /wp-content/uploads/2016/07/After_fixed_columns_in_Ignite_UI_Grid-400x175.png 400w, /wp-content/uploads/2016/07/After_fixed_columns_in_Ignite_UI_Grid.png 1257w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11807" class="wp-caption-text">After_fixed_columns_in_Ignite_UI_Grid</p></div>
<p>I hope you have got some knowledge about the Ignite UI grid control. That&#8217;s all for today. See you soon with other Ignite UI controls.</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/working-with-igniteui-grid-control/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Implement radio button selection in JQWidgets JQXGrid using checkbox</title>
		<link>https://sibeeshpassion.com/implement-radio-button-selection-in-jqwidgets-jqxgrid-using-checkbox/</link>
					<comments>https://sibeeshpassion.com/implement-radio-button-selection-in-jqwidgets-jqxgrid-using-checkbox/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 29 Jun 2016 05:22:53 +0000</pubDate>
				<category><![CDATA[JQWidgets]]></category>
		<category><![CDATA[JQX Grid]]></category>
		<category><![CDATA[Radio button selection in JQWidgets JQXGrid]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11720</guid>

					<description><![CDATA[In this post we will see how we can implement radio button selection feature to jQWidgets jQXGrid. As of now in JQXGrid, we don&#8217;t have this functionality yet, but still we can do it our self by using check box selection which is already available. We will load the grid with sample data and implement the radio button selection. If you are new to JQX Grid, you can see some tips here. I hope you will like this. Download Source Code You can always download the source code from here: Radio button selection in JQXGrid Background I am using JQXGrid [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can implement radio button selection feature to <a href="http://sibeeshpassion.com/category/products/jqwidgets/" target="_blank">jQWidgets </a><a href="http://sibeeshpassion.com/category/products/jqwidgets/jqx-grid/" target="_blank">jQXGrid</a>. As of now in JQXGrid, we don&#8217;t have this functionality yet, but still we can do it our self by using check box selection which is already available. We will load the grid with sample data and implement the radio button selection. If you are new to JQX Grid, you can see some tips <em><a href="http://sibeeshpassion.com/tag/jqx-grid/" target="_blank">here</a></em>. I hope you will like this. </p>
<p><strong>Download Source Code</strong></p>
<p>You can always download the source code from here: <a href="https://code.msdn.microsoft.com/Implement-radio-button-354fd876" target="_blank">Radio button selection in JQXGrid</a></p>
<p><strong>Background</strong></p>
<p>I am using JQXGrid in one of my project, where I wanted to implement the radio button selection, when I talked with JQXGrid development team, I was said that the functionality is not yet available. But they have given an option as <em>selectionmode: &#8216;checkbox&#8217;</em> with the help of that property we can implement the requirement. As you know, to load a jQWidget JQX Grid, there you need the following things as mandatory. </p>
<li>datafields</li>
<li>columns</li>
<li>localdata or server side data</li>
<p><strong>Using the code</strong></p>
<p>First of all, load the needed references. You can download the needed files from <a href="http://www.jqwidgets.com/download/" target="_blank">here</a>.</p>
<p>[html]<br />
   &lt;link rel=&quot;stylesheet&quot; href=&quot;jqwidgets/styles/jqx.base.css&quot; type=&quot;text/css&quot; /&gt;<br />
    &lt;script src=&quot;jquery-2.2.3.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxcore.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxdata.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxbuttons.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxscrollbar.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxmenu.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxgrid.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxgrid.edit.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxgrid.selection.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxgrid.pager.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxlistbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxdropdownlist.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxgrid.sort.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxcheckbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxgrid.columnsresize.js&quot;&gt;&lt;/script&gt;<br />
[/html]</p>
<p>Now, we are going to set our data source, this time we will use a XML file as data source.</p>
<p>[xml]<br />
&lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot; standalone=&quot;yes&quot;?&gt;<br />
&lt;feed xml:base=&quot;http://services.odata.org/Northwind/Northwind.svc/&quot; xmlns:d=&quot;http://schemas.microsoft.com/ado/2007/08/dataservices&quot; xmlns:m=&quot;http://schemas.microsoft.com/ado/2007/08/dataservices/metadata&quot; xmlns=&quot;http://www.w3.org/2005/Atom&quot;&gt;<br />
  &lt;title type=&quot;text&quot;&gt;Orders&lt;/title&gt;<br />
  &lt;id&gt;http://services.odata.org/Northwind/Northwind.svc/Orders&lt;/id&gt;<br />
  &lt;updated&gt;2011-12-01T11:55:06Z&lt;/updated&gt;<br />
  &lt;link rel=&quot;self&quot; title=&quot;Orders&quot; href=&quot;Orders&quot; /&gt;<br />
  &lt;entry&gt;<br />
    &lt;id&gt;http://services.odata.org/Northwind/Northwind.svc/Orders(10248)&lt;/id&gt;<br />
    &lt;title type=&quot;text&quot;&gt;&lt;/title&gt;<br />
    &lt;updated&gt;2011-12-01T11:55:06Z&lt;/updated&gt;<br />
    &lt;author&gt;<br />
      &lt;name /&gt;<br />
    &lt;/author&gt;<br />
    &lt;link rel=&quot;edit&quot; title=&quot;Order&quot; href=&quot;Orders(10248)&quot; /&gt;<br />
    &lt;link rel=&quot;http://schemas.microsoft.com/ado/2007/08/dataservices/related/Customer&quot; type=&quot;application/atom+xml;type=entry&quot; title=&quot;Customer&quot; href=&quot;Orders(10248)/Customer&quot; /&gt;<br />
    &lt;link rel=&quot;http://schemas.microsoft.com/ado/2007/08/dataservices/related/Employee&quot; type=&quot;application/atom+xml;type=entry&quot; title=&quot;Employee&quot; href=&quot;Orders(10248)/Employee&quot; /&gt;<br />
    &lt;link rel=&quot;http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details&quot; type=&quot;application/atom+xml;type=feed&quot; title=&quot;Order_Details&quot; href=&quot;Orders(10248)/Order_Details&quot; /&gt;<br />
    &lt;link rel=&quot;http://schemas.microsoft.com/ado/2007/08/dataservices/related/Shipper&quot; type=&quot;application/atom+xml;type=entry&quot; title=&quot;Shipper&quot; href=&quot;Orders(10248)/Shipper&quot; /&gt;<br />
    &lt;category term=&quot;NorthwindModel.Order&quot; scheme=&quot;http://schemas.microsoft.com/ado/2007/08/dataservices/scheme&quot; /&gt;<br />
    &lt;content type=&quot;application/xml&quot;&gt;<br />
      &lt;m:properties&gt;<br />
        &lt;d:OrderID m:type=&quot;Edm.Int32&quot;&gt;10248&lt;/d:OrderID&gt;<br />
        &lt;d:CustomerID&gt;VINET&lt;/d:CustomerID&gt;<br />
        &lt;d:EmployeeID m:type=&quot;Edm.Int32&quot;&gt;5&lt;/d:EmployeeID&gt;<br />
        &lt;d:OrderDate m:type=&quot;Edm.DateTime&quot;&gt;1996-07-04T00:00:00&lt;/d:OrderDate&gt;<br />
        &lt;d:RequiredDate m:type=&quot;Edm.DateTime&quot;&gt;1996-08-01T00:00:00&lt;/d:RequiredDate&gt;<br />
        &lt;d:ShippedDate m:type=&quot;Edm.DateTime&quot;&gt;1996-07-16T00:00:00&lt;/d:ShippedDate&gt;<br />
        &lt;d:ShipVia m:type=&quot;Edm.Int32&quot;&gt;3&lt;/d:ShipVia&gt;<br />
        &lt;d:Freight m:type=&quot;Edm.Decimal&quot;&gt;32.3800&lt;/d:Freight&gt;<br />
        &lt;d:ShipName&gt;Vins et alcools Chevalier&lt;/d:ShipName&gt;<br />
        &lt;d:ShipAddress&gt;59 rue de l&#8217;Abbaye&lt;/d:ShipAddress&gt;<br />
        &lt;d:ShipCity&gt;Reims&lt;/d:ShipCity&gt;<br />
        &lt;d:ShipRegion m:null=&quot;true&quot; /&gt;<br />
        &lt;d:ShipPostalCode&gt;51100&lt;/d:ShipPostalCode&gt;<br />
        &lt;d:ShipCountry&gt;France&lt;/d:ShipCountry&gt;<br />
      &lt;/m:properties&gt;<br />
    &lt;/content&gt;<br />
  &lt;/entry&gt;<br />
  &lt;entry&gt;<br />
    &lt;id&gt;http://services.odata.org/Northwind/Northwind.svc/Orders(10249)&lt;/id&gt;<br />
    &lt;title type=&quot;text&quot;&gt;&lt;/title&gt;<br />
    &lt;updated&gt;2011-12-01T11:55:06Z&lt;/updated&gt;<br />
    &lt;author&gt;<br />
      &lt;name /&gt;<br />
    &lt;/author&gt;<br />
    &lt;link rel=&quot;edit&quot; title=&quot;Order&quot; href=&quot;Orders(10249)&quot; /&gt;<br />
    &lt;link rel=&quot;http://schemas.microsoft.com/ado/2007/08/dataservices/related/Customer&quot; type=&quot;application/atom+xml;type=entry&quot; title=&quot;Customer&quot; href=&quot;Orders(10249)/Customer&quot; /&gt;<br />
    &lt;link rel=&quot;http://schemas.microsoft.com/ado/2007/08/dataservices/related/Employee&quot; type=&quot;application/atom+xml;type=entry&quot; title=&quot;Employee&quot; href=&quot;Orders(10249)/Employee&quot; /&gt;<br />
    &lt;link rel=&quot;http://schemas.microsoft.com/ado/2007/08/dataservices/related/Order_Details&quot; type=&quot;application/atom+xml;type=feed&quot; title=&quot;Order_Details&quot; href=&quot;Orders(10249)/Order_Details&quot; /&gt;<br />
    &lt;link rel=&quot;http://schemas.microsoft.com/ado/2007/08/dataservices/related/Shipper&quot; type=&quot;application/atom+xml;type=entry&quot; title=&quot;Shipper&quot; href=&quot;Orders(10249)/Shipper&quot; /&gt;<br />
    &lt;category term=&quot;NorthwindModel.Order&quot; scheme=&quot;http://schemas.microsoft.com/ado/2007/08/dataservices/scheme&quot; /&gt;<br />
    &lt;content type=&quot;application/xml&quot;&gt;<br />
      &lt;m:properties&gt;<br />
        &lt;d:OrderID m:type=&quot;Edm.Int32&quot;&gt;10249&lt;/d:OrderID&gt;<br />
        &lt;d:CustomerID&gt;TOMSP&lt;/d:CustomerID&gt;<br />
        &lt;d:EmployeeID m:type=&quot;Edm.Int32&quot;&gt;6&lt;/d:EmployeeID&gt;<br />
        &lt;d:OrderDate m:type=&quot;Edm.DateTime&quot;&gt;1996-07-05T00:00:00&lt;/d:OrderDate&gt;<br />
        &lt;d:RequiredDate m:type=&quot;Edm.DateTime&quot;&gt;1996-08-16T00:00:00&lt;/d:RequiredDate&gt;<br />
        &lt;d:ShippedDate m:type=&quot;Edm.DateTime&quot;&gt;1996-07-10T00:00:00&lt;/d:ShippedDate&gt;<br />
        &lt;d:ShipVia m:type=&quot;Edm.Int32&quot;&gt;1&lt;/d:ShipVia&gt;<br />
        &lt;d:Freight m:type=&quot;Edm.Decimal&quot;&gt;11.6100&lt;/d:Freight&gt;<br />
        &lt;d:ShipName&gt;Toms Spezialitäten&lt;/d:ShipName&gt;<br />
        &lt;d:ShipAddress&gt;Luisenstr. 48&lt;/d:ShipAddress&gt;<br />
        &lt;d:ShipCity&gt;Münster&lt;/d:ShipCity&gt;<br />
        &lt;d:ShipRegion m:null=&quot;true&quot; /&gt;<br />
        &lt;d:ShipPostalCode&gt;44087&lt;/d:ShipPostalCode&gt;<br />
        &lt;d:ShipCountry&gt;Germany&lt;/d:ShipCountry&gt;<br />
      &lt;/m:properties&gt;<br />
    &lt;/content&gt;<br />
  &lt;/entry&gt;<br />
  &lt;link rel=&quot;next&quot; href=&quot;http://services.odata.org/Northwind/Northwind.svc/Orders?$skiptoken=10447&quot; /&gt;<br />
&lt;/feed&gt;<br />
[/xml]</p>
<p>You can get the full data from the file <em>orders.xml</em> from the solution attached.</p>
<p>Now create a div element where we can bind the grid. </p>
<p>[html]<br />
 &lt;div id=&#8217;jqxWidget&#8217; style=&quot;font-size: 13px; font-family: Verdana; float: left;&quot;&gt;<br />
        &lt;div id=&quot;jqxgrid&quot;&gt;<br />
        &lt;/div&gt;<br />
    &lt;/div&gt;<br />
[/html]</p>
<p>Now we will define our grid as follows. </p>
<p>[js]<br />
 $(&quot;#jqxgrid&quot;).jqxGrid(<br />
            {<br />
                width: 850,<br />
                height: 450,<br />
                source: dataAdapter,<br />
                sortable: true,<br />
                selectionmode: &#8216;checkbox&#8217;,<br />
                altrows: true,<br />
                ready: function () {<br />
                    $(&#8216;#columntablejqxgrid .jqx-checkbox-default&#8217;).hide();<br />
                },<br />
                columns: [<br />
                  { text: &#8216;Ship Name&#8217;, datafield: &#8216;ShipName&#8217;, width: 250 },<br />
                  { text: &#8216;Shipped Date&#8217;, datafield: &#8216;ShippedDate&#8217;, width: 100, cellsformat: &#8216;yyyy-MM-dd&#8217; },<br />
                  { text: &#8216;Freight&#8217;, datafield: &#8216;Freight&#8217;, width: 150, cellsformat: &#8216;F2&#8217;, cellsalign: &#8216;right&#8217; },<br />
                  { text: &#8216;Ship City&#8217;, datafield: &#8216;ShipCity&#8217;, width: 150 },<br />
                  { text: &#8216;Ship Country&#8217;, datafield: &#8216;ShipCountry&#8217; }<br />
                ]<br />
            });<br />
[/js]</p>
<p>As you can see we have applied <em>dataAdapter</em> as the source, below is the definition for your data adapter. </p>
<p>[js]<br />
  var dataAdapter = new $.jqx.dataAdapter(source);<br />
[/js]</p>
<p>Now we will create the source object as follows. </p>
<p>[js]<br />
   var source =<br />
            {<br />
                datatype: &quot;xml&quot;,<br />
                datafields: [<br />
                    { name: &#8216;ShippedDate&#8217;, map: &#8216;m\\:properties&gt;d\\:ShippedDate&#8217;, type: &#8216;date&#8217; },<br />
                    { name: &#8216;Freight&#8217;, map: &#8216;m\\:properties&gt;d\\:Freight&#8217;, type: &#8216;float&#8217; },<br />
                    { name: &#8216;ShipName&#8217;, map: &#8216;m\\:properties&gt;d\\:ShipName&#8217;, type: &#8216;string&#8217; },<br />
                    { name: &#8216;ShipAddress&#8217;, map: &#8216;m\\:properties&gt;d\\:ShipAddress&#8217;, type: &#8216;string&#8217; },<br />
                    { name: &#8216;ShipCity&#8217;, map: &#8216;m\\:properties&gt;d\\:ShipCity&#8217;, type: &#8216;string&#8217; },<br />
                    { name: &#8216;ShipCountry&#8217;, map: &#8216;m\\:properties&gt;d\\:ShipCountry&#8217;, type: &#8216;string&#8217; }<br />
                ],<br />
                root: &quot;entry&quot;,<br />
                record: &quot;content&quot;,<br />
                id: &#8216;m\\:properties&gt;d\\:OrderID&#8217;,<br />
                url: url<br />
            };<br />
[/js]</p>
<p>As the grid definition is over,it is time to run our application and check whether the grid is loading fine or not. </p>
<div id="attachment_11721" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/06/Grid-with-check-box-selection-e1467177190846.png"><img decoding="async" aria-describedby="caption-attachment-11721" src="http://sibeeshpassion.com/wp-content/uploads/2016/06/Grid-with-check-box-selection-e1467177190846.png" alt="Grid with check box selection" width="650" height="357" class="size-full wp-image-11721" srcset="/wp-content/uploads/2016/06/Grid-with-check-box-selection-e1467177190846.png 650w, /wp-content/uploads/2016/06/Grid-with-check-box-selection-e1467177190846-300x165.png 300w, /wp-content/uploads/2016/06/Grid-with-check-box-selection-e1467177190846-400x220.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11721" class="wp-caption-text">Grid with check box selection</p></div>
<p>what do you see? You are able to do multiple selection right? But what do we needed? A radio button selection, isn&#8217;t it? So we are suppose to able to select only one row right?. This is why, we haven&#8217;t done the needed implementation yet. Let us add some script then. </p>
<p>[js]<br />
 $(&#8216;#jqxgrid&#8217;).on(&#8216;rowselect&#8217;, function (event) {<br />
                // event arguments.<br />
                var args = event.args;<br />
                // row&#8217;s bound index.<br />
                var rowBoundIndex = args.rowindex;<br />
                var selectedIndexes = $(&#8216;#jqxgrid&#8217;).jqxGrid(&#8216;selectedrowindexes&#8217;);<br />
                for (var i = 0; i &lt; selectedIndexes.length; i++) {<br />
                    if (rowBoundIndex !== selectedIndexes[i]) {<br />
                        $(&#8216;#jqxgrid&#8217;).jqxGrid(&#8216;unselectrow&#8217;, selectedIndexes[i]);<br />
                    }<br />
                }<br />
            });<br />
[/js]</p>
<p>We are just deleting the other row selection in the event <em>rowselect</em>. Now run your application again, I am sure you will be able to select only one row at a time. </p>
<div id="attachment_11722" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/06/Grid-with-radio-button-selection-e1467177640220.png"><img decoding="async" aria-describedby="caption-attachment-11722" src="http://sibeeshpassion.com/wp-content/uploads/2016/06/Grid-with-radio-button-selection-e1467177640220.png" alt="Grid with radio button selection" width="650" height="351" class="size-full wp-image-11722" srcset="/wp-content/uploads/2016/06/Grid-with-radio-button-selection-e1467177640220.png 650w, /wp-content/uploads/2016/06/Grid-with-radio-button-selection-e1467177640220-300x162.png 300w, /wp-content/uploads/2016/06/Grid-with-radio-button-selection-e1467177640220-400x216.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11722" class="wp-caption-text">Grid with radio button selection</p></div>
<p>Now we can see the complete code.</p>
<p><strong>Complete code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&quot;en&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;link rel=&quot;stylesheet&quot; href=&quot;jqwidgets/styles/jqx.base.css&quot; type=&quot;text/css&quot; /&gt;</p>
<p>    &lt;script src=&quot;jquery-2.2.3.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxcore.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxdata.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxbuttons.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxscrollbar.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxmenu.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxgrid.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxgrid.edit.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxgrid.selection.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxgrid.pager.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxlistbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxdropdownlist.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxgrid.sort.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxcheckbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;jqwidgets/jqxgrid.columnsresize.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot;&gt;<br />
        $(document).ready(function () {<br />
            var url = &quot;orders.xml&quot;;</p>
<p>            // prepare the data<br />
            var source =<br />
            {<br />
                datatype: &quot;xml&quot;,<br />
                datafields: [<br />
                    { name: &#8216;ShippedDate&#8217;, map: &#8216;m\\:properties&gt;d\\:ShippedDate&#8217;, type: &#8216;date&#8217; },<br />
                    { name: &#8216;Freight&#8217;, map: &#8216;m\\:properties&gt;d\\:Freight&#8217;, type: &#8216;float&#8217; },<br />
                    { name: &#8216;ShipName&#8217;, map: &#8216;m\\:properties&gt;d\\:ShipName&#8217;, type: &#8216;string&#8217; },<br />
                    { name: &#8216;ShipAddress&#8217;, map: &#8216;m\\:properties&gt;d\\:ShipAddress&#8217;, type: &#8216;string&#8217; },<br />
                    { name: &#8216;ShipCity&#8217;, map: &#8216;m\\:properties&gt;d\\:ShipCity&#8217;, type: &#8216;string&#8217; },<br />
                    { name: &#8216;ShipCountry&#8217;, map: &#8216;m\\:properties&gt;d\\:ShipCountry&#8217;, type: &#8216;string&#8217; }<br />
                ],<br />
                root: &quot;entry&quot;,<br />
                record: &quot;content&quot;,<br />
                id: &#8216;m\\:properties&gt;d\\:OrderID&#8217;,<br />
                url: url<br />
            };<br />
            var dataAdapter = new $.jqx.dataAdapter(source);</p>
<p>            // create jqxgrid.<br />
            $(&quot;#jqxgrid&quot;).jqxGrid(<br />
            {<br />
                width: 850,<br />
                height: 450,<br />
                source: dataAdapter,<br />
                sortable: true,<br />
                selectionmode: &#8216;checkbox&#8217;,<br />
                altrows: true,<br />
                ready: function () {<br />
                    $(&#8216;#columntablejqxgrid .jqx-checkbox-default&#8217;).hide();<br />
                },<br />
                columns: [<br />
                  { text: &#8216;Ship Name&#8217;, datafield: &#8216;ShipName&#8217;, width: 250 },<br />
                  { text: &#8216;Shipped Date&#8217;, datafield: &#8216;ShippedDate&#8217;, width: 100, cellsformat: &#8216;yyyy-MM-dd&#8217; },<br />
                  { text: &#8216;Freight&#8217;, datafield: &#8216;Freight&#8217;, width: 150, cellsformat: &#8216;F2&#8217;, cellsalign: &#8216;right&#8217; },<br />
                  { text: &#8216;Ship City&#8217;, datafield: &#8216;ShipCity&#8217;, width: 150 },<br />
                  { text: &#8216;Ship Country&#8217;, datafield: &#8216;ShipCountry&#8217; }<br />
                ]<br />
            });</p>
<p>            $(&#8216;#jqxgrid&#8217;).on(&#8216;rowselect&#8217;, function (event) {<br />
                // event arguments.<br />
                var args = event.args;<br />
                // row&#8217;s bound index.<br />
                var rowBoundIndex = args.rowindex;<br />
                var selectedIndexes = $(&#8216;#jqxgrid&#8217;).jqxGrid(&#8216;selectedrowindexes&#8217;);<br />
                for (var i = 0; i &lt; selectedIndexes.length; i++) {<br />
                    if (rowBoundIndex !== selectedIndexes[i]) {<br />
                        $(&#8216;#jqxgrid&#8217;).jqxGrid(&#8216;unselectrow&#8217;, selectedIndexes[i]);<br />
                    }<br />
                }<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body class=&#8217;default&#8217;&gt;<br />
    &lt;div id=&#8217;jqxWidget&#8217; style=&quot;font-size: 13px; font-family: Verdana; float: left;&quot;&gt;<br />
        &lt;div id=&quot;jqxgrid&quot;&gt;<br />
        &lt;/div&gt;<br />
    &lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/implement-radio-button-selection-in-jqwidgets-jqxgrid-using-checkbox/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Client Side Exporting In HighChart</title>
		<link>https://sibeeshpassion.com/client-side-exporting-in-highchart/</link>
					<comments>https://sibeeshpassion.com/client-side-exporting-in-highchart/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Fri, 27 May 2016 10:59:54 +0000</pubDate>
				<category><![CDATA[HighChart]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Client Side Exporting]]></category>
		<category><![CDATA[HighChart Exporting]]></category>
		<category><![CDATA[How To]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11664</guid>

					<description><![CDATA[In this post we will discuss how we can enable client side exporting in HighChart . In normal case the data of your chart is being send to the external server which is http://export.highcharts.com/. But if your product is already in production environment, none of your clients will not agree with the idea of sending their data to any third party server. Am I right? To overcome this, HighChart has given an option called offline-exporting. Here we will discuss that. I hope you will like this. Demo Please see the demo here. Background For the past few months, I am [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will discuss how we can enable client side exporting in <a href="http://sibeeshpassion.com/category/highchart/" target="_blank">HighChart </a>. In normal case the data of your chart is being send to the external server which is http://export.highcharts.com/. But if your product is already in production environment, none of your clients will not agree with the idea of sending their data to any third party server. Am I right? To overcome this, HighChart has given an option called <em>offline-exporting</em>. Here we will discuss that. I hope you will like this.</p>
<p><strong>Demo</strong></p>
<p>Please see the demo <a href="https://jsfiddle.net/sibeeshvenu/pwLo7112/" target="_blank">here</a>.</p>
<p><strong>Background</strong></p>
<p>For the past few months, I am working with a project where I use HighChart to manipulate the data and shows as Charts. Now the problem is, while exporting the data, the entire data was going to the HighChart server that is http://export.highcharts.com/. I wanted to get rid of this. So I used the option client side exporting by adding one extra JavaScript file https://code.highcharts.com/modules/offline-exporting.js.</p>
<p><strong>Using the code</strong></p>
<p>First we will populate the chart. For that you must add the needed references as follows. </p>
<p>[html]<br />
&lt;script src=&quot;https://code.jquery.com/jquery-2.2.4.min.js&quot;&quot;&gt;&lt;/script&gt;<br />
&lt;script src=&quot;https://code.highcharts.com/highcharts.js&quot;&gt;&lt;/script&gt;<br />
&lt;script src=&quot;https://code.highcharts.com/modules/exporting.js&quot;&gt;&lt;/script&gt;<br />
[/html]</p>
<p>Now add the chart configuration as follows</p>
<p>[js]<br />
$(function () {<br />
    $(&#8216;#myChart&#8217;).highcharts({<br />
        credits: {<br />
            enabled: false<br />
        },<br />
        exporting: {<br />
            chartOptions: {<br />
                plotOptions: {<br />
                    series: {<br />
                        dataLabels: {<br />
                            enabled: true<br />
                        }<br />
                    }<br />
                }<br />
            },<br />
            scale: 3<br />
        },<br />
        title: {<br />
            text: &#8216;My blog vistor count for a week&#8217;<br />
        },<br />
        subtitle: {<br />
            text: &#8216;Monday to Sunday&#8217;<br />
        },<br />
        chart: {<br />
            type: &#8216;area&#8217;<br />
        },<br />
        xAxis: {<br />
            categories: [&#8216;Mon&#8217;, &#8216;Tue&#8217;, &#8216;Wed&#8217;, &#8216;Thu&#8217;, &#8216;Fri&#8217;, &#8216;Sat&#8217;,<br />
                &#8216;Sun&#8217;]<br />
        },<br />
        series: [{<br />
        name:&#8217;Visitor Count&#8217;,<br />
            data: [1005, 558, 1467, 707, 1289, 867, 543]<br />
        }]<br />
    });<br />
});<br />
[/js]</p>
<p>Now if you run your application, you can see a chart as follows.</p>
<div id="attachment_11665" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/05/High-Chart-e1464345878246.png"><img decoding="async" aria-describedby="caption-attachment-11665" src="http://sibeeshpassion.com/wp-content/uploads/2016/05/High-Chart-e1464345878246.png" alt="High Chart" width="650" height="312" class="size-full wp-image-11665" srcset="/wp-content/uploads/2016/05/High-Chart-e1464345878246.png 650w, /wp-content/uploads/2016/05/High-Chart-e1464345878246-300x144.png 300w, /wp-content/uploads/2016/05/High-Chart-e1464345878246-400x192.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11665" class="wp-caption-text">High Chart</p></div>
<p>Now it is time to check the exporting. If you click on export icon on the right top corner, you will given options to choose like on which format you need to export the data. Just click on anything you wish. You can see that the data is being send to the server http://export.highcharts.com/ in the top left side. To overcome this, you need to add a reference of the file called offline-exporting.js.</p>
<p>[html]<br />
&lt;script src=&quot;https://code.highcharts.com/modules/offline-exporting.js&quot;&gt;&lt;/script&gt;<br />
[/html]</p>
<p>That&#8217;s all. You are done.</p>
<p>Please be noted this feature is not supported in browser IE 8, So if you load this chart in any unsupported browser, the module will fall back to the export server. This can be handled with the option <em>fallbackToExportServer: false</em>. You need to set this option in your exporting settings as follows.</p>
<p>[js]<br />
  exporting: {<br />
            chartOptions: {<br />
                plotOptions: {<br />
                    series: {<br />
                        dataLabels: {<br />
                            enabled: true<br />
                        }<br />
                    }<br />
                }<br />
            },<br />
            scale: 3,<br />
            fallbackToExportServer: false<br />
        }<br />
[/js]</p>
<p>In Internet Explorer, it requires <a href="https://github.com/gabelerner/canvg" target="_blank">canvg</a> library to export the chart to PNG format. But you don&#8217;t need to worry about this file. This will be automatically downloaded on demand by the system. </p>
<p><strong>Reference</strong></p>
<li><a href="http://www.highcharts.com/docs/export-module/client-side-export" target="_blank">client-side-export</a></li>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn&#8217;t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/client-side-exporting-in-highchart/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Dynamically Apply Colour Coding in Grid With Dynamic Headers And Data</title>
		<link>https://sibeeshpassion.com/dynamically-apply-colour-coding-in-grid-with-dynamic-headers-and-data/</link>
					<comments>https://sibeeshpassion.com/dynamically-apply-colour-coding-in-grid-with-dynamic-headers-and-data/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 16 Feb 2016 07:33:54 +0000</pubDate>
				<category><![CDATA[JQWidgets]]></category>
		<category><![CDATA[JQX Grid]]></category>
		<category><![CDATA[cellsrenderer]]></category>
		<category><![CDATA[Colour Code In Grid]]></category>
		<category><![CDATA[dataAdapter]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11229</guid>

					<description><![CDATA[In this post we will see how we can apply colour coding dynamically to jQWidgets jQXGrid. Normally a grid control can be used when you need to formulate the data either in row wise or column wise. Here in this pose we will discuss how to differentiate some rows of the grid from the other by applying some conditions over the values dynamically. We are taking an HTML table as the data source and in the client side we will be looping through each columns and rows. If you are new to JQX Grid, you can see some tips here. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can apply colour coding dynamically to <a href="http://sibeeshpassion.com/category/products/jqwidgets/" target="_blank">jQWidgets </a><a href="http://sibeeshpassion.com/category/products/jqwidgets/jqx-grid/" target="_blank">jQXGrid</a>. Normally a grid control can be used when you need to formulate the data either in row wise or column wise. Here in this pose we will discuss how to differentiate some rows of the grid from the other by applying some conditions over the values dynamically. We are taking an HTML table as the data source and in the client side we will be looping through each columns and rows. If you are new to JQX Grid, you can see some tips <em><a href="http://sibeeshpassion.com/tag/jqx-grid/" target="_blank">here</a></em>. I hope you will like this. </p>
<p><strong>Background</strong></p>
<p>If you are aware of the header column names and the data (Static data), you can apply the colour coding in a simple way as shown in this <a href="http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/index.htm#demos/jqxgrid/gridcellclass.htm" target="_blank">link</a>. There we are using a property called <em>cellclassname</em> to fire an external function which returns the coloured HTML in return. </p>
<p>But in my case, the situation was different. The data source (HTML table here) was dynamic, hence I could not predict the header names and the data. As you know, to load a jQWidget JQX Grid, there you need the following things as mandatory. </p>
<li>datafields</li>
<li>columns</li>
<li>localdata or server side data</li>
<p>So to create/format the above mentioned properties, I am using an another way which we will discuss in this post. </p>
<p><strong>Using the code</strong></p>
<p>First of all, load the needed references. You can download the needed files from <a href="http://www.jqwidgets.com/download/" target="_blank">here</a>.</p>
<p>[html]<br />
 &lt;script src=&quot;jquery-1.9.1.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxcore.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxbuttons.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxscrollbar.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxlistbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdropdownlist.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxmenu.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.filter.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.sort.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.selection.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.pager.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsresize.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsreorder.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdatatable.js&quot;&gt;&lt;/script&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.base.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
[/html]</p>
<p>Now, we will create the HTML data. To make the processes easy, here I am going to paste a static HTML table(This table was dynamic for me).</p>
<p>[html]<br />
&lt;table id=&quot;initialTable&quot; style=&quot;width: 300px;display:none;&quot;&gt;<br />
        &lt;thead&gt;<br />
            &lt;tr&gt;<br />
                &lt;th&gt;Firstname<br />
                &lt;/th&gt;<br />
                &lt;th&gt;Lastname<br />
                &lt;/th&gt;<br />
                &lt;th&gt;Debits<br />
                &lt;/th&gt;<br />
            &lt;/tr&gt;<br />
        &lt;/thead&gt;<br />
        &lt;tbody&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Eve<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Jackson<br />
                &lt;/td&gt;<br />
                &lt;td&gt;94<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Clara<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Oswald<br />
                &lt;/td&gt;<br />
                &lt;td&gt;17<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Benedict<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Mason<br />
                &lt;/td&gt;<br />
                &lt;td&gt;33<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Eve<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Jackson<br />
                &lt;/td&gt;<br />
                &lt;td&gt;94<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Clara<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Oswald<br />
                &lt;/td&gt;<br />
                &lt;td&gt;17<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Benedict<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Mason<br />
                &lt;/td&gt;<br />
                &lt;td&gt;33<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Eve<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Jackson<br />
                &lt;/td&gt;<br />
                &lt;td&gt;94<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Clara<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Oswald<br />
                &lt;/td&gt;<br />
                &lt;td&gt;17<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Benedict<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Mason<br />
                &lt;/td&gt;<br />
                &lt;td&gt;33<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Eve<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Jackson<br />
                &lt;/td&gt;<br />
                &lt;td&gt;94<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Clara<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Oswald<br />
                &lt;/td&gt;<br />
                &lt;td&gt;17<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Benedict<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Mason<br />
                &lt;/td&gt;<br />
                &lt;td&gt;33<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
        &lt;/tbody&gt;<br />
    &lt;/table&gt;<br />
[/html]</p>
<p>Then it is time to say where do you need to bind the grid.</p>
<p>[html]<br />
&lt;div id=&#8217;jqxWidget&#8217; style=&quot;font-size: 13px; font-family: Verdana; float: left;&quot;&gt;<br />
        &lt;div id=&quot;jqxgrid&quot;&gt;<br />
        &lt;/div&gt;<br />
    &lt;/div&gt;<br />
[/html]</p>
<p>Now we will define our grid as follows. </p>
<p>[js]<br />
$(&quot;#jqxgrid&quot;).jqxGrid(<br />
            {<br />
                width: 850,<br />
                autoheight: true,<br />
                source: dataAdapter,<br />
                columns: columnsArray,<br />
                pageable: true,<br />
                sortable: true,<br />
                filterable: true<br />
            });<br />
[/js]</p>
<p>As you can see we have applied <em>dataAdapter</em> as the source, below is the definition for your data adapter. </p>
<p>[js]<br />
  var dataAdapter = new $.jqx.dataAdapter(source);<br />
[/js]</p>
<p>Now we will create the source object as follows. </p>
<p>[js]<br />
 var source =<br />
            {<br />
                datatype: &quot;json&quot;,<br />
                datafields: dataFieldsArray,<br />
                localdata: data<br />
            };<br />
[/js]</p>
<p>As the grid definition is over, we can create our data, datafields, columns. Shall we? As I said earlier, our data source is a HTML table. We are looping through the trs to create the data and ths to create the datafields and columns. </p>
<p>[js]<br />
// select rows.<br />
            var rows = $(&quot;#initialTable tbody tr&quot;);<br />
            // select columns.<br />
            var columns = $(&quot;#initialTable thead th&quot;);<br />
            var data = [];<br />
            var dataFieldsArray = [];<br />
            var columnsArray = [];<br />
            for (var i = 0; i &lt; rows.length; i++) {<br />
                var row = rows&amp;#91;i&amp;#93;;<br />
                var datarow = {};<br />
                for (var j = 0; j &lt; columns.length; j++) {<br />
                    // get column&#8217;s title.<br />
                    var columnName = $.trim($(columns&amp;#91;j&amp;#93;).text());<br />
                    // select cell.<br />
                    var cell = $(row).find(&#8216;td:eq(&#8216; + j + &#8216;)&#8217;);<br />
                    var type = &#8216;string&#8217;;<br />
                    var format = &#8221;;<br />
                    var cellsalign = &#8216;left&#8217;;<br />
                    if (!isNaN(cell.text())) {<br />
                        type = &#8216;number&#8217;;<br />
                        format = &#8216;d&#8217;;<br />
                        cellsalign = &#8216;right&#8217;;<br />
                    }<br />
                    datarow&amp;#91;columnName&amp;#93; = $.trim(cell.text());<br />
                    if (i === 0) {<br />
                        dataFieldsArray.push({ name: columnName, type: type });<br />
                        columnsArray.push({ name: columnName, dataField: columnName, cellsrenderer: cellsrenderer, cellsformat: format, cellsalign: cellsalign });<br />
                    }<br />
                }<br />
                data&amp;#91;data.length&amp;#93; = datarow;<br />
            }<br />
&amp;#91;/js&amp;#93;</p>
<p>Have you noticed that when we push the the items to the &lt;em&gt;columnsArray&lt;/em&gt; we are calling the function &lt;em&gt;cellsrenderer&lt;/em&gt;. This &lt;em&gt;cellsrenderer&lt;/em&gt; function returns the HTML with coloured data as we expected. </p>
<p>[js]<br />
 var cellsrenderer = function (row, columnfield, value, defaulthtml, columnproperties, rowdata) {<br />
                if (parseFloat(rowdata.Debits) &lt; 30) {<br />
                    return &#8216;&lt;span style=&quot;margin: 4px; float: &#8216; + columnproperties.cellsalign + &#8216;; color: #ff0000;&quot;&gt;&#8217; + value + &#8216;&lt;/span&gt;&#8217;;<br />
                } else {<br />
                    return &#8216;&lt;span style=&quot;margin: 4px; float: &#8216; + columnproperties.cellsalign + &#8216;; color: #00ff00;&quot;&gt;&#8217; + value + &#8216;&lt;/span&gt;&#8217;;<br />
                }<br />
            };<br />
[/js]</p>
<p>Here in this function we will get the needed things like row, columnfield, value, defaulthtml, columnproperties, rowdata as parameters and we checks for the condition <em>rowdata.Debits<30</em>, if it is true we will apply the colour #ff0000 or #00ff00. </p>
<p>Once the formatting is done, we are pushing the items to the arrays. Now we can see the complete code.</p>
<p><strong>Complete code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&quot;en&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;&lt;/title&gt;<br />
    &lt;script src=&quot;jquery-1.9.1.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxcore.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxbuttons.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxscrollbar.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxlistbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdropdownlist.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxmenu.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.filter.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.sort.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.selection.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.pager.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsresize.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsreorder.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdatatable.js&quot;&gt;&lt;/script&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.base.css&quot; rel=&quot;stylesheet&quot; /&gt;</p>
<p>    &lt;script type=&quot;text/javascript&quot;&gt;<br />
        $(document).ready(function () {<br />
            var cellsrenderer = function (row, columnfield, value, defaulthtml, columnproperties, rowdata) {<br />
                if (parseFloat(rowdata.Debits) &lt; 30) {<br />
                    return &#8216;&lt;span style=&quot;margin: 4px; float: &#8216; + columnproperties.cellsalign + &#8216;; color: #ff0000;&quot;&gt;&#8217; + value + &#8216;&lt;/span&gt;&#8217;;<br />
                } else {<br />
                    return &#8216;&lt;span style=&quot;margin: 4px; float: &#8216; + columnproperties.cellsalign + &#8216;; color: #00ff00;&quot;&gt;&#8217; + value + &#8216;&lt;/span&gt;&#8217;;<br />
                }<br />
            };</p>
<p>            // select rows.<br />
            var rows = $(&quot;#initialTable tbody tr&quot;);<br />
            // select columns.<br />
            var columns = $(&quot;#initialTable thead th&quot;);<br />
            var data = [];<br />
            var dataFieldsArray = [];<br />
            var columnsArray = [];<br />
            for (var i = 0; i &lt; rows.length; i++) {<br />
                var row = rows&amp;#91;i&amp;#93;;<br />
                var datarow = {};<br />
                for (var j = 0; j &lt; columns.length; j++) {<br />
                    // get column&#8217;s title.<br />
                    var columnName = $.trim($(columns&amp;#91;j&amp;#93;).text());<br />
                    // select cell.<br />
                    var cell = $(row).find(&#8216;td:eq(&#8216; + j + &#8216;)&#8217;);<br />
                    var type = &#8216;string&#8217;;<br />
                    var format = &#8221;;<br />
                    var cellsalign = &#8216;left&#8217;;<br />
                    if (!isNaN(cell.text())) {<br />
                        type = &#8216;number&#8217;;<br />
                        format = &#8216;d&#8217;;<br />
                        cellsalign = &#8216;right&#8217;;<br />
                    }<br />
                    datarow&amp;#91;columnName&amp;#93; = $.trim(cell.text());<br />
                    if (i === 0) {<br />
                        dataFieldsArray.push({ name: columnName, type: type });<br />
                        columnsArray.push({ name: columnName, dataField: columnName, cellsrenderer: cellsrenderer, cellsformat: format, cellsalign: cellsalign });<br />
                    }<br />
                }<br />
                data&amp;#91;data.length&amp;#93; = datarow;<br />
            }</p>
<p>            // prepare the data<br />
            var source =<br />
            {<br />
                datatype: &quot;json&quot;,<br />
                datafields: dataFieldsArray,<br />
                localdata: data<br />
            };<br />
            var dataAdapter = new $.jqx.dataAdapter(source);</p>
<p>            $(&quot;#jqxgrid&quot;).jqxGrid(<br />
            {<br />
                width: 850,<br />
                autoheight: true,<br />
                source: dataAdapter,<br />
                columns: columnsArray,<br />
                pageable: true,<br />
                sortable: true,<br />
                filterable: true<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body class=&#8217;default&#8217;&gt;<br />
    &lt;table id=&quot;initialTable&quot; style=&quot;width: 300px;display:none;&quot;&gt;<br />
        &lt;thead&gt;<br />
            &lt;tr&gt;<br />
                &lt;th&gt;Firstname<br />
                &lt;/th&gt;<br />
                &lt;th&gt;Lastname<br />
                &lt;/th&gt;<br />
                &lt;th&gt;Debits<br />
                &lt;/th&gt;<br />
            &lt;/tr&gt;<br />
        &lt;/thead&gt;<br />
        &lt;tbody&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Eve<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Jackson<br />
                &lt;/td&gt;<br />
                &lt;td&gt;94<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Clara<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Oswald<br />
                &lt;/td&gt;<br />
                &lt;td&gt;17<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Benedict<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Mason<br />
                &lt;/td&gt;<br />
                &lt;td&gt;33<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Eve<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Jackson<br />
                &lt;/td&gt;<br />
                &lt;td&gt;94<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Clara<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Oswald<br />
                &lt;/td&gt;<br />
                &lt;td&gt;17<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Benedict<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Mason<br />
                &lt;/td&gt;<br />
                &lt;td&gt;33<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Eve<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Jackson<br />
                &lt;/td&gt;<br />
                &lt;td&gt;94<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Clara<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Oswald<br />
                &lt;/td&gt;<br />
                &lt;td&gt;17<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Benedict<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Mason<br />
                &lt;/td&gt;<br />
                &lt;td&gt;33<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Eve<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Jackson<br />
                &lt;/td&gt;<br />
                &lt;td&gt;94<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Clara<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Oswald<br />
                &lt;/td&gt;<br />
                &lt;td&gt;17<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
            &lt;tr&gt;<br />
                &lt;td&gt;Benedict<br />
                &lt;/td&gt;<br />
                &lt;td&gt;Mason<br />
                &lt;/td&gt;<br />
                &lt;td&gt;33<br />
                &lt;/td&gt;<br />
            &lt;/tr&gt;<br />
        &lt;/tbody&gt;<br />
    &lt;/table&gt;</p>
<p>    &lt;p style=&quot;font-family: Verdana;&quot;&gt;<br />
        Dynamically apply colour coding in Grid<br />
    &lt;/p&gt;<br />
    &lt;div id=&#8217;jqxWidget&#8217; style=&quot;font-size: 13px; font-family: Verdana; float: left;&quot;&gt;<br />
        &lt;div id=&quot;jqxgrid&quot;&gt;<br />
        &lt;/div&gt;<br />
    &lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Output</strong></p>
<div id="attachment_11232" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2016/02/Dynamically-apply-colour-coding-in-Grid-e1455607915795.png"><img decoding="async" aria-describedby="caption-attachment-11232" src="http://sibeeshpassion.com/wp-content/uploads/2016/02/Dynamically-apply-colour-coding-in-Grid-e1455607915795.png" alt="Dynamically apply colour coding in Grid" width="650" height="285" class="size-full wp-image-11232" srcset="/wp-content/uploads/2016/02/Dynamically-apply-colour-coding-in-Grid-e1455607915795.png 650w, /wp-content/uploads/2016/02/Dynamically-apply-colour-coding-in-Grid-e1455607915795-300x132.png 300w, /wp-content/uploads/2016/02/Dynamically-apply-colour-coding-in-Grid-e1455607915795-400x175.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-11232" class="wp-caption-text">Dynamically apply colour coding in Grid</p></div>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/dynamically-apply-colour-coding-in-grid-with-dynamic-headers-and-data/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Remove Time Stamp Form Legend In HighChart</title>
		<link>https://sibeeshpassion.com/remove-time-stamp-form-legend-in-highchart/</link>
					<comments>https://sibeeshpassion.com/remove-time-stamp-form-legend-in-highchart/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 25 Jan 2016 06:04:08 +0000</pubDate>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[HighChart]]></category>
		<category><![CDATA[labelFormatter]]></category>
		<category><![CDATA[Remove Timestamp]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=11161</guid>

					<description><![CDATA[In this code snippet we will discuss how we can remove the time stamp from the legend in high chart. Some times it will not be good if we show the the default time stamps in the legend. So to remove the time stamp you can use the labelFormatter function. [js] labelFormatter: function () { return this.name.toString().replace(&#8216; 00:00:00.000&#8217;, &#8221;).replace(&#8216; 00:00:00.00&#8217;, &#8221;).replace(&#8216; 00:00:00&#8217;, &#8221;); } [/js] Just add that function in your legend settings will do the remaining. Happy Coding!. Please see my other posts code snippets here: Code Snippets Kindest Regards Sibeesh Venu]]></description>
										<content:encoded><![CDATA[<p>In this code snippet we will discuss how we can remove the time stamp from the legend in high chart. Some times it will not be good if we show the the default time stamps in the legend. So to remove the time stamp you can use the <em>labelFormatter </em>function. </p>
<p>[js]<br />
 labelFormatter: function () {<br />
                return this.name.toString().replace(&#8216; 00:00:00.000&#8217;, &#8221;).replace(&#8216; 00:00:00.00&#8217;, &#8221;).replace(&#8216; 00:00:00&#8217;, &#8221;);<br />
            }<br />
[/js]</p>
<p>Just add that function in your legend settings will do the remaining. Happy Coding!.</p>
<p>Please see my other posts code snippets here: <a href="http://sibeeshpassion.com/category/code-snippets/" target="_blank">Code Snippets</a></p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/remove-time-stamp-form-legend-in-highchart/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Using MVC Grid In MVC</title>
		<link>https://sibeeshpassion.com/using-mvc-grid-in-mvc/</link>
					<comments>https://sibeeshpassion.com/using-mvc-grid-in-mvc/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Fri, 11 Dec 2015 00:00:15 +0000</pubDate>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[MVC Grid]]></category>
		<category><![CDATA[CSharp]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Products]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10981</guid>

					<description><![CDATA[In this post we will see how we can develop a MVC grid in our MVC application. There are so many grids are available in the industries, most of them are useful. Here we are going to use a grid called MVC grid, which uses bootstrap and jQuery. We will create some dynamic data using list first, once it is done, we will send this data to the MVC grid. Sounds good? I hope you will like this article. Download Source Code Using MVC Grid In MVC Background I have been working with the Grid controls for a long long [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can develop a MVC grid in our <a href="http://sibeeshpassion.com/category/mvc/" target="_blank" rel="noopener">MVC </a>application. There are so many grids are available in the industries, most of them are useful. Here we are going to use a grid called MVC grid, which uses bootstrap and <a href="http://sibeeshpassion.com/category/jQuery/" target="_blank" rel="noopener">jQuery</a>. We will create some dynamic data using list first, once it is done, we will send this data to the MVC grid. Sounds good? I hope you will like this article. </p>
<p><strong>Download Source Code</strong></p>
<li><a href="https://code.msdn.microsoft.com/Using-MVC-Grid-In-MVC-4111f300" target="_blank" rel="noopener">Using MVC Grid In MVC</a></li>
<p><strong>Background</strong></p>
<p>I have been working with the Grid controls for a long long time. So far I have worked with jQX Grid, jQ Grid, jQuery Datatables, Pivot tables, KO grid etc. It is always interesting to work with some controls. I always loved it. recently I worked with MVC grid. So I thought of sharing that experience with you all. </p>
<p><strong>Create a MVC application</strong></p>
<p>First, we will start with creating an MVC application. Open your visual studio, then click File->New->Project. Name your project. </p>
<p><strong>Install MVC Grid</strong></p>
<p>The next step we are going to do is, installing the MVC grid to our project. To install, please right click your solution and click on Manage NuGet packages. </p>
<div id="attachment_10982" style="width: 469px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/11/Select_NuGet_Package.png"><img decoding="async" aria-describedby="caption-attachment-10982" src="http://sibeeshpassion.com/wp-content/uploads/2015/11/Select_NuGet_Package.png" alt="Select NuGet Package" width="459" height="673" class="size-full wp-image-10982" srcset="/wp-content/uploads/2015/11/Select_NuGet_Package.png 459w, /wp-content/uploads/2015/11/Select_NuGet_Package-205x300.png 205w, /wp-content/uploads/2015/11/Select_NuGet_Package-400x586.png 400w, /wp-content/uploads/2015/11/Select_NuGet_Package-409x600.png 409w" sizes="(max-width: 459px) 100vw, 459px" /></a><p id="caption-attachment-10982" class="wp-caption-text">Select NuGet Package</p></div>
<p>Now you can see a new window, please search for MVC grid in the search box. And then click Install. </p>
<div id="attachment_10983" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/11/Install_MVC_Grid_To_Project-e1448285055873.png"><img decoding="async" aria-describedby="caption-attachment-10983" src="http://sibeeshpassion.com/wp-content/uploads/2015/11/Install_MVC_Grid_To_Project-e1448285055873.png" alt="Install_MVC_Grid_To_Project" width="650" height="433" class="size-full wp-image-10983" srcset="/wp-content/uploads/2015/11/Install_MVC_Grid_To_Project-e1448285055873.png 650w, /wp-content/uploads/2015/11/Install_MVC_Grid_To_Project-e1448285055873-300x200.png 300w, /wp-content/uploads/2015/11/Install_MVC_Grid_To_Project-e1448285055873-400x266.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10983" class="wp-caption-text">Install_MVC_Grid_To_Project</p></div>
<p>Once you installed, you can see there is a new reference file has been added(GridMVC), you can also notice that two views are created (_Grig.cshtml,_GridPager.cshtml) and one CSS file and some scripts. Now we will move to our next step.</p>
<p><strong>Dependencies </strong></p>
<p>As I said before, MVC grid uses bootstrap for design. So the next thing we need to is to install bootstrap in our project. For that, go to NuGet packages again and search for bootstrap.</p>
<div id="attachment_10984" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/11/Install_Bootstrap_To_Project-e1448285364634.png"><img decoding="async" aria-describedby="caption-attachment-10984" src="http://sibeeshpassion.com/wp-content/uploads/2015/11/Install_Bootstrap_To_Project-e1448285364634.png" alt="Install_Bootstrap_To_Project" width="650" height="433" class="size-full wp-image-10984" srcset="/wp-content/uploads/2015/11/Install_Bootstrap_To_Project-e1448285364634.png 650w, /wp-content/uploads/2015/11/Install_Bootstrap_To_Project-e1448285364634-300x200.png 300w, /wp-content/uploads/2015/11/Install_Bootstrap_To_Project-e1448285364634-400x266.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10984" class="wp-caption-text">Install_Bootstrap_To_Project</p></div>
<p>You can see some new CSS files and scripts has been added to our project. So the set up has been done. Now what we need to do is to move on the coding part. </p>
<p><strong>Create a controller </strong></p>
<p>Now we can create a new controller, in my case I created a controller &#8216;HomeController&#8217;. In my controller I am going to call a model action which will return some dynamic data. See the code below. </p>
<p>[csharp]<br />
public class HomeController : Controller<br />
    {<br />
        //<br />
        // GET: /Home/</p>
<p>        public ActionResult Index()<br />
        {<br />
            Test t = new Test();<br />
            var myList= t.GetData();<br />
            return View(myList);<br />
        }</p>
<p>    }<br />
[/csharp]</p>
<p>As you can see I am creating an instance of my model Test, now we will create our model class. Shall we?</p>
<p><strong>Create Model </strong></p>
<p>I have create a model class with the name Test. Here I am creating some data dynamically using a for loop and assign those values to a list. Please see the codes below. </p>
<p>[csharp]<br />
namespace AsyncActions.Models<br />
{<br />
    public class Test<br />
    {<br />
        public List&lt;Customer&gt; GetData()<br />
        {<br />
            try<br />
            {<br />
                List&lt;Customer&gt; cst = new List&lt;Customer&gt;();<br />
                for (int i = 0; i &lt; 100; i++)<br />
                {<br />
                    Customer c = new Customer();<br />
                    c.CustomerID = i;<br />
                    c.CustomerCode = &quot;CST&quot; + i;<br />
                    cst.Add(c);<br />
                }<br />
                return cst;<br />
            }<br />
            catch (Exception)<br />
            {<br />
                throw new NotImplementedException();<br />
            }</p>
<p>        }<br />
    }<br />
    public class Customer<br />
    {<br />
        public int CustomerID { get; set; }<br />
        public string CustomerCode { get; set; }<br />
    }<br />
}<br />
[/csharp]</p>
<p>As you can see I am creating a list of type Customer. Is that fine? Now what is pending? Yes, a view.</p>
<p><strong>Create a strongly typed view</strong></p>
<p>Now we are going to create a strongly typed view. </p>
<div id="attachment_10985" style="width: 519px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/11/Create_Strongly_Typed_View.png"><img decoding="async" aria-describedby="caption-attachment-10985" src="http://sibeeshpassion.com/wp-content/uploads/2015/11/Create_Strongly_Typed_View.png" alt="Create_Strongly_Typed_View" width="509" height="502" class="size-full wp-image-10985" srcset="/wp-content/uploads/2015/11/Create_Strongly_Typed_View.png 509w, /wp-content/uploads/2015/11/Create_Strongly_Typed_View-300x296.png 300w, /wp-content/uploads/2015/11/Create_Strongly_Typed_View-400x394.png 400w" sizes="(max-width: 509px) 100vw, 509px" /></a><p id="caption-attachment-10985" class="wp-caption-text">Create_Strongly_Typed_View</p></div>
<blockquote><p>When you create a view as strongly typed view, your view header will be as follows. @model List<AsyncActions.Models.Customer></p></blockquote>
<p>So our view is ready, now we can do some codes in our view to populate our grid. Are you ready? First thing is you need to include the needed references to our view, you can do this in the file called Layout.cshtml. Here I am going to add those references directly to the view.</p>
<p>[html]<br />
&lt;link href=&quot;~/Content/bootstrap-theme.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
&lt;link href=&quot;~/Content/bootstrap.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
&lt;script src=&quot;~/Scripts/jquery-2.1.3.min.js&quot;&gt;&lt;/script&gt;<br />
&lt;link href=&quot;~/Content/Gridmvc.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
&lt;script src=&quot;~/Scripts/gridmvc.min.js&quot;&gt;&lt;/script&gt;<br />
[/html]</p>
<p><strong>Add the grid namespace</strong></p>
<p>You can add the grid namespace as follows.</p>
<p>[html]<br />
@using GridMvc.Html<br />
[/html]</p>
<p>Next thing is to add grid implementation.</p>
<p><strong>MVC Grid Implementation</strong></p>
<p>To add a MVC grid as our requirement, you need to add the codes as below. </p>
<p>[csharp]<br />
@Html.Grid(Model).Columns(columns =&gt;<br />
           {<br />
               columns.Add(foo =&gt; foo.CustomerID).Titled(&quot;Customer ID&quot;).SetWidth(50).Sortable(true).Filterable(true);<br />
               columns.Add(foo =&gt; foo.CustomerCode).Titled(&quot;Customer Code&quot;).SetWidth(50).Sortable(true).Filterable(true);<br />
           }).WithPaging(20)</p>
<p>[/csharp]</p>
<p>As you can see we are using the columns Customer.CustomerID and Customer.CustomerCode. </p>
<p><strong>Output</strong></p>
<div id="attachment_10986" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/11/MVC_Grid_With_Dynamic_Data.png"><img decoding="async" aria-describedby="caption-attachment-10986" src="http://sibeeshpassion.com/wp-content/uploads/2015/11/MVC_Grid_With_Dynamic_Data-1024x518.png" alt="MVC_Grid_With_Dynamic_Data" width="634" height="321" class="size-large wp-image-10986" srcset="/wp-content/uploads/2015/11/MVC_Grid_With_Dynamic_Data-1024x518.png 1024w, /wp-content/uploads/2015/11/MVC_Grid_With_Dynamic_Data-300x152.png 300w, /wp-content/uploads/2015/11/MVC_Grid_With_Dynamic_Data-768x389.png 768w, /wp-content/uploads/2015/11/MVC_Grid_With_Dynamic_Data-400x203.png 400w, /wp-content/uploads/2015/11/MVC_Grid_With_Dynamic_Data-1185x600.png 1185w, /wp-content/uploads/2015/11/MVC_Grid_With_Dynamic_Data.png 1918w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-10986" class="wp-caption-text">MVC_Grid_With_Dynamic_Data</p></div>
<p><strong>Add more Grid features</strong></p>
<p><em>To set the paging </em> we can use the option <em>WithPaging(20)</em>.<br />
<em>To add title</em> we can use <em>Titled</em> property.<br />
<em>To set width</em> we can use <em>SetWidth</em> property.<br />
<em>To set sort</em> we can use <em>Sortable</em> property.<br />
<em>To set filter</em> we can use <em>Filterable</em> property.</p>
<p>You can always see the additional options <a href="https://gridmvc.codeplex.com/documentation" target="_blank" rel="noopener">here </a>.</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/using-mvc-grid-in-mvc/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>a href Columns In Grid</title>
		<link>https://sibeeshpassion.com/a-href-columns-in-grid/</link>
					<comments>https://sibeeshpassion.com/a-href-columns-in-grid/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 11 Nov 2015 14:18:54 +0000</pubDate>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JQWidgets]]></category>
		<category><![CDATA[JQX Grid]]></category>
		<category><![CDATA[Json]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[a href Columns In Grid]]></category>
		<category><![CDATA[cellsrenderer]]></category>
		<category><![CDATA[JQXGrid]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10959</guid>

					<description><![CDATA[In this post we will how we can customize a column in jQWidget jQX Grid. We will make one of the columns values to a hreaf tag. First we will load the grid from the a custom json data and then we will use cellsrenderer function to format the columns values. I hope you will like this. Background We all works in grid controls. Sometimes you may need to customize the grid and its column values. Here I am giving you custom demo of the same. In this article we are going to customize the grid column contents to a [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will how we can customize a column in <a href="http://sibeeshpassion.com/category/jqwidgets/" target="_blank">jQWidget</a> jQX Grid. We will make one of the columns values to a hreaf tag. First we will load the grid from the a custom json data and then we will use cellsrenderer function to format the columns values. I hope you will like this. </p>
<p><strong>Background</strong></p>
<p>We all works in grid controls. Sometimes you may need to customize the grid and its column values. Here I am giving you custom demo of the same. In this article we are going to customize the grid column contents to a href tags.</p>
<p><strong>Using the code</strong></p>
<p>To show this demo, I am using jQWidget jQX Grid control. If you are new to jQX Grid, you can find out some introduction here: <a href="http://sibeeshpassion.com/category/products/jqwidgets/" target="_blank">jQWidget JQX Grid</a></p>
<p>Now we are going to load the grid first. I hope you have already checked how to load the grid. Please see the below code. </p>
<p><em>Create an HTML page</em></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&quot;en&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Href Columns In Grid &#8211; Sibeesh Passion&lt;/title&gt;<br />
   &lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;h3&gt;Href Columns In Grid &#8211; Sibeesh Passion&lt;/h3&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&quot;jqxgrid&quot;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p><em>Add the needed references</em></p>
<p>[html]<br />
 &lt;script src=&quot;jquery-1.9.1.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxcore.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxbuttons.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxscrollbar.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxlistbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdropdownlist.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxmenu.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.filter.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.sort.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.selection.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.pager.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsresize.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsreorder.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdatatable.js&quot;&gt;&lt;/script&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.base.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
[/html]</p>
<p>Here comes the main part.</p>
<p><strong>Grid Settings or Grid Initialization</strong></p>
<p>[js]<br />
&lt;script type=&quot;text/javascript&quot;&gt;<br />
        $(document).ready(function () {<br />
            var columntohref = function (row, column, value) {<br />
                if (value.indexOf(&#8216;#&#8217;) != -1) {<br />
                    value = value.substring(0, value.indexOf(&#8216;#&#8217;));<br />
                }<br />
                var format = { target: &#8216;&quot;_blank&quot;&#8217; };<br />
                var html = $.jqx.dataFormat.formatlink(value, format);<br />
                return html;<br />
            }<br />
            var data =<br />
            {<br />
                datatype: &quot;json&quot;,<br />
                datafields: [{ &quot;name&quot;: &quot;LinkName&quot;, &quot;type&quot;: &quot;string&quot; }, { &quot;name&quot;: &quot;Link&quot;, &quot;type&quot;: &quot;string&quot; }],<br />
                url: &quot;CustomData.txt&quot;<br />
            };<br />
            $(&quot;#jqxgrid&quot;).jqxGrid(<br />
                  {<br />
                      source: data,<br />
                      columns: [{ &quot;text&quot;: &quot;LinkName&quot;, &quot;dataField&quot;: &quot;LinkName&quot;, width: &quot;300&quot; }, { &quot;text&quot;: &quot;Link&quot;, &quot;dataField&quot;: &quot;Link&quot;, cellsrenderer: columntohref, width: &quot;300&quot; }]<br />
                  });<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p><strong>Sample data</strong></p>
<p>Following is the contents of <em>CustomData.txt</em></p>
<p>[js]<br />
[{&quot;LinkName&quot;:&quot;Sibeesh Passion&quot;,&quot;Link&quot;:&quot;http://www.sibeeshpassion.com&quot;},{&quot;LinkName&quot;:&quot;C-Sharp Corner&quot;,&quot;Link&quot;:&quot;http://www.c-sharpcorner.com&quot;},{&quot;LinkName&quot;:&quot;Facebook&quot;,&quot;Link&quot;:&quot;http://www.fb.com&quot;},{&quot;LinkName&quot;:&quot;Google&quot;,&quot;Link&quot;:&quot;http://www.google.com&quot;}]<br />
[/js]</p>
<p>As you can find out in the above code we are using cellsrenderer property to call the function <em>columntohref</em> which does the formatting. We are formatting the data as below ,</p>
<p>[js]<br />
$.jqx.dataFormat.formatlink(value, format)<br />
[/js]</p>
<p>Shall we check our output now? </p>
<p><strong>Output</strong></p>
<div id="attachment_10960" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/11/href_columns_in_grid-e1447251398918.png"><img decoding="async" aria-describedby="caption-attachment-10960" src="http://sibeeshpassion.com/wp-content/uploads/2015/11/href_columns_in_grid-e1447251398918.png" alt="Column values to a href" width="650" height="497" class="size-full wp-image-10960" srcset="/wp-content/uploads/2015/11/href_columns_in_grid-e1447251398918.png 650w, /wp-content/uploads/2015/11/href_columns_in_grid-e1447251398918-300x229.png 300w, /wp-content/uploads/2015/11/href_columns_in_grid-e1447251398918-400x306.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10960" class="wp-caption-text">Column values to a href</p></div>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&quot;en&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Href Columns In Grid &#8211; Sibeesh Passion&lt;/title&gt;<br />
    &lt;script src=&quot;jquery-1.9.1.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxcore.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxbuttons.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxscrollbar.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxlistbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdropdownlist.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxmenu.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.filter.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.sort.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.selection.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.pager.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsresize.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsreorder.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdatatable.js&quot;&gt;&lt;/script&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.base.css&quot; rel=&quot;stylesheet&quot; /&gt;</p>
<p>    &lt;script type=&quot;text/javascript&quot;&gt;<br />
        $(document).ready(function () {<br />
            var columntohref = function (row, column, value) {<br />
                if (value.indexOf(&#8216;#&#8217;) != -1) {<br />
                    value = value.substring(0, value.indexOf(&#8216;#&#8217;));<br />
                }<br />
                var format = { target: &#8216;&quot;_blank&quot;&#8217; };<br />
                var html = $.jqx.dataFormat.formatlink(value, format);<br />
                return html;<br />
            }<br />
            var data =<br />
            {<br />
                datatype: &quot;json&quot;,<br />
                datafields: [{ &quot;name&quot;: &quot;LinkName&quot;, &quot;type&quot;: &quot;string&quot; }, { &quot;name&quot;: &quot;Link&quot;, &quot;type&quot;: &quot;string&quot; }],<br />
                url: &quot;CustomData.txt&quot;<br />
            };<br />
            $(&quot;#jqxgrid&quot;).jqxGrid(<br />
                  {<br />
                      source: data,<br />
                      columns: [{ &quot;text&quot;: &quot;LinkName&quot;, &quot;dataField&quot;: &quot;LinkName&quot;, width: &quot;300&quot; }, { &quot;text&quot;: &quot;Link&quot;, &quot;dataField&quot;: &quot;Link&quot;, cellsrenderer: columntohref, width: &quot;300&quot; }]<br />
                  });<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body class=&#8217;default&#8217;&gt;<br />
    &lt;h2&gt;Href Columns In Grid &#8211; Sibeesh Passion&lt;/h2&gt;<br />
    &lt;div id=&quot;jqxgrid&quot;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/a-href-columns-in-grid/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Load Data To Grid On Sroll</title>
		<link>https://sibeeshpassion.com/load-data-to-grid-on-sroll/</link>
					<comments>https://sibeeshpassion.com/load-data-to-grid-on-sroll/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 02 Nov 2015 06:09:36 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[JQWidgets]]></category>
		<category><![CDATA[JQX Grid]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[jQWidget]]></category>
		<category><![CDATA[Load data dynamically]]></category>
		<category><![CDATA[Load Data To Grid On Sroll]]></category>
		<category><![CDATA[rendergridrows]]></category>
		<category><![CDATA[virtualmode]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10886</guid>

					<description><![CDATA[In this post we will discuss about how we can load data to a grid on scroll event. As you all know Grid is a main control in every dashboard. Every company uses a grid control for showing reports or any kind of data. Hence it is widely used, it is important that the grid must be loaded faster. So the performance of the grid control matters a lot. Isn&#8217;t it? Here in this post we are going to do a task which will increase the performance of the grid since we are going to load the data as per [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will discuss about how we can load data to a grid on scroll event. As you all know Grid is a main control in every dashboard. Every company uses a grid control for showing reports or any kind of data. Hence it is widely used, it is important that the grid must be loaded faster. So the performance of the grid control matters a lot. Isn&#8217;t it? Here in this post we are going to do a task which will increase the performance of the grid since we are going to load the data as per user request (on scrolling down). Sounds cool?. Normally what we do is, we will load all the data to the grid in a head shot, the problem in this manner is, it will take ages to load the full data to grid. Hence the user will close your application and the won&#8217;t return back. That is sad thing right? So we will concentrate on the performance part now. I hope you will like this. </p>
<p><strong>Background</strong></p>
<p>I am working in a dashboard application. So for me performance was the main criteria to take care. We have used server side paging to improve the performance. This I will share in my next article. Now we will try to load a client side data on demand. Let us say when ever user scroll down. Sounds fine? Ok let us start then.</p>
<p><strong>Using the code</strong></p>
<p>To show this demo, I am using jQWidget jQX Grid control. If you are new to jQX Grid, you can find out some introduction here: <a href="http://sibeeshpassion.com/category/products/jqwidgets/" target="_blank">jQWidget JQX Grid</a></p>
<p>Now we are going to load the grid first. I hope you have already checked how to load the grid. Please see the below code. </p>
<p><em>Create an HTML page</em></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&quot;en&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Load Data To Grid On Scroll  &#8211; Sibeesh Passion&lt;/title&gt;<br />
   &lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;h3&gt;Load Data To Grid On Scroll  &#8211; Sibeesh Passion&lt;/h3&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&quot;jqxgrid&quot;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p><em>Add the needed references</em></p>
<p>[html]<br />
 &lt;script src=&quot;jquery-1.9.1.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxcore.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxbuttons.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxscrollbar.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxlistbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdropdownlist.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxmenu.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.filter.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.sort.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.selection.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.pager.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsresize.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsreorder.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdatatable.js&quot;&gt;&lt;/script&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.base.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
[/html]</p>
<p>Here comes the main part.</p>
<p><strong>Grid Settings or Grid Initialization</strong></p>
<p>[js]<br />
&lt;script type=&quot;text/javascript&quot;&gt;<br />
         $(document).ready(function () {<br />
             // prepare the data<br />
             var data = new Array();<br />
             var firstNames =<br />
             [<br />
                 &quot;Sibeesh&quot;, &quot;Ajay&quot;, &quot;Ansary&quot;, &quot;Aghil&quot;, &quot;Shanto&quot;, &quot;Libin&quot;, &quot;Vignesh&quot;, &quot;Ramesh&quot;, &quot;Sathian&quot;, &quot;Elango&quot;, &quot;karthik&quot;<br />
             ];</p>
<p>             var lastNames =<br />
             [<br />
                 &quot;Venu&quot;, &quot;Bhasy&quot;, &quot;Rasheed&quot;, &quot;Ghosh&quot;, &quot;Thomas&quot;, &quot;Lawrence&quot;, &quot;Vicky&quot;, &quot;K&quot;, &quot;K&quot;, &quot;S&quot;, &quot;Srinivasan&quot;<br />
             ];</p>
<p>             var productNames =<br />
             [<br />
                 &quot;Shoe&quot;, &quot;Sandals&quot;, &quot;Shampoo&quot;, &quot;Soap&quot;, &quot;Hair Lotion&quot;, &quot;Creams&quot;, &quot;Bags&quot;, &quot;Watch&quot;, &quot;Books&quot;, &quot;Mobile&quot;, &quot;Tab&quot;, &quot;Laptop&quot;<br />
             ];</p>
<p>             var priceValues =<br />
             [<br />
                 &quot;2.25&quot;, &quot;1.5&quot;, &quot;3.0&quot;, &quot;3.3&quot;, &quot;4.5&quot;, &quot;3.6&quot;, &quot;3.8&quot;, &quot;2.5&quot;, &quot;5.0&quot;, &quot;20.75&quot;, &quot;13.25&quot;, &quot;124.0&quot;<br />
             ];</p>
<p>             // generate sample data.<br />
             var generatedata = function (startindex, endindex) {<br />
                 var data = {};<br />
                 for (var i = startindex; i &lt; endindex; i++) {<br />
                     var row = {};<br />
                     var productindex = Math.floor(Math.random() * productNames.length);<br />
                     var price = parseFloat(priceValues[productindex]);<br />
                     var quantity = 1 + Math.round(Math.random() * 10);</p>
<p>                     row[&quot;id&quot;] = i;<br />
                     row[&quot;firstname&quot;] = firstNames[Math.floor(Math.random() * firstNames.length)];<br />
                     row[&quot;lastname&quot;] = lastNames[Math.floor(Math.random() * lastNames.length)];<br />
                     row[&quot;productname&quot;] = productNames[productindex];<br />
                     row[&quot;price&quot;] = price;<br />
                     row[&quot;quantity&quot;] = quantity;<br />
                     row[&quot;total&quot;] = price * quantity;</p>
<p>                     data[i] = row;<br />
                 }<br />
                 return data;<br />
             }</p>
<p>             var source =<br />
             {<br />
                 datatype: &quot;array&quot;,<br />
                 localdata: {},<br />
                 totalrecords: 1000000<br />
             };</p>
<p>             // load virtual data.<br />
             var rendergridrows = function (params) {<br />
                 var data = generatedata(params.startindex, params.endindex);<br />
                 return data;<br />
             }<br />
             var dataAdapter = new $.jqx.dataAdapter(source);</p>
<p>             $(&quot;#jqxgrid&quot;).jqxGrid(<br />
             {<br />
                 width: 850,<br />
                 source: dataAdapter,<br />
                 virtualmode: true,<br />
                 rendergridrows: rendergridrows,<br />
                 columns: [<br />
                     { text: &#8216;Id&#8217;, datafield: &#8216;id&#8217;, width: 100 },<br />
                     { text: &#8216;First Name&#8217;, datafield: &#8216;firstname&#8217;, width: 120 },<br />
                     { text: &#8216;Last Name&#8217;, datafield: &#8216;lastname&#8217;, width: 120 },<br />
                     { text: &#8216;Product&#8217;, datafield: &#8216;productname&#8217;, width: 180 },<br />
                     { text: &#8216;Quantity&#8217;, datafield: &#8216;quantity&#8217;, width: 80, cellsalign: &#8216;right&#8217; },<br />
                     { text: &#8216;Unit Price&#8217;, datafield: &#8216;price&#8217;, width: 90, cellsalign: &#8216;right&#8217;, cellsformat: &#8216;c2&#8217; },<br />
                     { text: &#8216;Total&#8217;, datafield: &#8216;total&#8217;, cellsalign: &#8216;right&#8217;, cellsformat: &#8216;c2&#8217; }<br />
                 ]<br />
             });<br />
         });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>As you can find out in the above code we are generating the data dynamically using a <a href="http://sibeeshpassion.com/function-declaration-and-function-expression/" target="_blank">function declaration</a> <em>generatedata</em>. </p>
<p>Have you noticed that in the grid settings we have given <em>virtualmode: true</em>. This is very important. This property is meant to be used for handling the dynamic data in grid. </p>
<p>And another property you must be aware of is <em>rendergridrows: rendergridrows</em>. This means, we are rendering the grid data on demand. Like when user change the pager or scroll. So we are going to call our <em>generatedata</em> function in the <em>rendergridrows</em>. We are passing the start index and end index to the function, so that the dynamic data won&#8217;t be repeated.</p>
<p>[js]<br />
var rendergridrows = function (params) {<br />
                 var data = generatedata(params.startindex, params.endindex);<br />
                 return data;<br />
             }<br />
[/js]</p>
<p>Once the data is ready, we will pass it to the source object and source object to dataAdapter and finally dataAdapter to grid.</p>
<p>Shall we check our output now? </p>
<p><strong>Output</strong></p>
<div id="attachment_10887" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll-e1446444313182.png"><img decoding="async" aria-describedby="caption-attachment-10887" src="http://sibeeshpassion.com/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll-e1446444313182.png" alt="Load Data On Scroll" width="650" height="369" class="size-full wp-image-10887" srcset="/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll-e1446444313182.png 650w, /wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll-e1446444313182-300x170.png 300w, /wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll-e1446444313182-400x227.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10887" class="wp-caption-text">Load Data On Scroll</p></div>
<div id="attachment_10888" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll_1-e1446444357826.png"><img decoding="async" aria-describedby="caption-attachment-10888" src="http://sibeeshpassion.com/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll_1-e1446444357826.png" alt="Load Data On Scroll" width="650" height="359" class="size-full wp-image-10888" srcset="/wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll_1-e1446444357826.png 650w, /wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll_1-e1446444357826-300x166.png 300w, /wp-content/uploads/2015/11/Load_Data_In_Grid_On_Scroll_1-e1446444357826-400x221.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10888" class="wp-caption-text">Load Data On Scroll</p></div>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&quot;en&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Load Data To Grid On Scroll  &#8211; Sibeesh Passion&lt;/title&gt;<br />
    &lt;script src=&quot;jquery-1.9.1.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxcore.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxbuttons.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxscrollbar.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxlistbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdropdownlist.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxmenu.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.filter.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.sort.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.selection.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.pager.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsresize.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.columnsreorder.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.export.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdatatable.js&quot;&gt;&lt;/script&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.base.css&quot; rel=&quot;stylesheet&quot; /&gt;</p>
<p>     &lt;script type=&quot;text/javascript&quot;&gt;<br />
         $(document).ready(function () {<br />
             // prepare the data<br />
             var data = new Array();<br />
             var firstNames =<br />
             [<br />
                 &quot;Sibeesh&quot;, &quot;Ajay&quot;, &quot;Ansary&quot;, &quot;Aghil&quot;, &quot;Shanto&quot;, &quot;Libin&quot;, &quot;Vignesh&quot;, &quot;Ramesh&quot;, &quot;Sathian&quot;, &quot;Elango&quot;, &quot;karthik&quot;<br />
             ];</p>
<p>             var lastNames =<br />
             [<br />
                 &quot;Venu&quot;, &quot;Bhasy&quot;, &quot;Rasheed&quot;, &quot;Ghosh&quot;, &quot;Thomas&quot;, &quot;Lawrence&quot;, &quot;Vicky&quot;, &quot;K&quot;, &quot;K&quot;, &quot;S&quot;, &quot;Srinivasan&quot;<br />
             ];</p>
<p>             var productNames =<br />
             [<br />
                 &quot;Shoe&quot;, &quot;Sandals&quot;, &quot;Shampoo&quot;, &quot;Soap&quot;, &quot;Hair Lotion&quot;, &quot;Creams&quot;, &quot;Bags&quot;, &quot;Watch&quot;, &quot;Books&quot;, &quot;Mobile&quot;, &quot;Tab&quot;, &quot;Laptop&quot;<br />
             ];</p>
<p>             var priceValues =<br />
             [<br />
                 &quot;2.25&quot;, &quot;1.5&quot;, &quot;3.0&quot;, &quot;3.3&quot;, &quot;4.5&quot;, &quot;3.6&quot;, &quot;3.8&quot;, &quot;2.5&quot;, &quot;5.0&quot;, &quot;20.75&quot;, &quot;13.25&quot;, &quot;124.0&quot;<br />
             ];</p>
<p>             var generatedata = function (startindex, endindex) {<br />
                 var data = {};<br />
                 for (var i = startindex; i &lt; endindex; i++) {<br />
                     var row = {};<br />
                     var productindex = Math.floor(Math.random() * productNames.length);<br />
                     var price = parseFloat(priceValues[productindex]);<br />
                     var quantity = 1 + Math.round(Math.random() * 10);</p>
<p>                     row[&quot;id&quot;] = i;<br />
                     row[&quot;firstname&quot;] = firstNames[Math.floor(Math.random() * firstNames.length)];<br />
                     row[&quot;lastname&quot;] = lastNames[Math.floor(Math.random() * lastNames.length)];<br />
                     row[&quot;productname&quot;] = productNames[productindex];<br />
                     row[&quot;price&quot;] = price;<br />
                     row[&quot;quantity&quot;] = quantity;<br />
                     row[&quot;total&quot;] = price * quantity;</p>
<p>                     data[i] = row;<br />
                 }<br />
                 return data;<br />
             }</p>
<p>             var source =<br />
             {<br />
                 datatype: &quot;array&quot;,<br />
                 localdata: {},<br />
                 totalrecords: 1000000<br />
             };</p>
<p>             // load virtual data.<br />
             var rendergridrows = function (params) {<br />
                 var data = generatedata(params.startindex, params.endindex);<br />
                 return data;<br />
             }<br />
             var dataAdapter = new $.jqx.dataAdapter(source);</p>
<p>             $(&quot;#jqxgrid&quot;).jqxGrid(<br />
             {<br />
                 width: 850,<br />
                 source: dataAdapter,<br />
                 virtualmode: true,<br />
                 rendergridrows: rendergridrows,<br />
                 columns: [<br />
                     { text: &#8216;Id&#8217;, datafield: &#8216;id&#8217;, width: 100 },<br />
                     { text: &#8216;First Name&#8217;, datafield: &#8216;firstname&#8217;, width: 120 },<br />
                     { text: &#8216;Last Name&#8217;, datafield: &#8216;lastname&#8217;, width: 120 },<br />
                     { text: &#8216;Product&#8217;, datafield: &#8216;productname&#8217;, width: 180 },<br />
                     { text: &#8216;Quantity&#8217;, datafield: &#8216;quantity&#8217;, width: 80, cellsalign: &#8216;right&#8217; },<br />
                     { text: &#8216;Unit Price&#8217;, datafield: &#8216;price&#8217;, width: 90, cellsalign: &#8216;right&#8217;, cellsformat: &#8216;c2&#8217; },<br />
                     { text: &#8216;Total&#8217;, datafield: &#8216;total&#8217;, cellsalign: &#8216;right&#8217;, cellsformat: &#8216;c2&#8217; }<br />
                 ]<br />
             });<br />
         });<br />
    &lt;/script&gt;</p>
<p>&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;h3&gt;Load Data To Grid On Scroll  &#8211; Sibeesh Passion&lt;/h3&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&quot;jqxgrid&quot;&gt;&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/load-data-to-grid-on-sroll/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Change Themes Dynamically In Grid</title>
		<link>https://sibeeshpassion.com/change-themes-dynamically-in-grid/</link>
					<comments>https://sibeeshpassion.com/change-themes-dynamically-in-grid/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 28 Oct 2015 13:40:51 +0000</pubDate>
				<category><![CDATA[JQWidgets]]></category>
		<category><![CDATA[JQX Grid]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[Apply Themes In Grid]]></category>
		<category><![CDATA[Change Themes Dynamically]]></category>
		<category><![CDATA[Disable The Stylesheets]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10855</guid>

					<description><![CDATA[In this post we will see how we can Change Themes Dynamically In Grid . I recently came across a situation to change the grid&#8217;s theme dynamically, when ever user select any theme. So I have done this requirement by using some in-built functionalities of jQWidget JQX grid. Here I am going to share you that. I hope you will like it. To load a grid from a JSON, you can follows the steps as discussed in this article: Load jQWidget JQX Grid From JSON Background If you are new to JQWidget JQX Grid, Please find out here: http://sibeeshpassion.com/category/jqwidgets/ Download [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can Change Themes Dynamically In Grid . I recently came across a situation to change the grid&#8217;s theme dynamically, when ever user select any theme. So I have done this requirement by using some in-built functionalities of jQWidget JQX grid. Here I am going to share you that. I hope you will like it.</p>
<p>To load a grid from a JSON, you can follows the steps as discussed in this article: <a href="http://sibeeshpassion.com/bind-json-data-to-jqwidget-jqx-grid/">Load jQWidget JQX Grid From JSON</a></p>
<p><strong>Background</strong></p>
<p>If you are new to JQWidget JQX Grid, Please find out here: <a href="http://sibeeshpassion.com/category/jqwidgets/" target="_blank">http://sibeeshpassion.com/category/jqwidgets/</a></p>
<p><strong>Download the Source Code</strong></p>
<p>Please download the source code from here: <a href="http://sibeeshpassion.com/download/changetheme.rar" target="_blank">Change Themes Dynamically</a></p>
<p><strong>Using the code</strong></p>
<p>I hope you have implemented your grid as shown in that article. Now I guess your page will be looking like this.</p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&quot;en&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Change Themes Dynamically In Grid &#8211; Sibeesh Passion&lt;/title&gt;<br />
   &lt;script src=&quot;jquery-1.9.1.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxcore.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxbuttons.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxscrollbar.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxlistbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdropdownlist.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxmenu.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.selection.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdatatable.js&quot;&gt;&lt;/script&gt;</p>
<p>    &lt;script type=&quot;text/javascript&quot;&gt;<br />
        $(document).ready(function () {<br />
            // prepare the data<br />
            var data =<br />
            {<br />
                datatype: &quot;json&quot;,<br />
                datafields: [{ &quot;name&quot;: &quot;AreaCode&quot;, &quot;type&quot;: &quot;string&quot; }, { &quot;name&quot;: &quot;Revenue&quot;, &quot;type&quot;: &quot;number&quot; }],<br />
                url: &quot;jsonData.txt&quot;<br />
            };<br />
            $(&quot;#jqxgrid&quot;).jqxGrid(<br />
                  {<br />
                      source: data,<br />
                      columns: [{ &quot;text&quot;: &quot;Area Code&quot;, &quot;dataField&quot;: &quot;AreaCode&quot;, &quot;cellsalign&quot;: &quot;left&quot;, &quot;cellsformat&quot;: &quot;d&quot; }, { &quot;text&quot;: &quot;Revenue&quot;, &quot;dataField&quot;: &quot;Revenue&quot;, &quot;cellsalign&quot;: &quot;right&quot;, &quot;cellsformat&quot;: &quot;c2&quot; }],<br />
                  });<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;h3&gt;Change Themes Dynamically In Grid &#8211; Sibeesh Passion&lt;/h3&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&#8217;jqxWidget&#8217; style=&quot;float: left; width: 99.9%;&quot;&gt;<br />
        &lt;div id=&quot;jqxgrid&quot;&gt;&lt;/div&gt;<br />
    &lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p>Now let us make sure that grid is working fine. Please run your project. </p>
<div id="attachment_10856" style="width: 620px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid.png"><img decoding="async" aria-describedby="caption-attachment-10856" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid.png" alt="Change Themes Dynamically In Grid " width="610" height="470" class="size-full wp-image-10856" srcset="/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid.png 610w, /wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid-300x231.png 300w, /wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid-400x308.png 400w" sizes="(max-width: 610px) 100vw, 610px" /></a><p id="caption-attachment-10856" class="wp-caption-text">Change Themes Dynamically In Grid</p></div>
<p>Cool, so grid is loaded. Now need to add a select control in which we are going to load theme names so that user can select the theme and apply. Is that fine?</p>
<p>[html]<br />
  &lt;select id=&quot;selectOptions&quot; onchange=&quot;applyNewCSS()&quot;&gt;<br />
        &lt;option value=&quot;0&quot;&gt;Select Template&lt;/option&gt;<br />
        &lt;option value=&quot;metro&quot;&gt;metro&lt;/option&gt;<br />
        &lt;option value=&quot;office&quot;&gt;office&lt;/option&gt;<br />
        &lt;option value=&quot;orange&quot;&gt;orange&lt;/option&gt;<br />
        &lt;option value=&quot;energyblue&quot;&gt;energyblue&lt;/option&gt;<br />
        &lt;option value=&quot;darkblue&quot;&gt;darkblue&lt;/option&gt;<br />
        &lt;option value=&quot;shinyblack&quot;&gt;shinyblack&lt;/option&gt;<br />
        &lt;option value=&quot;lightness&quot; selected=&quot;selected&quot;&gt;lightness&lt;/option&gt;<br />
        &lt;option value=&quot;android&quot;&gt;android&lt;/option&gt;<br />
    &lt;/select&gt;<br />
[/html]</p>
<p>The next thing is we need to add the CSS links to the page, here I am going to add some of the CSS references as follows.</p>
<p>[html]<br />
&lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.darkblue.css&quot; rel=&quot;stylesheet&quot; title=&quot;darkblue&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.energyblue.css&quot; rel=&quot;stylesheet&quot; title=&quot;energyblue&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.metro.css&quot; rel=&quot;stylesheet&quot; title=&quot;metro&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.metrodark.css&quot; rel=&quot;stylesheet&quot; title=&quot;metrodark&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.office.css&quot; rel=&quot;stylesheet&quot; title=&quot;office&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.ui-darkness.css&quot; rel=&quot;stylesheet&quot; title=&quot;ui-darkness&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.ui-le-frog.css&quot; rel=&quot;stylesheet&quot; title=&quot;ui-le-frog&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.ui-lightness.css&quot; rel=&quot;stylesheet&quot; title=&quot;ui-lightness.&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.ui-sunny.css&quot; rel=&quot;stylesheet&quot; title=&quot;ui-sunny&quot; /&gt;<br />
[/html]</p>
<p>Have you noticed that we are calling the function applyNewCSS in the on change event of the select control. So next thins we will add that function.</p>
<p>[js]<br />
 function applyNewCSS() {<br />
            var css = $.trim($(&quot;#selectOptions&quot;).val());<br />
            if (css == &#8216;metro&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;metro&#8217; });<br />
            }<br />
            else if (css == &#8216;metrodark&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;metrodark&#8217; });<br />
            }<br />
            else if (css == &#8216;office&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;office&#8217; });<br />
            } else if (css == &#8216;orange&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;orange&#8217; });<br />
            } else if (css == &#8216;energyblue&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;energyblue&#8217; });<br />
            } else if (css == &#8216;darkblue&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;darkblue&#8217; });<br />
            } else if (css == &#8216;black&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;black&#8217; });<br />
            } else if (css == &#8216;shinyblack&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;shinyblack&#8217; });<br />
            } else if (css == &#8216;lightness&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;lightness&#8217; });<br />
            } else if (css == &#8216;ui-le-frog&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;ui-le-frog&#8217; });<br />
            } else if (css == &#8216;ui-darkness&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;ui-darkness&#8217; });<br />
            } else if (css == &#8216;ui-sunny&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;ui-sunny&#8217; });<br />
            }<br />
            else if (css == &#8216;android&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;android&#8217; });<br />
            }<br />
        }<br />
[/js]</p>
<blockquote><p>So we can add the theme to the grid as  $(&#8220;#jqxgrid&#8221;).jqxGrid({ theme: &#8216;theme name&#8217; });</p></blockquote>
<p>Here we are applying the theme to the grid according to the user selection. Oops, we forgot one thing. If you apply CSS style sheet directly, the styles won&#8217;t get applied in the page contents. For that we need to disable the remaining style sheets and enable the selected one alone.</p>
<p>Following code will do that magic.</p>
<p>[js]<br />
var i, link_tag;<br />
            for (i = 0, link_tag = document.getElementsByTagName(&quot;link&quot;) ; i &lt; link_tag.length; i++) {<br />
                if ((link_tag[i].rel.indexOf(&quot;stylesheet&quot;) != -1) &amp;&amp; link_tag[i].title) {<br />
                    link_tag[i].disabled = true;<br />
                    if (link_tag[i].title == css) {<br />
                        link_tag[i].disabled = false;<br />
                    }<br />
                }<br />
                set_cookie(&#8216;style&#8217;, css, 30);<br />
            }<br />
[/js]</p>
<p>We are finding all of the link reference and find out whose rel property has the word &#8216;stylesheet&#8217;. Now it is time to see how it woks. </p>
<div id="attachment_10857" style="width: 648px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_1.png"><img decoding="async" aria-describedby="caption-attachment-10857" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_1.png" alt="Change Themes Dynamically In Grid " width="638" height="540" class="size-full wp-image-10857" srcset="/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_1.png 638w, /wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_1-300x254.png 300w, /wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_1-400x339.png 400w" sizes="(max-width: 638px) 100vw, 638px" /></a><p id="caption-attachment-10857" class="wp-caption-text">Change Themes Dynamically In Grid</p></div>
<div id="attachment_10858" style="width: 637px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_2.png"><img decoding="async" aria-describedby="caption-attachment-10858" src="http://sibeeshpassion.com/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_2.png" alt="Change Themes Dynamically In Grid" width="627" height="505" class="size-full wp-image-10858" srcset="/wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_2.png 627w, /wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_2-300x242.png 300w, /wp-content/uploads/2015/10/Change_Themes_Dynamically_In_Grid_2-400x322.png 400w" sizes="(max-width: 627px) 100vw, 627px" /></a><p id="caption-attachment-10858" class="wp-caption-text">Change Themes Dynamically In Grid</p></div>
<p>You can see that the grid themes are changing according to the user selection of theme.That&#8217;s all we have done it. </p>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html lang=&quot;en&quot;&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Change Themes Dynamically In Grid &#8211; Sibeesh Passion&lt;/title&gt;<br />
    &lt;script src=&quot;jquery-1.9.1.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxcore.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdata.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxbuttons.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxscrollbar.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxlistbox.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdropdownlist.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxmenu.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxgrid.selection.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script type=&quot;text/javascript&quot; src=&quot;JQXItems/jqwidgets/jqxdatatable.js&quot;&gt;&lt;/script&gt;</p>
<p>    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.base.css&quot; rel=&quot;stylesheet&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.darkblue.css&quot; rel=&quot;stylesheet&quot; title=&quot;darkblue&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.energyblue.css&quot; rel=&quot;stylesheet&quot; title=&quot;energyblue&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.metro.css&quot; rel=&quot;stylesheet&quot; title=&quot;metro&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.metrodark.css&quot; rel=&quot;stylesheet&quot; title=&quot;metrodark&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.office.css&quot; rel=&quot;stylesheet&quot; title=&quot;office&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.ui-darkness.css&quot; rel=&quot;stylesheet&quot; title=&quot;ui-darkness&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.ui-le-frog.css&quot; rel=&quot;stylesheet&quot; title=&quot;ui-le-frog&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.ui-lightness.css&quot; rel=&quot;stylesheet&quot; title=&quot;ui-lightness.&quot; /&gt;<br />
    &lt;link href=&quot;JQXItems/jqwidgets/styles/jqx.ui-sunny.css&quot; rel=&quot;stylesheet&quot; title=&quot;ui-sunny&quot; /&gt;</p>
<p>    &lt;script type=&quot;text/javascript&quot;&gt;<br />
        function applyNewCSS() {<br />
            var css = $.trim($(&quot;#selectOptions&quot;).val());<br />
            var i, link_tag;<br />
            for (i = 0, link_tag = document.getElementsByTagName(&quot;link&quot;) ; i &lt; link_tag.length; i++) {<br />
                if ((link_tag[i].rel.indexOf(&quot;stylesheet&quot;) != -1) &amp;&amp; link_tag[i].title) {<br />
                    link_tag[i].disabled = true;<br />
                    if (link_tag[i].title == css) {<br />
                        link_tag[i].disabled = false;<br />
                    }<br />
                }<br />
            }<br />
            if (css == &#8216;metro&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;metro&#8217; });<br />
            }<br />
            else if (css == &#8216;metrodark&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;metrodark&#8217; });<br />
            }<br />
            else if (css == &#8216;office&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;office&#8217; });<br />
            } else if (css == &#8216;orange&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;orange&#8217; });<br />
            } else if (css == &#8216;energyblue&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;energyblue&#8217; });<br />
            } else if (css == &#8216;darkblue&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;darkblue&#8217; });<br />
            } else if (css == &#8216;black&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;black&#8217; });<br />
            } else if (css == &#8216;shinyblack&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;shinyblack&#8217; });<br />
            } else if (css == &#8216;lightness&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;lightness&#8217; });<br />
            } else if (css == &#8216;ui-le-frog&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;ui-le-frog&#8217; });<br />
            } else if (css == &#8216;ui-darkness&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;ui-darkness&#8217; });<br />
            } else if (css == &#8216;ui-sunny&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;ui-sunny&#8217; });<br />
            }<br />
            else if (css == &#8216;android&#8217;) {<br />
                $(&quot;#jqxgrid&quot;).jqxGrid({ theme: &#8216;android&#8217; });<br />
            }<br />
        }<br />
        $(document).ready(function () {<br />
            // prepare the data<br />
            var data =<br />
            {<br />
                datatype: &quot;json&quot;,<br />
                datafields: [{ &quot;name&quot;: &quot;AreaCode&quot;, &quot;type&quot;: &quot;string&quot; }, { &quot;name&quot;: &quot;Revenue&quot;, &quot;type&quot;: &quot;number&quot; }],<br />
                url: &quot;jsonData.txt&quot;<br />
            };<br />
            $(&quot;#jqxgrid&quot;).jqxGrid(<br />
                  {<br />
                      source: data,<br />
                      columns: [{ &quot;text&quot;: &quot;Area Code&quot;, &quot;dataField&quot;: &quot;AreaCode&quot;, &quot;cellsalign&quot;: &quot;left&quot;, &quot;cellsformat&quot;: &quot;d&quot; }, { &quot;text&quot;: &quot;Revenue&quot;, &quot;dataField&quot;: &quot;Revenue&quot;, &quot;cellsalign&quot;: &quot;right&quot;, &quot;cellsformat&quot;: &quot;c2&quot; }],<br />
                  });<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;h3&gt;Change Themes Dynamically In Grid &#8211; Sibeesh Passion&lt;/h3&gt;<br />
    &lt;br /&gt;<br />
    &lt;div id=&#8217;jqxWidget&#8217; style=&quot;float: left; width: 99.9%;&quot;&gt;<br />
        &lt;div id=&quot;jqxgrid&quot;&gt;&lt;/div&gt;<br />
    &lt;/div&gt;<br />
    &lt;br /&gt;<br />
    &lt;br /&gt;<br />
    &lt;select id=&quot;selectOptions&quot; onchange=&quot;applyNewCSS()&quot;&gt;<br />
        &lt;option value=&quot;0&quot;&gt;Select Template&lt;/option&gt;<br />
        &lt;option value=&quot;metro&quot;&gt;metro&lt;/option&gt;<br />
        &lt;option value=&quot;office&quot;&gt;office&lt;/option&gt;<br />
        &lt;option value=&quot;orange&quot;&gt;orange&lt;/option&gt;<br />
        &lt;option value=&quot;energyblue&quot;&gt;energyblue&lt;/option&gt;<br />
        &lt;option value=&quot;darkblue&quot;&gt;darkblue&lt;/option&gt;<br />
        &lt;option value=&quot;shinyblack&quot;&gt;shinyblack&lt;/option&gt;<br />
        &lt;option value=&quot;lightness&quot; selected=&quot;selected&quot;&gt;lightness&lt;/option&gt;<br />
        &lt;option value=&quot;android&quot;&gt;android&lt;/option&gt;<br />
    &lt;/select&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Have you ever wanted to do this requirement? Did you try jQWidget yet? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/change-themes-dynamically-in-grid/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
