473,670 Members | 2,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Quest: WPF & listview item selection...

HI all,

I am working on a WPF listview that get items through the XMLDataProvider
and making a listview with two actual columns and in both CellTemplete XAML
in a grid bind more than one snippet of the XML data to the cell. Now this
works fine no problem...

When I try to setup a IsSelected trigger I lose the default listview
selection UI and only the new look of the ListViewItem after the trigger
takes effect shows what Item is selected. What is going on here with default
listview selection UI and can I get it back with the trigger in place too?

NOTE: For those that don't know what I mean by default listview selection UI
just open windows explorer and select a item and mouse over another - I want
that to work on the IsSelected trigger version of my listview for full row
selection...

Any help...

Oct 10 '08 #1
4 7459
Brandon wrote:
HI all,

I am working on a WPF listview that get items through the
XMLDataProvider and making a listview with two actual columns and in
both CellTemplete XAML in a grid bind more than one snippet of the XML
data to the cell. Now this works fine no problem...

When I try to setup a IsSelected trigger I lose the default listview
selection UI and only the new look of the ListViewItem after the trigger
takes effect shows what Item is selected. What is going on here with
default listview selection UI and can I get it back with the trigger in
place too?

NOTE: For those that don't know what I mean by default listview
selection UI just open windows explorer and select a item and mouse over
another - I want that to work on the IsSelected trigger version of my
listview for full row selection...

Any help...
It's hard to help without some more detailed information.

Can you post a short example of some code that shows your problem?

Alun Harford
Oct 11 '08 #2
>>It's hard to help without some more detailed information.
>
>>Can you post a short example of some code that shows your problem?
Thanks for your reply - well this example is not my work but example shows
the problem...

There is a zip with the WPF listview example at the of Beatriz Costa's
blog... "http://www.beacosta.co m/blog/?cat=9"

The zip was easy for me to compile and run has is... The exe shows the WPF
Listview similar to mine and like her example I show extra information for
the selected item and like her example I lose the default listview selection
UI when the IsSelected trigger is in play.

Also if you edit her or my example and cut out the triggers(deleti ng the
trigger's xaml open/close tag and tag's inner content) and run example the
Listview completely render more as a picture(no selection IU) of a Listview
execpt the Listview Header still works...

So now how can I get the default Listview selection UI to work with the
IsSelected trigger is in play also?

Any more help...

Oct 11 '08 #3
Brandon wrote:
>>It's hard to help without some more detailed information.
>>Can you post a short example of some code that shows your problem?
Thanks for your reply - well this example is not my work but example
shows the problem...

There is a zip with the WPF listview example at the of Beatriz Costa's
blog... "http://www.beacosta.co m/blog/?cat=9"

The zip was easy for me to compile and run has is... The exe shows the
WPF Listview similar to mine and like her example I show extra
information for the selected item and like her example I lose the
default listview selection UI when the IsSelected trigger is in play.

Also if you edit her or my example and cut out the triggers(deleti ng the
trigger's xaml open/close tag and tag's inner content) and run example
the Listview completely render more as a picture(no selection IU) of a
Listview execpt the Listview Header still works...

So now how can I get the default Listview selection UI to work with the
IsSelected trigger is in play also?
Basically, you can't. Once you've retemplated a control, the default
template is no longer involved.

You can download the default template and modify it, but that's probably
a bad idea.

Alun Harford
Oct 11 '08 #4
>>Basically, you can't. Once you've retemplated a control, the default
>>template is no longer involved.
OK I guess I will have to wait till the next srv pack for the default...
>>You can download the default template and modify it,
but that's probably a bad idea.
What is a good idea direction to look toward say creating a non-standard
like say for starts a ##% transparent solid color full row selection and
mouse over bars.

Should all I need to do it mess with the IsSelected trigger some more and
add a mouse over trigger too...

Any more help...

Oct 12 '08 #5

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

Similar topics

8
602
by: InvisibleDuncan | last post by:
I have a ListView that populates some fields whenever the user selects an item. However, if they change the data in the fields and then select a new item without saving, I want to display a message box that warns that their changes will be lost, and asks them to confirm whether to continue. Sounds simple Unfortunately, the ListView's SelectedIndexChanged event cannot be cancelled, and it's actually called for each change in the selection. So,...
1
3398
by: Bob Geltz | last post by:
I am able to populate a ListView with several detail lines (several columns). When finished, I would like to pre-select the first item in the list (before the user interacts with the list). This way, if a user clicks on the OK button, there will be a default selection. I know how to use ListView.SelectedItems to get the selection, I just don't know how to make an item be selected without the user actually clicking on a line. For a...
6
2529
by: Vanessa | last post by:
With this program I can do one selection, but upon the second I get an error where ///////////////// is indicated. Please help. using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data;
1
3063
by: youngie | last post by:
I've got a listview on a form in report style. It's populated with 40 item. I want to prevent the used clicking on some items, and if the user clicks on one of these items I want the selection to revert back to the old selection, hideselection property if false, listview is single select. In the OnSelectedChange() handler I test to see if the newly selected item is a selectable one, if it's not, I try to change the selection like so.
2
3119
by: Dolorous Edd | last post by:
Hi, for a program I'm working on I need to be able to drag multiple files between Windows Explorer and a ListBox, in both directions. Implementing the "drag in" was pretty easy, but I can't find a way to export more than on item at time. The ideal result would be to be able to drag the selected files, but as soon as I click on the LB to do the drag a new selection is made that cancels the current one and by searching with google it...
6
5536
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...
5
12657
by: Jure Bogataj | last post by:
Hi all! I have a problem (performance issue) with listview. I have implemented an ItemSelectionChange on my listview and put some code in it (I build some toolbar based on selection and update info in statusbar). When selecting one item (clicking on listview) it works fast, without noticing. However if selecting multiple items with SHIFT (approx. 500 items) or selecting with mouse, for each item selected through all listview an event...
12
4010
by: Tom Bean | last post by:
I am trying to display a ContextMenuStrip when a user right-clicks on an item in a ListView and have encountered a something that seems strange to me. When the ListView is initially populated, no items are selected. When the first item is selected by clicking either the left or right button, the SelectedIndexChanged event fires but not the MouseUp event. After the first item is selected and another item clicked on, both the...
0
1865
by: Brandon | last post by:
Hi there... I got a WPF project that I am trying to select a ComboBoxItem in a ComboBox based on a string from the selected ListView item in the project... This ComboBox is unbound now and the ListView is grouped(Group section headings are the strings that populate the ComboBox Items) and bound to a XML provider. Later I will bound the ComboBox to the same XML provider as the ListView...
0
8471
marktang
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...
0
8386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8903
Oralloy
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...
0
8815
jinu1996
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...
1
8592
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,...
0
4213
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...
1
2802
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
2
2044
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1795
bsmnconsultancy
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...

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.