Question

vb.net listview disable auto checked

Asked by: aarontham

i found below listviewEx which can do listview edit on subitems. can some one help to convert it to vb.net 2008. and add below feature.
when i able checkbox on this listviewEx. it will auto checked when user doube click on subitem to do edit. how to i disable the auto checked.

http://www.codeproject.com/KB/list/ListViewCellEditors.aspx?msg=2902339#xx2902339xx

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-01-29 at 09:01:49ID24095317
Topics

Microsoft Visual Basic.Net

,

.NET

,

Microsoft Visual Studio Express

Participating Experts
2
Points
500
Comments
22

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Listview Subitems VB.NET
    I have to be able to increment the value of a subitem in a listview.. It is going to increment by 1 every time that a loop runs but it won't do a WordsProcessed.Items(IndexW).SubItems(0) = WordsProcessed.Items(IndexW).SubItems(0) + 1 Just get some error: Operator "+&q...
  2. VB.NET ListView problem adding Subitems
    Trying to add Subitems to a ListView control in VB.NET. Trying to add 2 Subitems to an item. This syntax does not work. Why? - Thanks With ListView1 .Items.Add("Item 1").SubItems(0).Text = "Subitem 0" .Items.Add("Item 1&q...
  3. Listview subitem icons
    Hi there, I used to use the listview in VB6. One particular piece of functonality that i used extensively was that of .subitem(1).smallicon I can see no reference to allowing subitem icons in VB.net Any ideas?! Grunge
  4. Adding Images to SubItems in a ListView (VB.NET)
    I'm trying to figure out how to add an image to a subitem in a ListView using VB.NET code. I've found some samples in C# but am having difficulty converting them to VB.NET. Does anyone have some VB.NET sample code?
  5. Add image to subitem in listview
    I have another question open asking how to add multiple images to one subitem in a listview. I just realized that I can't figure out how to even add one image to a subitem! I've searched this site and only found ways to do it with c#. I'm not skilled enough to figure it ou...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: planoczPosted on 2009-01-29 at 10:59:37ID: 23501057

Check this link,,,, in there I have a Listview with textboxes sample...
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_Basic.NET/Q_23466629.html

 

by: jpaulinoPosted on 2009-01-29 at 11:46:50ID: 23501629

Why not a datagridview ?

 

by: aaronthamPosted on 2009-01-30 at 06:52:38ID: 23508730

hi jpaulino,

let say i need to display data like below and have checkbox in fron before the Desc .
Can Datagribview do below requiment??
 if user edit column from  either Q'ty , USD, Exchange,MarkUp,DPrice ,RPrice and SPrice . can datagridview do calculation with below fix fomula.
 USD* Exchange*MarkUp=DPrice
DPrice/0.7= RPrice
user need to check on the checkbox to save.
user also need to double click on either DPrice or RPrice to save either one.

Desc  Part#1    Part#2    Q'ty    USD    Exchange   MarkUp   DPrice       RPrice   SPrice     Total
5seat  5s          5SUV        1     9,000      2.4            0.9         21,600      24,000  34,285
2seat  2s          2Sport       1     19,000    2.4            0.9         45,600      50,666   72,380
9seat  9s          9MPV        1     15,000    2.4            0.9         36,000      40,000   57,142

if datagribview can do pls provide some vb.nt 2008 code.

Thank You

 

by: jpaulinoPosted on 2009-01-30 at 07:07:48ID: 23508922

Do you have a source for that (db) ?

 

by: aaronthamPosted on 2009-01-30 at 07:39:08ID: 23509296

the DB source already loaded into a dataTable . below is the code.


Using adapter As New MySqlDataAdapter(strQuery3, cnString3)

            Dim rs3 As New DataTable()
            Try
                adapter.Fill(rs3)
            Catch ex As Exception
                'In case if any error occurs
                MsgBox("Database Connection Error", vbCritical, "Library Management System")
                Exit Sub
            End Try

Pls advice.
the DB source only have below column. the rest will be calculation base the fomula.
Desc  Part#1    Part#2    Q'ty    USD    Exchange   MarkUp

Below fomula to generate  DPrice       RPrice   SPrice    
USD* Exchange*MarkUp=DPrice
DPrice/0.95= RPrice
RPrice/0.7= SPrice

 

by: jpaulinoPosted on 2009-01-30 at 07:48:51ID: 23509447



Ok,

You can then add and an expression column like this:

rs3.Columns.Add("Total").Expression = "val1*val2+val3"
(just change to your formula with the right column names)


Then define for the datagridview datasource your datatable:

Me.DataGridView1.DataSource = rs3


And finally add the checkbox column:

Dim check As New DataGridViewCheckBoxColumn
check.Width = 20
Me.DataGridView1.Columns.Insert(0, check)

 

by: aaronthamPosted on 2009-01-31 at 05:09:51ID: 23516609

Hi jpaulino,

i got it work. but how to trim the data in datagridview?

 

by: jpaulinoPosted on 2009-01-31 at 07:45:48ID: 23517114

Don't understand your question, can you try to explain better ?

 

by: aaronthamPosted on 2009-01-31 at 19:56:05ID: 23519904

i need to populate Datagridview column by column.

so that i can trim data and do dbnull and use diffrence header to display on datagridview.

i try below code but don't work.

  Do While r.Read()
                DataGridView1.Columns.Insert(0, check)
                DataGridView1.Item(1, i).Value = r.GetString("Desc")
                DataGridView1.Item(2, i).Value = r.GetString("Part#1")
                DataGridView1.Item(3, i).Value = r("Part#2")
                DataGridView1.Item(4, i).Value = r("Qty")
        DataGridView1.Item(5, i).Value = r("Qty")
                i = i + 1
                         Loop

 

by: jpaulinoPosted on 2009-02-01 at 02:17:28ID: 23520799

But you can do all that in the sql statement !

You can trim the fields using LTRIM, RTRIM, you can change the header name like

"SELECT myField1 As myFieldHeaderName1, myField2 AS myFieldHeaderName2, ..."

 

by: aaronthamPosted on 2009-02-01 at 02:57:50ID: 23520888

Hi jpaulino,

how to use space i try below Sql don't work.

"SELECT myField1 As myFieldHeader Name1, myField2 AS myFieldHeader Name2, ..."

Pls also provide sample how to use LTRIM, RTRIM.

Thank You

 

by: jpaulinoPosted on 2009-02-01 at 03:07:55ID: 23520911

Try this way:

"SELECT LTRIM(RTRIM(myField1)) As [myFieldHeader Name1], LTRIM(RTRIM(myField2)) AS [myFieldHeader Name2], ..."

 

by: aaronthamPosted on 2009-02-01 at 03:24:29ID: 23520963

the space do't work

pls advice

 

by: jpaulinoPosted on 2009-02-01 at 03:26:54ID: 23520969

What space ? Show some example of what you have and what you want.

 

by: aaronthamPosted on 2009-02-01 at 04:18:18ID: 23521073


when myFieldHeaderName1 it work but when myFieldHeader Name1 there is error.


"SELECT LTRIM(RTRIM(myField1)) As [myFieldHeader Name1], LTRIM(RTRIM(myField2)) AS [myFieldHeader Name2], ..."

 

by: jpaulinoPosted on 2009-02-01 at 04:44:44ID: 23521122

Can you show your code ?

 

by: aaronthamPosted on 2009-02-01 at 04:56:43ID: 23521143

Pls find below code

 Dim cnString3 As String = My.Settings.McsysplCon
        Dim strQuery3 As String = "SELECT LTrim(RTrim(commentt.Desc)) As Capacity,commentt.Part1 As Part Number,commentt.Part2 As Original Part,commentt.usd As USD,commentt.PMarkup As Mark UP From commentt WHERE BrandGP = " & ListView24.SelectedItems(0).SubItems(1).Text & ""

        Using adapter As New MySqlDataAdapter(strQuery3, cnString3)

            Dim rs3 As New DataTable()

            Try
                adapter.Fill(rs3)
            Catch ex As Exception
                'In case if any error occurs
                MsgBox("Database Connection Error", vbCritical, "Library Management System")
                Exit Sub
            End Try


error msg: Database Connection Error

i use MySQL database.

 

by: jpaulinoPosted on 2009-02-01 at 07:10:59ID: 23521481

Database Connection Error is a problem of the connectin string and not with the sql syntax. Check the connection string and test if it work with a simple T-SQL, like "SELECT * FROM commentt "

 

by: aaronthamPosted on 2009-02-01 at 07:57:23ID: 23521628

but with the same code when the SQL Part Number no space like PartNumber it work

     Dim strQuery3 As String = "SELECT LTrim(RTrim(commentt.Desc)) As Capacity,commentt.Part1 As PartNumber,commentt.Part2 As OriginalPart,commentt.usd As USD,commentt.PMarkup As MarkUP From commentt WHERE BrandGP = " & ListView24.SelectedItems(0).SubItems(1).Text & ""

 

by: jpaulinoPosted on 2009-02-01 at 08:05:26ID: 23521669

Have you tried like this ?

  Dim strQuery3 As String = "SELECT LTrim(RTrim(commentt.Desc)) As Capacity,commentt.Part1 As [Part Number],commentt.Part2 As [Original Part],commentt.usd As USD,commentt.PMarkup As MarkUP From commentt WHERE BrandGP = " & ListView24.SelectedItems(0).SubItems(1).Text & ""

 

by: aaronthamPosted on 2009-02-01 at 18:57:37ID: 23524128

i tried but still same error msg.

 

by: jpaulinoPosted on 2009-02-03 at 01:35:46ID: 23535460

Have you figured ?

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...