473,378 Members | 1,631 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

What control would you use to display unbound data?

Mel
I want to display custom data in some sort of control on a web page.
By custom data I mean it's not in a database yet it just resides in a
List Box on a different tab . I just want to display the data and
allow the user to edit a couple values. What control can I use that
will allow me to manually fill it with whatever data I want and allow
user editing?

(using: asp.net 2.0, vb.net, visual studio 2005, winxp pro sp2)
Oct 23 '08 #1
19 3906
"Mel" <ML********@gmail.comwrote in message
news:d9**********************************@m32g2000 hsf.googlegroups.com...
I want to display custom data in some sort of control on a web page.
By custom data I mean it's not in a database yet it just resides in a
List Box on a different tab . I just want to display the data and
allow the user to edit a couple values. What control can I use that
will allow me to manually fill it with whatever data I want and allow
user editing?

(using: asp.net 2.0, vb.net, visual studio 2005, winxp pro sp2)
Most, if not all, of the databinding-compliant controls can work with pretty
much any data source, not just those fetched from a database.

E.g. it's perfectly possible to instantiate a DataTable object, define its
structure, and add rows to it so that e.g. a GridView can be bound to it...
http://msdn.microsoft.com/en-us/libr...datatable.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 23 '08 #2
Mel
On Oct 23, 9:59*am, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"Mel" <MLights...@gmail.comwrote in message

news:d9**********************************@m32g2000 hsf.googlegroups.com...
I want to display custom data in some sort of control on a web page.
By custom data I mean it's not in a database yet it just resides in a
List Box on a different tab . *I just want to display the data and
allow the user to edit a couple values. *What control can I use that
will allow me to manually fill it with whatever data I want and allow
user editing?
(using: asp.net 2.0, vb.net, visual studio 2005, winxp pro sp2)

Most, if not all, of the databinding-compliant controls can work with pretty
much any data source, not just those fetched from a database.

E.g. it's perfectly possible to instantiate a DataTable object, define its
structure, and add rows to it so that e.g. a GridView can be bound to it....http://msdn.microsoft.com/en-us/libr...datatable.aspx

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net
Okay cool. Can anyone provide a little example I can try?
Oct 23 '08 #3
Mel
On Oct 23, 3:13*pm, Mel <MLights...@gmail.comwrote:
On Oct 23, 9:59*am, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"Mel" <MLights...@gmail.comwrote in message
news:d9**********************************@m32g2000 hsf.googlegroups.com....
I want to display custom data in some sort of control on a web page.
By custom data I mean it's not in a database yet it just resides in a
List Box on a different tab . *I just want to display the data and
allow the user to edit a couple values. *What control can I use that
will allow me to manually fill it with whatever data I want and allow
user editing?
(using: asp.net 2.0, vb.net, visual studio 2005, winxp pro sp2)
Most, if not all, of the databinding-compliant controls can work with pretty
much any data source, not just those fetched from a database.
E.g. it's perfectly possible to instantiate a DataTable object, define its
structure, and add rows to it so that e.g. a GridView can be bound to it...http://msdn.microsoft.com/en-us/libr...datatable.aspx
--
Mark Rae
ASP.NET MVPhttp://www.markrae.net

Okay cool. *Can anyone provide a little example I can try?
To be specific, can anyone provide an Asp.net 2.0/vb.net example?
Oct 23 '08 #4
"Mel" <ML********@gmail.comwrote in message
news:d5**********************************@k13g2000 hse.googlegroups.com...
Okay cool. Can anyone provide a little example I can try?
I already did - here it is again:
http://msdn.microsoft.com/en-us/libr...datatable.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 23 '08 #5
Mel
On Oct 23, 4:28*pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"Mel" <MLights...@gmail.comwrote in message

news:d5**********************************@k13g2000 hse.googlegroups.com...
Okay cool. *Can anyone provide a little example I can try?

I already did - here it is again:http://msdn.microsoft.com/en-us/libr...datatable.aspx

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net
Okay I've got my data table made and now it's bound to my DataGrid. I
have some columns in my DataGrid that I need to allow the user to
edit. Do I need to create all of the Edit Item Template fields
programmatically then?

I tried creating the columns and templates in the DataGrid (using the
Wizard) and then bind the data table to the DataGrid programmatically
but my columns just append to the columns I had defined with the
wizard.
Oct 24 '08 #6
"Mel" <ML********@gmail.comwrote in message
news:4b**********************************@8g2000hs e.googlegroups.com...
>>Okay cool. Can anyone provide a little example I can try?

I already did - here it is
again:http://msdn.microsoft.com/en-us/libr...datatable.aspx

Okay I've got my data table made and now it's bound to my DataGrid. I
have some columns in my DataGrid that I need to allow the user to
edit. Do I need to create all of the Edit Item Template fields
programmatically then?

I tried creating the columns and templates in the DataGrid (using the
Wizard) and then bind the data table to the DataGrid programmatically
but my columns just append to the columns I had defined with the
wizard.
Do yourself a *HUGE* favour and ignore all of these wizards - IMO, they
cause more problems than they solve...

1) Create your DataTable and populate it.

2) Create a GridView manually (why are you still using a DataGrid, AAMOI?)
and define the columns to match those in the DataTable.

3) Bind the GridView to the DataTable.
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 24 '08 #7
Mel
On Oct 24, 8:47*am, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"Mel" <MLights...@gmail.comwrote in message

news:4b**********************************@8g2000hs e.googlegroups.com...
>Okay cool. Can anyone provide a little example I can try?
I already did - here it is
again:http://msdn.microsoft.com/en-us/libr...datatable.aspx
Okay I've got my data table made and now it's bound to my DataGrid. *I
have some columns in my DataGrid that I need to allow the user to
edit. *Do I need to create all of the Edit Item Template fields
programmatically then?
I tried creating the columns and templates in the DataGrid (using the
Wizard) and then bind the data table to the DataGrid programmatically
but my columns just append to the columns I had defined with the
wizard.

Do yourself a *HUGE* favour and ignore all of these wizards - IMO, they
cause more problems than they solve...

1) Create your DataTable and populate it.

2) Create a GridView manually (why are you still using a DataGrid, AAMOI?)
and define the columns to match those in the DataTable.

3) Bind the GridView to the DataTable.

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net
Oh, the example you provided uses a DataGrid. I can use a GridView
though.
Oct 24 '08 #8
Mel
On Oct 24, 9:19*am, Mel <MLights...@gmail.comwrote:
On Oct 24, 8:47*am, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:


"Mel" <MLights...@gmail.comwrote in message
news:4b**********************************@8g2000hs e.googlegroups.com...
>>Okay cool. Can anyone provide a little example I can try?
>I already did - here it is
>again:http://msdn.microsoft.com/en-us/libr...datatable.aspx
Okay I've got my data table made and now it's bound to my DataGrid. *I
have some columns in my DataGrid that I need to allow the user to
edit. *Do I need to create all of the Edit Item Template fields
programmatically then?
I tried creating the columns and templates in the DataGrid (using the
Wizard) and then bind the data table to the DataGrid programmatically
but my columns just append to the columns I had defined with the
wizard.
Do yourself a *HUGE* favour and ignore all of these wizards - IMO, they
cause more problems than they solve...
1) Create your DataTable and populate it.
2) Create a GridView manually (why are you still using a DataGrid, AAMOI?)
and define the columns to match those in the DataTable.
3) Bind the GridView to the DataTable.
--
Mark Rae
ASP.NET MVPhttp://www.markrae.net

Oh, the example you provided uses a DataGrid. *I can use a GridView
though.- Hide quoted text -

- Show quoted text -
When you say create the GridView manually, you mean in my aspx.vb
code? So I will need to create the column headings, row data, and
template fields?
Oct 24 '08 #9
"Mel" <ML********@gmail.comwrote in message
news:01**********************************@m36g2000 hse.googlegroups.com...
When you say create the GridView manually, you mean in my aspx.vb
code?
No - I mean in your aspx markup.
So I will need to create the column headings, row data, and
template fields?
You will need to create the columns and any template fields. The rows,
obviously, will be created when the GridView is bound to the DataTable...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 24 '08 #10
Mel
On Oct 24, 10:08*am, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"Mel" <MLights...@gmail.comwrote in message

news:01**********************************@m36g2000 hse.googlegroups.com...
When you say create the GridView manually, you mean in my aspx.vb
code?

No - I mean in your aspx markup.
So I will need to create the column headings, row data, and
template fields?

You will need to create the columns and any template fields. The rows,
obviously, will be created when the GridView is bound to the DataTable...

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net
Okay that is what I did but I am not getting correct results in my
GridView. In the Design view of my aspx page I clicked on the
GridView and chose "Edit Columns" (this is the wizard I was referring
to earlier) and I added 6 columns as BoundFields named exactly like
the columns in my DataTable. Then in my vb code I bind the DataTable
I have created and populated to the GridView the DataTable columns
just append to the GridView control. The first 6 columns don't have
any row data and the next 6 do.
Oct 24 '08 #11
"Mel" <ML********@gmail.comwrote in message
news:b5**********************************@64g2000h sm.googlegroups.com...
>You will need to create the columns and any template fields. The rows,
obviously, will be created when the GridView is bound to the DataTable...

