Solved

NET 2.0 C# VS   GRIDVIEW  MANUALLY CREATE  ROWS

Posted on 2006-07-19
3
322 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
[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
  • 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

624 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