I am a newbe to C#, and I am required to enable and disable rows in a
listview, depending on certain criteria.
e.g. The listview contains -
Apples
Oranges
Grapes
I am required to have Apples and Grapes enabled and available for
selection, and Oranges must be disabled so that a user cannot select
that option.
Any ideas as to how this can be done?
Thanks 1 4678
I think you need to programmaticall y set the ListViewItem.Se lected value to
false,
when "oranges" is selected. To do this, you need to create a event handler
to handle the SelectedIndexCh anged Event of ListView Object, and put the code
in it.
P.S. the event might fire twice for some situation (you need to have
implement some logic to avoid doing the same thing twice, since it will slow
down the performance of the app)
Cheers,
Ivan Wong
"JC" wrote: I am a newbe to C#, and I am required to enable and disable rows in a listview, depending on certain criteria.
e.g. The listview contains - Apples Oranges Grapes
I am required to have Apples and Grapes enabled and available for selection, and Oranges must be disabled so that a user cannot select that option.
Any ideas as to how this can be done?
Thanks
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Joaquin Grech |
last post by:
Hi
I did alot of research on this on the web and msdn and I couldn't find
anything.
I have a listview showing as a grid (table looking, with rows and columns
and no images at all, only text). I get the information to display on the
listview from the network and I add items often and stuff.
But more than adding items, what worries me is the step of modifying items.
|
by: Matt Michael |
last post by:
Hi,
I'm having a problem working with a listview in an application I'm writing.
Currently, whenever the selectedindex changed event fires, it loads up a
htmledit control, and other labels on the form, with the current information
associated with the listview item. Whenever I click on each item, it works
fine, but it seems that whenever I use the up/down arrows(important) to
scroll through the list, it loses focus, and goes to the...
|
by: Matt Michael |
last post by:
Hi,
I'm having a problem working with a listview in an application I'm writing.
Currently, whenever the selectedindex changed event fires, it loads up a
htmledit control, and other labels on the form, with the current information
associated with the listview item. Whenever I click on each item, it works
fine, but it seems that whenever I use the up/down arrows(important) to
scroll through the list, it loses focus, and goes to the...
|
by: Matt Michael |
last post by:
Hi,
I'm having a problem working with a listview in an application I'm writing.
Currently, whenever the selectedindex changed event fires, it loads up a
htmledit control, and other labels on the form, with the current information
associated with the listview item. The control is called HtmlEdit and it
references Microsoft.Mshtml Whenever I click on each item, it works fine,
but it seems that whenever I use the up/down arrows(important)...
|
by: jeff |
last post by:
hi,
I'm now using VS.NET 2002
1. when disable a listview, the color for a selected row is light-grey, how
can i change it to dark blue (like a disabled listbox) ?
2. when disable a datagrid and enable it again programatically, the vectical
scrollbar still in "disable mode" and can't be scrolled down by user.
| |
by: RyanW |
last post by:
I want to display check boxes in a listview, but I don't want the user to
click on them and check them. All the checking of the boxes will be done by
the program. How can I make this happen??
Thanks
Ryan
|
by: Yoavo |
last post by:
Hi,
I have a ListView control and I make it disabled when a certain event occur.
My problem is that when the control become disabled, the selection on the
selected item is gone.
(I want that the user will still be able to see the selected item).
Yoav.
|
by: DBC User |
last post by:
I have list view with 5 listview items and I want to show the first
show to the user but user should not able to select the rows, it is
should be already selected and checked, but user should not unselect
it or uncheck it. Is it possible to do that with the listview?
Thanks.
|
by: Brandon McCombs |
last post by:
Hello,
I have a form that contains a listview on the left side and a column of
buttons on the right side. Only some of the buttons do I want enabled
all the time. The other buttons should be enabled only if something is
selected in the listview. That part specifically works but not very
well. It seems that I can only get the buttons to disable if I click off
the text of the items in the listview but still within about 10-20
pixels of...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |