Fill datagrid without database

Discussion in 'ASP .Net Datagrid Control' started by Yoramo, Jun 29, 2003.

  1. Yoramo

    Yoramo Guest

    Hello

    I need to fill in my datagrid from calcutalted date. how do I fill in my
    datagrid?

    yoramo
     
    Yoramo, Jun 29, 2003
    #1
    1. Advertising

  2. Yoramo

    Tim Guest

    could you be a little more specific?

    "Yoramo" <> wrote in message
    news:Ow#...
    > Hello
    >
    > I need to fill in my datagrid from calcutalted date. how do I fill in my
    > datagrid?
    >
    > yoramo
    >
    >
     
    Tim, Jun 29, 2003
    #2
    1. Advertising

  3. You can create a datatable fill in your details and bind it to your
    datatable.

    Steve

    "Yoramo" <> wrote in message
    news:Ow%...
    > Hello
    >
    > I need to fill in my datagrid from calcutalted date. how do I fill in my
    > datagrid?
    >
    > yoramo
    >
    >
     
    Steve Letford, Jun 29, 2003
    #3
  4. Yoramo

    yoramo Guest

    Thanks I'v done it here is an example of it.

    // create a DataTable
    DataTable aTbl = new DataTable("Test") ;
    DataColumn aClmn ;
    aClmn = new DataColumn("aaa") ;
    aClmn.DataType= System.Type.GetType("System.Char");
    aTbl.Columns.Add(aClmn) ;
    aClmn = new DataColumn("Count") ;
    aClmn.DataType= System.Type.GetType("System.Int16");
    aTbl.Columns.Add(aClmn) ;
    aClmn = new DataColumn("Frequency") ;
    aClmn.DataType= System.Type.GetType("System.Double");
    aTbl.Columns.Add(aClmn) ;
    aClmn = new DataColumn("RealChar") ;
    aClmn.DataType= System.Type.GetType("System.Char");
    aTbl.Columns.Add(aClmn) ;
    // fill in the relevant data
    for (char ch = 'A' ; ch <= 'Z' ; ch++)
    {
    int Row = ch - 'A' ;
    DataRow aRow;
    aRow = aTbl.NewRow() ;
    aRow["aaa"] = ch ;
    aRow["Count"] = _Table[ch] ;
    double aFreq = (100.0 * _Table[ch]) / _Table.TotalCount ;
    aRow["Frequency"] = aFreq ;
    aTbl.Rows.Add(aRow) ;
    }
    dataGrid2.DataSource = aTbl ;


    thanks
    Yoramo


    "Steve Letford" <> wrote in message
    news:%...
    > You can create a datatable fill in your details and bind it to your
    > datatable.
    >
    > Steve
    >
    > "Yoramo" <> wrote in message
    > news:Ow%...
    > > Hello
    > >
    > > I need to fill in my datagrid from calcutalted date. how do I fill in

    my
    > > datagrid?
    > >
    > > yoramo
    > >
    > >

    >
    >
     
    yoramo, Jun 30, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pierre van Rooyen
    Replies:
    3
    Views:
    552
    Cor Ligthert
    May 21, 2004
  2. Fabio Mastria
    Replies:
    5
    Views:
    4,360
    TechMCAD13
    Jan 30, 2008
  3. Toni Pohl
    Replies:
    1
    Views:
    951
    Toni Pohl
    Aug 10, 2008
  4. Eugene Anthony

    fill combo box with data from database

    Eugene Anthony, Jul 14, 2005, in forum: ASP General
    Replies:
    4
    Views:
    145
    Bob Barrows [MVP]
    Jul 14, 2005
  5. David
    Replies:
    3
    Views:
    154
    Bagbourne
    Jul 5, 2003
Loading...

Share This Page