Click here to Skip to main content
15,884,023 members
Articles / Programming Languages / C#

Silverlight DataGrid with Dynamic Multiple Row Columns in Header

Rate me:
Please Sign up or sign in to vote.
3.86/5 (6 votes)
15 Dec 2008CPOL3 min read 93.2K   3.7K   29  
Creating a dynamic header for the Silverlight DataGrid with multiple rows/columns.
using System;
using System.Collections.Generic;

namespace DynamicMutipleRowHeaderSilverlighGrid
{
    public class SalseData
    {
        public int PinkSoap { get; set; }
        public int WhiteSoap { get; set; }
        public int ToiletSoap { get; set; }
        public int SHAMPOO { get; set; }

        private SalseData() { }

        public static List<SalseData> GetSalseData()
        {
            return new List<SalseData>{ new SalseData{PinkSoap=10,WhiteSoap=20,ToiletSoap=30,SHAMPOO=40},
                new SalseData{PinkSoap=100,WhiteSoap=200,ToiletSoap=300,SHAMPOO=400} };
        }

        public static String GetSalseDataHeader()
        {
            return "SOAP|Bath Soap|Pink Soap,SOAP|Bath Soap|White Soap,SOAP|Toilet Soap,SHAMPOO";
        }

        public static String GetSalseDataColumnHeader()
        {
            return "Pink Soap|PinkSoap,White Soap|WhiteSoap,Toilet Soap|ToiletSoap,SHAMPOO|SHAMPOO";
        }

        public static String GetSalseDataFooter()
        {
            return "110|220|330|440";
        }

    }

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Fountainhead Software Solutions Private Limited
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions