Results 1 to 2 of 2

Thread: Datagrid - Manually add stuff

  1. #1

    Thread Starter
    Registered User NicoNel2000's Avatar
    Join Date
    Feb 2004
    Location
    Beijing - China
    Posts
    296

    Datagrid - Manually add stuff

    Hi,

    Not sure if a datagrid is what i should use. Can one manually (in code) add rows and colums as you wish? (No datasource used)

    I need a control to which i can add rows and columns manually...something like code will go like: (This is just "play-code" to try illustrate what I mean)

    Dim ColItems As Collection
    Dim RowItems as Collection
    Dim ColItem as Item
    Dim RowItem as Item

    For Each ColItem in ColItems
    Control.Columns.Add(ColItem.Name)
    Next ColItem
    For Each RowItem in RowItems
    Control.Rows.Add(RowItem.Name)
    Next RowItem

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Datagrid - Manually add stuff

    yes... what you would do is make a datatable.. and fill the datatable with data manually.... then you create a dataview from your datatable... and the dataview can be set to the datasource of the grid... confused yet???

    take a look at this... it is ASP.NET... but the code for the actual filling of the datagrid is exactly what you are looking to do...

    http://www.dotnetjunkies.com/quickst.../DataBind4.src

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width