Okay that is what I did but I am not getting correct results in my
GridView. In the Design view of my aspx page I clicked on the
GridView and chose "Edit Columns" (this is the wizard I was referring
to earlier) and I added 6 columns as BoundFields named exactly like
the columns in my DataTable. Then in my vb code I bind the DataTable
I have created and populated to the GridView the DataTable columns
just append to the GridView control. The first 6 columns don't have
any row data and the next 6 do.
Make sure the GridView's AutoGenerateColumns property is set to "false":
http://msdn.microsoft.com/en-us/libr...tecolumns.aspx
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 24 '08 #12
Mel
On Oct 24, 10:47*am, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"Mel" <MLights...@gmail.comwrote in message

news:b5**********************************@64g2000h sm.googlegroups.com...
You will need to create the columns and any template fields. The rows,
obviously, will be created when the GridView is bound to the DataTable....
Okay that is what I did but I am not getting correct results in my
GridView. *In the Design view of my aspx page I clicked on the
GridView and chose "Edit Columns" (this is the wizard I was referring
to earlier) and I added 6 columns as BoundFields named exactly like
the columns in my DataTable. *Then in my vb code I bind the DataTable
I have created and populated to the GridView the DataTable columns
just append to the GridView control. *The first 6 columns don't have
any row data and the next 6 do.

Make sure the GridView's AutoGenerateColumns property is set to "false":http://msdn.microsoft.com/en-us/libr...ebcontrols.gri...

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net
Yeah I tried that. When I set AutoGenerateColumns = False I get 6
columns with only column headings and no row data.
Oct 24 '08 #13
"Mel" <ML********@gmail.comwrote in message
news:a5**********************************@m3g2000h sc.googlegroups.com...
>Make sure the GridView's AutoGenerateColumns property is set to "false"
Yeah I tried that. When I set AutoGenerateColumns = False I get 6
columns with only column headings and no row data.
Hmm - OK, please post the markup for the GridView plus the code-behind...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 24 '08 #14
"Mel" <ML********@gmail.comwrote in message
news:50**********************************@u75g2000 hsf.googlegroups.com...
>>>Make sure the GridView's AutoGenerateColumns property is set to "false"

Yeah I tried that. When I set AutoGenerateColumns = False I get 6
columns with only column headings and no row data.

Hmm - OK, please post the markup for the GridView plus the code-behind...
<asp:GridView ID="GridView1" runat="server">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<asp:BoundField HeaderText="Task ID" />
<asp:BoundField DataField="Task ID" HeaderText="Task ID" />

etc
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 24 '08 #15
Mel
On Oct 24, 2:12*pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"Mel" <MLights...@gmail.comwrote in message

news:50**********************************@u75g2000 hsf.googlegroups.com...
>>Make sure the GridView's AutoGenerateColumns property is set to "false"
>Yeah I tried that. When I set AutoGenerateColumns = False I get 6
columns with only column headings and no row data.
Hmm - OK, please post the markup for the GridView plus the code-behind....
*<asp:GridView ID="GridView1" runat="server">

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<asp:BoundField HeaderText="Task ID" />

<asp:BoundField DataField="Task ID" HeaderText="Task ID" />

etc

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net
It was the DataField property I was missing. It works now. Thank you
SO very much Mark for sticking with me on this topic and also for
putting up with a relatively new person to the web programming world.
Your help is very much appreciated.
Oct 24 '08 #16
Mel
On Oct 24, 2:28*pm, Mel <MLights...@gmail.comwrote:
On Oct 24, 2:12*pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"Mel" <MLights...@gmail.comwrote in message
news:50**********************************@u75g2000 hsf.googlegroups.com....
>>>Make sure the GridView's AutoGenerateColumns property is set to "false"
>>Yeah I tried that. When I set AutoGenerateColumns = False I get 6
>>columns with only column headings and no row data.
>Hmm - OK, please post the markup for the GridView plus the code-behind...
*<asp:GridView ID="GridView1" runat="server">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<asp:BoundField HeaderText="Task ID" />
<asp:BoundField DataField="Task ID" HeaderText="Task ID" />
etc
--
Mark Rae
ASP.NET MVPhttp://www.markrae.net

It was the DataField property I was missing. *It works now. *Thank you
SO very much Mark for sticking with me on this topic and also for
putting up with a relatively new person to the web programming world.
Your help is very much appreciated.
I made a couple of the fields template fields (so I can allow editing
now) but I am getting this error "Exception has been thrown by the
target of an invocation." It is referring to this line in my aspx
code:

