Solved

NET 2.0 C# VS   GRIDVIEW  MANUALLY CREATE  ROWS

Posted on 2006-07-19
3
310 Views
Last Modified: 2008-03-17
I am working on a static ASP.NET mockup design (wireframes) which includes a gridview with a few sample records.

Right now I have no actual data and would like to simulate what  3 or 4 gridview records  would look like later with actual data?

How do you go about making  3 or 4 mockup records with say 4 columns of data to demonstate what the gridview would look with actual records?

Help

0
Comment
Question by:RSSIAdmin
  • 2
3 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17142180
Are you bound to a DataTable/DataSet?  If so, then you can just add 3 or 4 blank rows, and bind the GridView.

Bob
0
 

Author Comment

by:RSSIAdmin
ID: 17146433
Not bound to anything

I just want to create 3 or 4 rows rows with some hard coded text in each row.

Something just to show in the gridview since I only have shell ( no datasource , in fact nothing)
     
MY sample GridView would look something like this:
             ticket_id      name    location
             003            Tom       NY
             005            Dick       Ca
            001            Harry      NJ
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 17151036
You can create an in-memory DataTable, with columns ticket_id, name, and location, and add those three records:

VB.NET example:
Dim table As New DataTable
table.Columns.Add("ticket_id")
table.Columns.Add("name")
table.Columns.Add("location")

Dim row As DataRow = table.NewRow()
row("ticket_id") = "003"
row("name") = "Tom"
row("location") = "NY"

table.Rows.Add(row)

Me.GridView1.DataSource = table
Me.GridView1.DataBind()

Bob
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
IIs block files web.config 6 73
Compare site how does it work 4 52
asp.net mvc5 3 38
Asp.net mvc entity issue 6 20
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now