473,326 Members | 2,102 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,326 software developers and data experts.

VB.NET Web-App: how to show the table in a web form list box

Hello Sam,

In a Windows form, the listview control is available but if i 'm working in a webform, i cannot find it. Can you please advise how to create a listview in a webform or what other options i have?
The following code is from windows form which i would like to use in web form as well:

Expand|Select|Wrap|Line Numbers
  1.  
  2. For Each fnditem In fnditems
  3.  
  4.                 Dim listparams(2) As String
  5.  
  6.                 listparams(0) = fnditem.Item.ItemID
  7.  
  8.                 listparams(1) = fnditem.Item.Title
  9.  
  10.  
  11.                 Dim vi As ListViewItem = New ListViewItem(listparams)
  12.  
  13.                 LstSearchResults.Items.Add(vi)
  14.             Next fnditem
  15.  
  16.  
What VB are you using? VBA(if so, which application), VB6, or VB.Net?

If you are using VB.Net, you might want to consider using a ListView control instead:
  1. Add a ListView control
  2. In the Design Mode, add two columns to the Columns property: Vegetables, Fruits
  3. In the form load event, you can load the rows:
Expand|Select|Wrap|Line Numbers
  1. ListView1.View = View.Details
  2. ListView1.Items.Add(New ListViewItem(New String() {"Tomato", "Apple"}))
  3. ListView1.Items.Add(New ListViewItem(New String() {"Cucumber", "Apricot"}))
HTH --Sam
Dec 17 '07 #1
6 2430
Frinavale
9,735 Expert Mod 8TB
Hello Sam,

In a Windows form, the listview control is available but if i 'm working in a webform, i cannot find it. Can you please advise how to create a listview in a webform or what other options i have?
The following code is from windows form which i would like to use in web form as well:

Expand|Select|Wrap|Line Numbers
  1.  
  2. For Each fnditem In fnditems
  3.  
  4.                 Dim listparams(2) As String
  5.  
  6.                 listparams(0) = fnditem.Item.ItemID
  7.  
  8.                 listparams(1) = fnditem.Item.Title
  9.  
  10.  
  11.                 Dim vi As ListViewItem = New ListViewItem(listparams)
  12.  
  13.                 LstSearchResults.Items.Add(vi)
  14.             Next fnditem
  15.  
  16.  
I would love it if there was a web form ListView available for web applications, but right now it isn't.

Try using a GridView to solve your problem.

-Frinny
Dec 17 '07 #2
This is also not that easy.

I have put a datagrid on my web form.

I typed the following like i do for listview in windows form:

Dim vi As DataGrid = New DataGrid(strParams)

It highlights it and tool tip says "overload resolution failed because no accessible new accepts this number of arguments"

Any help?




I would love it if there was a web form ListView available for web applications, but right now it isn't.

Try using a GridView to solve your problem.

-Frinny
Dec 17 '07 #3
Shashi Sadasivan
1,435 Expert 1GB
Hi,
Do u intend for the datagrid to filter rows according to the parameters that you are passing?

A datagrid generally takes in a datasource (which you can custom filter it)
and then bind the datagrid.

gridview.Datasource = mydatasource;
gridview.DataBind()
Dec 17 '07 #4
Hello,

The following code is for a windows form and its using listview. I want to do the same thing in a web form. I was advised to use the datagrid but i 'm not sure how to use it. I will highly appreciate if you can please help.

Expand|Select|Wrap|Line Numbers
  1.  For Each fnditem In fnditems
  2.                 Dim listparams(2) As String
  3.  
  4.                 listparams(0) = fnditem.Item.ItemID
  5.  
  6.                 listparams(1) = fnditem.Item.Title
  7.  
  8.  
  9.                 Dim vi As ListViewItem = New ListViewItem(listparams)
  10.  
  11.                 LstSearchResults.Items.Add(vi)
  12.             Next fnditem
  13.  
Hi,
Do u intend for the datagrid to filter rows according to the parameters that you are passing?