<ItemTemplate>
<asp:Label ID="lblDuration" runat="server" Text='<%# Bind("[Duration
(days)]") %>'></asp:Label>
</ItemTemplate>

What am I doing wrong?
Oct 27 '08 #17
Mel
On Oct 24, 2:28*pm, Mel <MLights...@gmail.comwrote:
On Oct 24, 2:12*pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"Mel" <MLights...@gmail.comwrote in message
news:50**********************************@u75g2000 hsf.googlegroups.com....
>>>Make sure the GridView's AutoGenerateColumns property is set to "false"
>>Yeah I tried that. When I set AutoGenerateColumns = False I get 6
>>columns with only column headings and no row data.
>Hmm - OK, please post the markup for the GridView plus the code-behind...
*<asp:GridView ID="GridView1" runat="server">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<asp:BoundField HeaderText="Task ID" />
<asp:BoundField DataField="Task ID" HeaderText="Task ID" />
etc
--
Mark Rae
ASP.NET MVPhttp://www.markrae.net

It was the DataField property I was missing. *It works now. *Thank you
SO very much Mark for sticking with me on this topic and also for
putting up with a relatively new person to the web programming world.
Your help is very much appreciated.
Can anyone show me how I would enable editing for the "Resource"
column? For example, upon editing for the resource column I want a
drop-down list of items they can choose from. I added a command field
to my GridView and I made the resource column a template field but
when I click edit my drop-down box for the resource column does not
appear.
Oct 27 '08 #18
"Mel" <ML********@gmail.comwrote in message
news:ab**********************************@j68g2000 hsf.googlegroups.com...
>It was the DataField property I was missing. It works now. Thank you
SO very much Mark for sticking with me on this topic and also for
putting up with a relatively new person to the web programming world.
Your help is very much appreciated.

I made a couple of the fields template fields (so I can allow editing
now) but I am getting this error "Exception has been thrown by the
target of an invocation." It is referring to this line in my aspx
code:

What am I doing wrong?
Please provide your updated code...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 27 '08 #19
Mel
On Oct 24, 2:12*pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.netwrote:
"Mel" <MLights...@gmail.comwrote in message

news:50**********************************@u75g2000 hsf.googlegroups.com...
>>Make sure the GridView's AutoGenerateColumns property is set to "false"
>Yeah I tried that. When I set AutoGenerateColumns = False I get 6
columns with only column headings and no row data.
Hmm - OK, please post the markup for the GridView plus the code-behind....
*<asp:GridView ID="GridView1" runat="server">

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
<asp:BoundField HeaderText="Task ID" />

<asp:BoundField DataField="Task ID" HeaderText="Task ID" />

etc

--
Mark Rae
ASP.NET MVPhttp://www.markrae.net
Can anyone assist me on how I edit a field? Using the
EditItemTemplate and I am assuming I would need to update the
DataTable also?
Oct 27 '08 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bill Stock | last post by:
The few times in the past that I've loaded unbound data, I've tended to cheat and use temp tables (not really unbound) or use code for small datasets. I'm currently involved in a project that...
2
by: Joe Au | last post by:
I first add a grid layout panel control to a web form, then put a data grid inside the panel. When I run the web form, the data grid is filled up but it throws outside the panel control. The panel...
1
by: Darrel | last post by:
I use repeater controls and attach a dataset to it to create a list of records. When I want to display just one record, what should I bind the data to? I can use a repeater, but it clutters the...
4
by: joshlaw | last post by:
Hi! I've got some data that I want to display and edit in table-format, just like you would in Excel. It seems like this should be fairly straightforward, but I can't find any controls that do...
0
by: Tobin | last post by:
Hello, I've developed in asp 6.0 a bit and am fooling around with asp.net 2.0. In asp 6.0 I displayed report type pages by generating dynamic HTML and wrote to the page using...
0
by: teknowledgy | last post by:
My SQL database has four tables. A couple of the columns in these tables use the xml data type which receive data from custom asp.net 2.0 user controls. Now I am trying to display the data from my...
1
by: ganesah | last post by:
hi there, i need to create a program to continously display the received binary data (2bytes) from COM 8 in a console, however I'm having problem in doing so where i do nt see any data being...
1
by: jbs255 | last post by:
Hello friends, i have create a datareport in vb 6.0. i have to display some data through programming in data report. i have to do in by datareport1.conrol( i ) = "abc". but the problem is that...
3
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I am familiar with datagrids in vs2003 but not familiar with 2005 (which I am now using.) I need to display a grid of some type with rows when a webpage loads with 5 columns. One column will...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.