Solved

NET 2.0 C# VS   GRIDVIEW  MANUALLY CREATE  ROWS

Posted on 2006-07-19
3
315 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

830 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