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

x
?
Solved

NET 2.0 C# VS   GRIDVIEW  MANUALLY CREATE  ROWS

Posted on 2006-07-19
3
Medium Priority
?
325 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

688 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