Results 1 to 4 of 4

Thread: Difference Between DataGrid and DataGridView In VB.Net

  1. #1
    Join Date
    Jan 2009
    Posts
    8

    Difference Between DataGrid and DataGridView In VB.Net

    What is the difference between Datagrid and DataGridview in VB.Net ?

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Difference Between DataGrid and DataGridView In VB.Net

    The DataGridView control is a new control that replaces the DataGrid control. The DataGridView control provides numerous basic and advanced features that are missing in the DataGrid control. Additionally, the architecture of the DataGridView control makes it much easier to extend and customize than the DataGrid control.

    The DataGrid control is retained for backward compatibility and for special needs. For nearly all purposes, you should use the DataGridView control. The only feature that is available in the DataGrid control that is not available in the DataGridView control is the hierarchical display of information from two related tables in a single control. You must use two DataGridView controls to display information from two tables that are in a master/detail relationship.

  3. #3
    Join Date
    May 2008
    Posts
    2,297

    Re: Difference Between DataGrid and DataGridView In VB.Net

    Following are some features available in the DataGridView control that are missing from the DataGrid control.

    Multiple column types The DataGridView control provides more built-in column types than the DataGrid control. These column types meet the needs of most common scenarios, but are also easier to extend or replace than the column types in the DataGrid control.

    Multiple ways to display data The DataGrid control is limited to displaying data from an external data source. The DataGridView control, however, can display unbound data stored in the control, data from a bound data source, or bound and unbound data together.

    Multiple ways to customize the display of data

    Multiple options for changing cell, row, column, and header appearance and behavior

  4. #4
    Join Date
    Oct 2005
    Posts
    2,393

    Code to use Datagrid view control in VB.Net

    Code to use Datagrid view control in VB.Net.

    Code:
    Private Sub AddDataGridColumn()
    Dim dataset As New DataSet
    ' Put some actions to populate the dataset
    Dim TblStyle As New DataGridTableStyle
    With TblStyle
    ' Set column style
    With .GridColumnStyles
    ' Set datagrid ComboBox ColumnStyle for PubID field
    .Add(New DataGridComboBoxColumn(dataset.Tables.Item("Companies"), 1, 0))
    With .Item(0)
    .MappingName = "PubID"
    .HeaderText = "Company ID"
    .Width = 150
    .NullText = String.Empty
    End With
    End With
    End With
    ' Add TableStyle
    DataGrid1.TableStyles.Add(TblStyle)
    End Sub

Similar Threads

  1. How to use datagridview readonly cell
    By Ground 0 in forum Windows Software
    Replies: 3
    Last Post: 29-07-2009, 12:44 PM
  2. .net datagridview mouse position
    By Jevin in forum Software Development
    Replies: 2
    Last Post: 29-06-2009, 06:12 PM
  3. How to resize cell in DataGridView
    By Ebadaah in forum Software Development
    Replies: 3
    Last Post: 10-06-2009, 06:54 PM
  4. Datagridview does not detect scrollbars
    By Fragman in forum Software Development
    Replies: 2
    Last Post: 10-06-2009, 01:37 PM
  5. Move Rows of Datagridview In VB.Net
    By Ariadne in forum Software Development
    Replies: 2
    Last Post: 22-01-2009, 10:40 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,516,504.52096 seconds with 16 queries