Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

.NET - grid

Posted on 2002-06-06
3
Medium Priority
?
323 Views
Last Modified: 2010-05-02
In the Visual Studio .NET there is only one grid control, the DataGrid. Can this grid be used NOT binded to a database? (I mean, to add columns and rows, and write text in its cells?)

Or is there another grid control for .net available for free?

0
Comment
Question by:Azmodan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 28

Accepted Solution

by:
iboutchkine earned 200 total points
ID: 7061836
Yes you can use an unbound grid. here is an example


Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "
#End Region

    Private m_DataSet As DataSet
    Private m_dtFood As DataTable

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' Build the DataSet.
        m_DataSet = New DataSet()

        ' Build the States table.
        m_dtFood = New DataTable("Food")
        m_DataSet.Tables.Add(m_dtFood)

        Dim number_column As DataColumn
        number_column = New DataColumn("Number", GetType(Integer))
        number_column.AutoIncrement = True
        number_column.AutoIncrementSeed = 100
        number_column.AutoIncrementStep = 10
        m_dtFood.Columns.Add(number_column)

        m_dtFood.Columns.Add("Name", GetType(String))

        ' Populate the Food table.
        Dim food_data(1) As Object
        food_data(0) = Nothing
        food_data(1) = "Apple"
        m_dtFood.Rows.Add(food_data)

        food_data(1) = "Banana"
        m_dtFood.Rows.Add(food_data)

        food_data(1) = "Cherry"
        m_dtFood.Rows.Add(food_data)

        food_data(1) = "Date"
        m_dtFood.Rows.Add(food_data)

        food_data(1) = "Egg"
        m_dtFood.Rows.Add(food_data)

        food_data(1) = "Fig"
        m_dtFood.Rows.Add(food_data)

        ' Accept the data.
        m_DataSet.AcceptChanges()

        ' Attach the DataGrid to the DataTable.
        dgStates.DataSource = m_dtFood
    End Sub
End Class
0
 

Author Comment

by:Azmodan
ID: 7066640
This is a way of initialising the grid from a fake datasource, but is not used unbound.
So... i get that it can't be used unbound, and there isn;t another grid.. :(
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7858133
Hi Azmodan,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept iboutchkine's comment(s) as an answer.

Azmodan, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.
==========
DanRollins -- EE database cleanup volunteer
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question