Page Rank

Subscribe

Categories

Recent posts

Alexa Rank

DataGridView in VB


  • This topic explains about the working of datagridview in VB programming.
  • Tools needed: DataGridView (dataGridView1), Button1 (btnColumnADD), Button2 (btnRowsAdd), Button3 (btnRowsCount), Button4 (btnColumnCount), Button5 (btnAddGridValues), button6 (btnGetValues)

DataGridView in VB – Design

DataGridViewDataGridView in VB

  • The DataGridView control provides a customizable table for displaying data.
  • DataGridView control is designed to be a complete solution for displaying tabular data with Windows Forms.
  • DataGridView class allows us to customization of cells, rows, columns, and borders through the use of its properties
  • Each cell within the DataGridView control can have its own style, such as text format, background color, foreground color, font etc.
  • All cells derive from the DataGridViewCell base class.

Create Column dynamically in DataGridViewDataGridView in VB

  • 0,1,2,….. are the index of the datagridview control.
  • Index starts with 0 (Zero) in datagridview.

DataGridView in VB – Add Columns

Create rows in DataGridViewDataGridView in VB

  • Rows must be added only after creating columns, otherwise error will be occurred.


DataGridView in VB – Add rows

Count No: of rows in DataGridViewDataGridView in VB

DataGridView in VB – Count rows

Count no: of columns in DataGridViewDataGridView in VB

DataGridView in VB – Count columns

Add data to the DataGridViewDataGridView in VB

  • Rows[0] – index of the row
  • Cells[0] – index of the column

DataGridView in VB – Add data

Get data from DataGridViewDataGridView in VB

DataGridView in VB – Get Data

Clear rows in DataGridViewDataGridView in VB

Clear Columns in DataGridView - DataGridView in VB

DataGridView in VBComplete Code

 DataGridView in VB

If you have any suggestions or doubts regarding this topic, please contact us…

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">