A datagrid generally takes in a datasource (which you can custom filter it)
and then bind the datagrid.

gridview.Datasource = mydatasource;
gridview.DataBind()
Dec 18 '07 #5
Frinavale
9,735 Expert Mod 8TB
Hello,

The following code is for a windows form and its using listview. I want to do the same thing in a web form. I was advised to use the datagrid but i 'm not sure how to use it. I will highly appreciate if you can please help.

Expand|Select|Wrap|Line Numbers
  1.  For Each fnditem In fnditems
  2.                 Dim listparams(2) As String
  3.  
  4.                 listparams(0) = fnditem.Item.ItemID
  5.  
  6.                 listparams(1) = fnditem.Item.Title
  7.  
  8.  
  9.                 Dim vi As ListViewItem = New ListViewItem(listparams)
  10.  
  11.                 LstSearchResults.Items.Add(vi)
  12.             Next fnditem
  13.  
I'm not sure what your variable FindItems is but you Bind Datasources to GridViews.

For Example,
MyGridView.DataSource = finditems
MyGridView.DataBind()

Would bind the data to the GridView.

Check out MSDN for more information on the GridView. They have lots of examples on how to use it in that article as well.

If you're using .NET Framework 1.1, GridView objects wont be made available to you. You should look into a DataGrid if that is the case.

-Frinny
Dec 18 '07 #6
Frinavale
9,735 Expert Mod 8TB
Hello,

The following code is for a windows form and its using listview. I want to do the same thing in a web form. I was advised to use the datagrid but i 'm not sure how to use it. I will highly appreciate if you can please help.

Expand|Select|Wrap|Line Numbers
  1.  For Each fnditem In fnditems
  2.                 Dim listparams(2) As String
  3.  
  4.                 listparams(0) = fnditem.Item.ItemID
  5.  
  6.                 listparams(1) = fnditem.Item.Title
  7.  
  8.  
  9.                 Dim vi As ListViewItem = New ListViewItem(listparams)
  10.  
  11.                 LstSearchResults.Items.Add(vi)
  12.             Next fnditem
  13.  
I'm not sure if you have tried to use a GridView yet or not.
Could you please provide more details on what you have tried so far.

Have you considered creating your own version of the ListView using a Repeater and custom ListItem objects?

-Frinny
Dec 24 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Michael Hatmaker | last post by:
I have begun experimenting with web services, and I created some simple web services in C# and was able to install them with IIS and create an equally simple C# client to consume them. My next...
1
by: Teeravee Sirinapasawasdee | last post by:
Hi, all After I have learnt about XML Web Service, I have questions about deploying XML Web Service and application that call the XML Web Service. When we develop windows application or web...
1
by: Liza | last post by:
Hello, can you guys help me out here....? this is part of my masters degree and hence is very important to me..... my supervisor doesn't seem to be too interested in helping me and infact is...
0
by: melledge | last post by:
Full Programme for XTech 2005 Announced Premier European XML Industry Event Expands Focus to "XML, the Web and Beyond"; Co-hosted by the Mozilla Foundation,W3C, and OASIS, Presenters Include...
6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
1
by: Jon Paugh | last post by:
Hi Friendly Newsgroup Readers, I switched to another PC and pulled all my source code for my solution to my new PC, after first dutifully adding my web project directories as appropriately named...
0
by: Demetri | last post by:
I have 2 web services. Web service "Main" and a Web Service "Proxy". I also have a shared libary of complex types. The "Proxy" web service simply calles methods of the "Main" web service. When...
1
by: win2kcowboy | last post by:
Using VS2003, ASP.NET 1.1 Is it possible to secure files normally placed as attachments (such as word docs etc.) and often placed in attachment directories within your web application, using...
25
by: John Morgan | last post by:
Though I have designed and implemented a number of large reasonably well received web sites I do not consider myself a graphics designer I am now for the first time going to work with a ...
3
by: Marshal | last post by:
This is a definite and reproduceable bug in Web Services, Visual Studio 2003. Here is a simple example. Create a web service... // this represents an original version of an object class...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.