Showing posts with label .Net. Show all posts
Showing posts with label .Net. Show all posts

Sunday 25 January 2015

Setting up Angularjs in Visual Studio Express

AngularJS is a unique framework that without doubt will shape the web development space in the years to come . AngularJS is a recent addition to the client-side MVC frameworks list, yet it has
managed to attract a lot of attention, mostly due to its innovative templating system, ease of  development, and very solid engineering practices

In Simple Words I would say AngularJs is Awesome that anything else .

AngularJS is a relatively new actor on the client-side MVC frameworks scene; its 1.0 version was released only in June 2012. In reality, the work on this framework started in 2009 as a personal project of Miško Hevery, a Google employee. The initial idea turned out to be so good that, at the time of writing, the project was offiially backed by Google Inc., and there is a whole team at Google working full-time on the framework.

AngularJS is an open source project hosted on GitHub (https://github.com/angular/angular.js) and licensed by Google, Inc. under the terms of the MIT licens



Setting Up Angularjs in Visual Studio

1. First Open Visual Studio then Click on Tools Menu
2. Then Under Tools Menu click on Extension and Updates
3. It shows Extension and Updates Window . Now in Search Box at Top right side Typein AngularJS and Hit Enter .
4. Now you will be shown the result as below screenshot -

Add caption

 5. Now click on Install button to Install Angular js in visual studio .
 6. If any of Nuget packages are missing then these will be dependencies for angular that will automatically installed . as shown in screenshot below -


7. Now to check AngualarJS is installed click on File menu then click on New then click on Project
Now  under Templates -> Web category you can see AngularJS installed as shown in screenshot below -


Now AngularJS is ready in Visual Studio .


 




Saturday 27 September 2014

BootStrap Technology For Responsive Websites

Bootstrap is very good  and simple to use technology for making your website Mobile Compatible . It helps to make your website compatible with every you open it . Regardless of the screen size where we opens the website it provides full Responsiveness

Bootstrap File Structure

bootstrap/
├── css/
│   ├── bootstrap.css
│   ├── bootstrap.min.css
│   ├── bootstrap-theme.css
│   └── bootstrap-theme.min.css
├── js/
│   ├── bootstrap.js
│   └── bootstrap.min.js
└── fonts/
    ├── glyphicons-halflings-regular.eot
    ├── glyphicons-halflings-regular.svg
    ├── glyphicons-halflings-regular.ttf
    └── glyphicons-halflings-regular.woff


BootStrap Online File Links

 For Making your website Responsive using Bootstrap Technology You require some css , js coded files you can then use classes defined in these files to make your website responsive  you can either download these files from links below or you can directly provide these links in <head > </head> Tag of your Html or jsp or aspx file .
 For using Offline files :- 
 Go to links below one by one and this will open css code save the files with their respective names and then reference them in your page <head></head> Tag
For using Online Files :- 
Just include the following code lines in your page's <head></head> Tag
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" ref="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">

<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

A Simple Sample of Bootstrap Html Page Below :-


<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap 101 Template</title>

    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
    <h1>Hello, world!</h1>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
  </body>
</html>

Grid System In Bootstrap

Grid systems are used for creating page layouts through a series of rows and columns that house your content. Bootstrap's Grid system has done a lot of ease for developers Instead of doing calculations for div's like they do before bootstrap technology they can easily divide the page into columns and rows and design the page according to it .

Here's how the Bootstrap grid system works:

  • Rows must be placed within a .container (fixed-width) or .container-fluid (full-width) for proper alignment and padding. A container will contain all your divs
  • Use rows to create horizontal groups of columns.
  • Content should be placed within columns, and only columns may be immediate children of rows.
  • Predefined grid classes like .row and .col-xs-4 are available for quickly making grid layouts. Less mixins can also be used for more semantic layouts.
  • Columns create gutters (gaps between column content) via padding. That padding is offset in rows for the first and last column via negative margin on .rows.
  • The negative margin is why the examples below are outdented. It's so that content within grid columns is lined up with non-grid content.
  • Grid columns are created by specifying the number of twelve available columns you wish to span. For example, three equal columns would use three .col-xs-4.
  • If more than 12 columns are placed within a single row, each group of extra columns will, as one unit, wrap onto a new line.
  • Grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes, and override grid classes targeted at smaller devices. Therefore, applying any .col-md- class to an element will not only affect its styling on medium devices but also on large devices if a .col-lg- class is not present.
Reference Links

1. http://getbootstrap.com/
2. http://getbootstrap.com/css/

Wednesday 20 August 2014

save to google drive button javascript code

This is a simple javascript code to upload file from your computer to google drive using google drive api

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
   <script src='https://apis.google.com/js/platform.js'></script>
<div class="g-savetodrive"   data-src="/images/attendance.png" data-filename="ppupload1.jpg" data-sitename="Pictures of "    >
</div>
    </form>
</body>
</html>


Sunday 3 August 2014

Mixed mode assembly is built against version 'v2.0.50727' of the runtime


Error :- Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information

Error Explanation -
During using Sqlite Database with Csharp Applications you may suffer from this error Don't fear from it this is simple error

This problem is seen often . The main reasonof this problems  is that, because of the support for side-by-side runtimes in .Net Technology , .NET framework 4.0 has changed its way of binding  to older framework mixed-mode assemblies. These assemblies are those that are compiled from old  C++\CLI. Currently available DirectX assemblies are mixed mode. If you see a message like this then you know you have run into the issue:

Mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

SOLUTION :
Add the Following code in App.config file . App.config file will be available in Solution Explorer . If App.config is not available then you can add it by :-

  1. Right click on Project's folder in Solution Explorer 
  2. Click on Add then click on New
  3. Now scroll and find Application Configuration file and Click ok
  4. Now App.config will be successfully added .
  5. Now make the code of your App.config file similar to the following code or the replace the <startup> tag with tag given below

    <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
     <requiredRuntime version="v4.0.20506" />
    </startup>
  6. Now All errors Will be gone and continue your code with SQlite Csharp using link below :-

    How To Use Sqlite Database With Csharp





Friday 1 August 2014

How To use Crystal Reports in Asp.net


Download zip code file  for Crystal Report Demo App
Download Code For How To use Crystal Reports in Asp.net

Setting Up Sql Server Database 

  1. Open you Sql Server Management Studio
  2. Connect to SQl Server
  3. Then  in Right panel Right click on Databases and Click on New Database
  4. Now A New Dialog Box Appears 
  5. Fill Database name: TestReports and Hit Enter . Now Table will be successfully created

  6. Now in the Query window execute the following scripts to create table

  7. After successfull creation of tables insert some dummy data in tables using following query code

  8. Now Our Database work is over Now we go to Visual Studio for code

Now Do Code in Visual Studio
Start your Visual Studio .Click on New project choose Asp.net Web Form  Application and Give a appropriate name and choose location and Hit Enter .


Getting Dataset Ready For Report

  1. Right click on Project Folder in solution Explorer and click on Add then in further sub-menu click on New item

  2. Now a Popup window appears scroll and choose DataSet give name "Customers" and Click on Ok to add DataSet
  3. Now Customers Dataset will be added in solution explorer . Now Double click on it 
  4. It will open DataSet Designer Now right click on and create new DataTable 
  5. After Creating DataTable it will be empty by default now we will add column to it similar to our column in table in database 
  6. Right click on DataTable that we have created and Create new Column and give it name try to give the name similar to name of columns in Table in Database


Adding Crystal Report

  1. Right click on Project Folder in solution Explorer and click on Add then in further sub-menu click on New item 
  2. Now a Popup window appears scroll and choose Crystal Report give it name and Click on Ok

  3. Now Crystal Report Gallery window popup after some time 
  4. Now choose "Using the Report Wizard"  and click ok

  5. Now a window will popup and tell you to choose your dataset that we have created in above steps
  6. Choose your Datatable under Customers DataSet and Click ok
  7. Now your Dataset fields will be added on Field Explorer . Field explorer is available on left side of visual studio window
  8. In Field explorer under Database Expert you all datatable fields will be available

  9. you can drag these fields to crystal Report Details Section When you add them in  Details Section Its Header will automatically added to Page Header Section
  10. you can do some design of your Crystal Report like shown below :-


Designing Form

  1. Now  we will add a Aspx form that will be used to view our Crystal Report
  2. Right click on Project Folder in solution Explorer and click on Add then in further sub-menu click on New item 
  3. Now a Popup window appears scroll and choose WebForm give it name and Click on Ok  
  4. Now delete the existing code Add Following Code To Aspx Form


<%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
    Namespace="CrystalDecisions.Web" TagPrefix="CR" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <center>
    <CR:CrystalReportViewer ID="CrystalReportViewer1" runat="server" AutoDataBind="true" Width="1000" />
            </center>
    </form>
</body>
</html>



Adding Csharp ( C# ) Code


  1. Now go to Csharp code of New Added Webform and Add code similar to code below :-
  2. Add this code under your partial class -- 


protected void Page_Load(object sender, EventArgs e)
    {
        ReportDocument crystalReport = new ReportDocument();
        crystalReport.Load(Server.MapPath("~/CustomerReport.rpt"));
        Customers dsCustomers = GetData("select * from Testtable");
        crystalReport.SetDataSource(dsCustomers);
        CrystalReportViewer1.ReportSource = crystalReport;
    }

    private Customers GetData(string query)
    {
        string conString = ConfigurationManager.ConnectionStrings["constr"].ConnectionString;
        SqlCommand cmd = new SqlCommand(query);
        using (SqlConnection con = new SqlConnection(conString))
        {
            using (SqlDataAdapter sda = new SqlDataAdapter())
            {
                cmd.Connection = con;

                sda.SelectCommand = cmd;
                using (Customers dsCustomers = new Customers())
                {
                    sda.Fill(dsCustomers, "DataTable1");
                    return dsCustomers;
                }
            }
        }
    }

Tuesday 29 July 2014

How to use XML Parsing And TableLayout in Mono Android


In order to start with XML Parsing or XML data Handling in Microsoft .NET Framework first we need to know about what classes or namespaces are available to us for using or dealing with XML Document or XML Data in .Net So Here is list of XML Namespaces available for XML Processing and Handling :-


  • System.Xml;
  • System.Schema;
  • System.Xml.Serialization;
  • System.Xml.XPath;
  • System.Xml.Xsl;


Here , Out of these classes System.Xml class is major class that is responsible or must for XML Data Processing and this is the namespace that we are going to use in our tutorial today . The System.Xml namespace contains number of classes that are used for reading and writting Xml data from XML Documents . System.Xml contains :-


  • XmlReader for Reading Xml Documents we are not going to use it in our tutorial today
  • XmlWritter For Writting Xml Documents we are not going to use it in our tutorial today

There is another important class that we will use in our XML Parsing today . This is XmlNode It plays important role for getting xml data node by node This class represents every single node of the XML Document


OUTPUT SCREEN WITH RESULT 
I have used API 8 for building this app you Download the Application complete code from here :-
Download Xml Parser Android with TableLayout -- geeksprogrammings



Main.Xaml CODE MONO ANDROID

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="center_horizontal"
    android:orientation="vertical">
    <TableLayout
        android:id="@+id/main_table"
        android:layout_weight="1"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:layout_marginTop="0.0dp"
        android:scrollbars="vertical" />
</LinearLayout>

using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Android.Graphics;
using System.Xml;

XAML CODE EXPLANATION MONO ANDROID

step 1
In first line i have declared the xml version and encoding type this denotes that  this is an xml file code . In android xml code is used for creating design or layout of mono Android Apps

step 2
Now We have added a Linear Layout this is a default layout for Mono Android Application all controls or other layouts that we will use in our Mono Android Application will reside under this LinearLayout Tag
It contains Starting and Ending Tag .

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="center_horizontal"
    android:orientation="vertical">

</LinearLayout>

step 3
Now Under LinearLayout we have included a Table layout We have included Table layout because we in this tutorial of xml parsing is going to parse xml and then view the retrieved xml data in table view . We have used following code for styling or placing table layout

<TableLayout
        android:id="@+id/main_table"
        android:layout_weight="1"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:layout_marginTop="0.0dp"
        android:scrollbars="vertical" />



Csharp Code For XML Parsing MONO ANDROID

namespace AndroidApplication5
{
    [Activity(Label = "AndroidApplication5", MainLauncher = true, Icon = "@drawable/icon")]
    public class Activity1 : Activity
    {
        int count = 1;

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            XmlDocument doc = new XmlDocument();
            doc.LoadXml("<Product>    <ID>1</ID>    <SeqNo>1</SeqNo>    <Stage>Stage</Stage> <Observation>Observation</Observation><CHK></CHK> </Product>");
   
            XmlNode node = doc.DocumentElement.SelectSingleNode("/Product/ID");
            XmlNode node1 = doc.DocumentElement.SelectSingleNode("/Product/SeqNo");
            XmlNode node2 = doc.DocumentElement.SelectSingleNode("/Product/Stage");
            XmlNode node3 = doc.DocumentElement.SelectSingleNode("/Product/Observation");
            XmlNode node4 = doc.DocumentElement.SelectSingleNode("/Product/CHK");

            TableLayout ll = FindViewById<TableLayout>(Resource.Id.main_table);
         
     
            for (int i = 0; i < 10; i++)
            {
                TableRow row = new TableRow(this);
                TableRow.LayoutParams lp = new TableRow.LayoutParams(TableRow.LayoutParams.FillParent);
             
                row.LayoutParameters = lp;
                row.SetGravity(GravityFlags.CenterHorizontal);
             
            TextView checkBox = new TextView(this);
             TextView   tv = new TextView(this);
             TextView addBtn = new TextView(this);
             TextView rcf = new TextView(this);
             CheckBox verified = new CheckBox(this);
             TextView ver = new TextView(this);
             TextView    qty = new TextView(this);
             
                if (i == 1)
                {
                    checkBox.Text = node.Name.ToUpper().ToString();
                    checkBox.SetBackgroundColor(Color.AliceBlue);
                    checkBox.SetTextColor(Color.Black);
                    checkBox.SetPadding(7,9,7,9);

                    qty.Text = node1.Name.ToUpper().ToString();
                    qty.SetBackgroundColor(Color.AliceBlue);
                    qty.SetTextColor(Color.Black);
                    qty.SetPadding(7, 9, 9, 9);

                    tv.Text = node2.Name.ToUpper() .ToString();
                    tv.SetBackgroundColor(Color.AliceBlue);
                    tv.SetTextColor(Color.Black);
                    tv.SetPadding(7, 9, 9, 9);

                    addBtn.Text = node3.Name.ToUpper().ToString();
                    addBtn.SetBackgroundColor(Color.AliceBlue);
                    addBtn.SetTextColor(Color.Black);
                    addBtn.SetPadding(9, 9, 9, 9);

                    ver.Text = node4.Name.ToUpper().ToString();
                    ver.SetBackgroundColor(Color.AliceBlue);
                    ver.SetTextColor(Color.Black);
                    ver.SetPadding(9, 9, 9, 9);
                 
                }
                else if (i == 0)
                {
                    checkBox.Text = "Inspection";
                    checkBox.SetBackgroundColor(Color.AliceBlue);
                    checkBox.SetTextColor(Color.Black);
                    checkBox.SetPadding(9, 9, 9, 9);

                    qty.Text = "Details";
                    qty.SetBackgroundColor(Color.AliceBlue);
                    qty.SetTextColor(Color.Black);
                    qty.SetPadding(9, 9, 9, 9);

                    tv.Text = "Rail";
                    tv.SetBackgroundColor(Color.AliceBlue);
                    tv.SetTextColor(Color.Black);
                    tv.SetPadding(9, 9, 7, 9);

                    addBtn.Text = "Coach";
                    addBtn.SetBackgroundColor(Color.AliceBlue);
                    addBtn.SetTextColor(Color.Black);
                    addBtn.SetPadding(7, 9, 9, 9);

                    ver.Text = "";
                    ver.SetBackgroundColor(Color.AliceBlue);
                    ver.SetTextColor(Color.Black);
                    ver.SetPadding(9, 9, 9, 9);
                }
                else
                {
                    checkBox.Text = (i-1).ToString();
                    checkBox.SetBackgroundColor(Color.Black);
                    checkBox.SetTextColor(Color.White);
                    checkBox.SetPadding(7,9,9,9);

                    qty.Text = (i - 1).ToString();
                    qty.SetBackgroundColor(Color.Black);
                    qty.SetTextColor(Color.White);
                    qty.SetPadding(7,9,9,9);

                    tv.Text = node2.InnerText+(i-1).ToString ();
                    tv.SetBackgroundColor(Color.Black);
                    tv.SetTextColor(Color.White);
                    tv.SetPadding(9, 9, 9, 9);

                    addBtn.Text = node3.InnerText + (i-1).ToString();
                    addBtn.SetBackgroundColor(Color.Black);
                    addBtn.SetTextColor(Color.White);
                    addBtn.SetPadding(9, 9, 9, 9);
                    verified.Checked = true;
                }

                checkBox.Gravity = GravityFlags.CenterHorizontal;
                tv.Gravity = GravityFlags.CenterHorizontal;
                qty.Gravity = GravityFlags.CenterHorizontal;
                addBtn.Gravity = GravityFlags.CenterHorizontal;

                row.AddView(checkBox);
                row.AddView(qty);
                row.AddView(tv);
                row.AddView(addBtn);

                if (i == 1)
                {
                    row.AddView(ver);
                }
                else if(i>1)
                {
                    row.AddView(verified);

                }
                ll.AddView(row, i);
            }
   
   }
            }
    }

CsharpCode Explanation For XML Parsing MONO ANDROID

step1 

we start with main login of xml parsing that we are covering in our this tutorial here we have first include System.Xml namespace at top of our code document then we have used a XmlDocument class by making an instance of that class then we have passed the static Xml data to instance of XmlDocument by using LoadXml class that receives the xml data . you can see code below :-

 XmlDocument doc = new XmlDocument();
            doc.LoadXml("<Product>    <ID>1</ID>    <SeqNo>1</SeqNo>    <Stage>Stage</Stage> <Observation>Observation</Observation><CHK></CHK> </Product>");

Step 2

After passing the xml data now we are going to filter the xml data with respect to nodes of xml In our xml data Product is Parent node and it contains other child node like ID,SeqNo ..........
As we have loaded the xml data in doc we have used doc.Documentelement.SelectSingleNode that will select the single node of 'ID' that is child of Parent node 'Product'
You can see the code below :-

            XmlNode node = doc.DocumentElement.SelectSingleNode("/Product/ID");
            XmlNode node1 = doc.DocumentElement.SelectSingleNode("/Product/SeqNo");
            XmlNode node2 = doc.DocumentElement.SelectSingleNode("/Product/Stage");
            XmlNode node3 = doc.DocumentElement.SelectSingleNode("/Product/Observation");
            XmlNode node4 = doc.DocumentElement.SelectSingleNode("/Product/CHK");

step 3

With these lines of code below we are select the table layout that we have added in our xml code in layout file . You can see the code below :-

            TableLayout ll = FindViewById<TableLayout>(Resource.Id.main_table);

Step 4

This is main logic of code where we are reading xml data and then adding dynamic rows to table layout

 for (int i = 0; i < 10; i++)    // starting loop form 0 -9 to display 10 rows in table dynamically
            {
//creating a new tablerow
                TableRow row = new TableRow(this);    

//Setting tablerow hight , width parameters
                TableRow.LayoutParams lp = new   TableRow.LayoutParams(TableRow.LayoutParams.FillParent);
             
assigning the layoutparameters to row
                row.LayoutParameters = lp;

//setting row to alignment to center horizontal
                row.SetGravity(GravityFlags.CenterHorizontal);
             
//Adding some required TextView
            TextView checkBox = new TextView(this);
             TextView   tv = new TextView(this);
             TextView addBtn = new TextView(this);
             TextView rcf = new TextView(this);
             CheckBox verified = new CheckBox(this);
             TextView ver = new TextView(this);
             TextView    qty = new TextView(this);
             
                if (i == 1)        // this is for second row of table to display column names not values
                {
                    checkBox.Text = node.Name.ToUpper().ToString();
                    checkBox.SetBackgroundColor(Color.AliceBlue);
                    checkBox.SetTextColor(Color.Black);
                    checkBox.SetPadding(7,9,7,9);

                    qty.Text = node1.Name.ToUpper().ToString();
                    qty.SetBackgroundColor(Color.AliceBlue);
                    qty.SetTextColor(Color.Black);
                    qty.SetPadding(7, 9, 9, 9);

                    tv.Text = node2.Name.ToUpper() .ToString();
                    tv.SetBackgroundColor(Color.AliceBlue);
                    tv.SetTextColor(Color.Black);
                    tv.SetPadding(7, 9, 9, 9);

                    addBtn.Text = node3.Name.ToUpper().ToString();
                    addBtn.SetBackgroundColor(Color.AliceBlue);
                    addBtn.SetTextColor(Color.Black);
                    addBtn.SetPadding(9, 9, 9, 9);

                    ver.Text = node4.Name.ToUpper().ToString();
                    ver.SetBackgroundColor(Color.AliceBlue);
                    ver.SetTextColor(Color.Black);
                    ver.SetPadding(9, 9, 9, 9);
                 
                }
                else if (i == 0)      //this is for first row to display Heading
                {
                    checkBox.Text = "Inspection";
                    checkBox.SetBackgroundColor(Color.AliceBlue);
                    checkBox.SetTextColor(Color.Black);
                    checkBox.SetPadding(9, 9, 9, 9);

                    qty.Text = "Details";
                    qty.SetBackgroundColor(Color.AliceBlue);
                    qty.SetTextColor(Color.Black);
                    qty.SetPadding(9, 9, 9, 9);

                    tv.Text = "Rail";
                    tv.SetBackgroundColor(Color.AliceBlue);
                    tv.SetTextColor(Color.Black);
                    tv.SetPadding(9, 9, 7, 9);

                    addBtn.Text = "Coach";
                    addBtn.SetBackgroundColor(Color.AliceBlue);
                    addBtn.SetTextColor(Color.Black);
                    addBtn.SetPadding(7, 9, 9, 9);

                    ver.Text = "";
                    ver.SetBackgroundColor(Color.AliceBlue);
                    ver.SetTextColor(Color.Black);
                    ver.SetPadding(9, 9, 9, 9);
                }
//else is used for all other rows to be added dynamically except 0,1 row
                else
                {
                    checkBox.Text = (i-1).ToString();
                    checkBox.SetBackgroundColor(Color.Black);
                    checkBox.SetTextColor(Color.White);
                    checkBox.SetPadding(7,9,9,9);

                    qty.Text = (i - 1).ToString();
                    qty.SetBackgroundColor(Color.Black);
                    qty.SetTextColor(Color.White);
                    qty.SetPadding(7,9,9,9);

                    tv.Text = node2.InnerText+(i-1).ToString ();
                    tv.SetBackgroundColor(Color.Black);
                    tv.SetTextColor(Color.White);
                    tv.SetPadding(9, 9, 9, 9);

                    addBtn.Text = node3.InnerText + (i-1).ToString();
                    addBtn.SetBackgroundColor(Color.Black);
                    addBtn.SetTextColor(Color.White);
                    addBtn.SetPadding(9, 9, 9, 9);
                    verified.Checked = true;
                }

                checkBox.Gravity = GravityFlags.CenterHorizontal;
                tv.Gravity = GravityFlags.CenterHorizontal;
                qty.Gravity = GravityFlags.CenterHorizontal;
                addBtn.Gravity = GravityFlags.CenterHorizontal;

                row.AddView(checkBox);
                row.AddView(qty);
                row.AddView(tv);
                row.AddView(addBtn);

                if (i == 1)
                {
                    row.AddView(ver);
                }
                else if(i>1)
                {
                    row.AddView(verified);

                }
                ll.AddView(row, i);
            }