I have a WinForms ListView, obviously containing ListViewItems. I'd like to be able to attach a click event to each item, instead of to the entire ListView (and then trying to figure out what item was clicked). The reason for this is that I need to perform a different action based on which item was selected. The ListViewItem class seems ...
I need to bind width property of the GridView column that is created dynamically in code.
Since GridViewColumn object has no SetBinding method, how should I do this?
Thanks in advance.
...
I'm trying to use the context menu in a listview to run some code that requires data from which item it originated from.
I initially just did this:
XAML:
<ListView x:Name="lvResources" ScrollViewer.VerticalScrollBarVisibility="Visible">
<ListView.Resources>
<ContextMenu x:Key="resourceContextMenu">
<MenuI...
I have a class called Picture and that has a name and size (int) property.
I was going to sort them using size, but not the displayed file name which is the item name in the listview.
I implemented IComparer<Picture> for the Picture type, and then when I write this:
this.PicList.ListViewItemSorter = AllPictures[0];
or
this.PicList....
Take the following example...a page with a ListView and a DataPager used for paging the data of the ListView:
Code Behind:
protected void Page_Load(object sender, EventArgs e)
{
MyList.DataSource = GetSomeList();
MyList.DataBind();
}
Source:
<asp:ListView ID="MyList" runat="server">
<% //LayoutTemplate and ItemTemplate r...
Hi
I'm trying to style the header of a listview depending on hover/pressed/etc. events.
So far I tried a few things such as a trigger like the following but this does not work on my machine (a Vista Ultimate x64)
<Style x:Key="GridViewColumnHeaderStyle1" TargetType="{x:Type GridViewColumnHeader}">
<Style.Triggers>
<Trigger...
Hi Guys,
I have few questions as I am usign XAML for the first time.
How do I use the button (BrowseButton) to browse a folder in Harddrive ?
In this case as the button is inside
Can I use the way I have shown below?
Actually first dockpanel will hold the image and some label and the other dockpanel will have tabcontrol in it.
If I ...
I have a Model-View-ViewModel implemented for a searchable ListBox.
My Xaml looks like this:
(Please ignore the fact what I'm doing inside, it's just for test purposes)
<ListView ItemsSource="{Binding Path=People}" >
<ListView.ItemTemplate>
<DataTemplate>
<Border>
<...
I am attempting to bind a ListView control to a DataTable, but the WPF binding system seems to be complaining about the binding path I specify.
As an example, a GridViewColumn is defined as follows:
<GridViewColumn Header="ColumnTitle" DisplayMemberBinding="{Binding Path=/, Converter={StaticResource myConverter}}"/>
As far as I under...
How do i assign a separate context menu to the column headers of a listview in c#?
...
hi,
i want to show the selected item in a list view automatically(it isn't possible to show all items without scrolling).
this.listView.SelectedIndex = 999; selects of course an item, but it doesn't show it.
what can i use to show it automatically ?
kind regards, jeff
...
Hi, I currently have this, but it only work for the foreground colour.
Any help would be apriciated :D
<Style.Triggers>
<Trigger Property="IsSelected" Value="true">
<Setter Property="Foreground" Value="Red" />
<Setter Property="Background" Value="Green"/>
</Trigger>
</Style.Triggers>
...
I'm using a windows forms ListView in a C# application and I capture the KeyDown event on it to allow deleting a row using the Delete key. The TreeView class has the TreeNode.IsEditing property if I ever needed it but I couldn't find one in the ListView class. If the user is editing the label of a ListViewItem, I want the Delete key to...
I am using ASP.NET v3.5 and Visual Studio 2008. For some reason ListView doesn't appear in my toolbox, it doesn't show up in intellisense when coding, and if I try to include one anyways I can't access it from code behind (will give error saying it isn't declared). What am I missing here.... where is my listview!?
Update: I have v3.5 ...
I have a web page where I have to let the user dynamically add /remove comboboxes. I have a page I did a year ago where I used a datalist control to hold all the controls.
Is a listview control any better? or is there a better approach?
...
I want to change the background colour of the rectangle in the IsMouseOver trigger, is this possible?
<Window>
<Window.Resources>
<DataTemplate x:Key="StackListViewItemTemplate">
<Grid>
<Rectangle RadiusX="5" RadiusY="5" >
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0...
Hello,
Does anyone have an idea, how to create a collapsable ListView?
e.g. I've a ListView with the Columns: Name, Age, County
and the following entries:
+ Max | 20 | Switzerland
+ Joe | 25 | Germany
+ Bob | 30 | Italy
When I click on the +, I want the ListView to collapse like this:
- Max | 20 | Switzerland
Lastname: Eastw...
Hey guys,
I'll get right to the point.
I have a listview which has an ItemTemplate and EditTemplate. When I switch an item into edit mode I have a bunch of checkboxes as options. Now the problem.
in Editmode I would like to have certain options disappear (or replaced by "--") when certain checkboxes are unchecked and of course reappea...
Hi,
When I use a ListView in WPF it always generates one extra column at the end of the ListView. For example, if I define two columns in my listview and when I run it it generates those two columns plus one empty column header. Any idea how I can remove that?
Sample ListView XAML
<ListView ItemsSource="{Binding Path=SearchAttributes}...
I'm missing something here...
I need to access the values of the controls on the item that is leaving editmode, thus firing ItemUpdating.
I found how to get the key value so I know which record in the database I have to update. The problem is that I can't seem to access the values of the controls on the editing row.
the EditTemplate c...