Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 17-01-2009
Member
 
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 ?
Reply With Quote
  #2  
Old 17-01-2009
Member
 
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.
Reply With Quote
  #3  
Old 17-01-2009
Member
 
Join Date: May 2008
Posts: 2,293
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
Reply With Quote
  #4  
Old 17-01-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Difference Between DataGrid and DataGridView In VB.Net"
Thread Thread Starter Forum Replies Last Post
How to use datagridview readonly cell Ground 0 Windows Software 3 29-07-2009 12:44 PM
.net datagridview mouse position Jevin Software Development 2 29-06-2009 06:12 PM
How to resize cell in DataGridView Ebadaah Software Development 3 10-06-2009 06:54 PM
Datagridview does not detect scrollbars Fragman Software Development 2 10-06-2009 01:37 PM
Move Rows of Datagridview In VB.Net Ariadne Software Development 2 22-01-2009 10:40 PM


All times are GMT +5.5. The time now is 06:10 AM.