2018-10-22         Trista

WPF ListView grows bigger than it's containing Canvas

I have a ListView which is using a GridView to display a DataTable and when new rows are added to the DataTable the ListView grows as expected but when it reaches the bottom of the Canvas it carries on growing.I want it to stop when it reaches the height of the Canvas, how can I configure this?The Canvas has a dynamic height which is controlled by the DockPanel it is contained in.<Canvas> <ListView Name="listResults" ItemsSource="{Binding}"> <ListView.View> <GridView> <GridViewColumn Header="Request Time" Displa...

 wpf                     1 answers                     85 view
 2018-10-22         Harriet

How can i give alternating row background color and alternating column background color to the listview in WPF?

And also i want to color the background of headers.Please help.Thanks You need to set up a style with the AlternationIndex set. This page gives an example(defining the style)<Style x:Key="CustomListViewItemStyle" TargetType="{x:Type ListViewItem}"> <Style.Triggers> <Trigger Property="ItemsControl.AlternationIndex" Value="0"> <Setter Property="Background" Value="#2C2C2C"></Setter> </Trigger> <Trigger Property="ItemsControl.AlternationIndex" Value="1"> <Setter Property="Background" V...

 wpf                     2 answers                     87 view
 2018-10-22         Lynn

Can I make WPF RadioButtons look like CheckBoxes?

I want to have the behavior of RadioButtons, but show them as CheckBoxes to the user. Is this easy to do? Yes you can easily do using a ControlTemplate. Edit the template of a CheckBox and copy it to your RadioButton. I agree that you should do this with caution as you easily can confuse the user. [XXX]You probably can do it, but I wouldn't reccomend it. Giving a user one thing when they expect another is seldom a good idea. :D [XXX]

 wpf                     2 answers                     26 view
 2018-10-22         Prudence

In WPF, is it possible to have a combo box control, that looks like a RadioButton?

I have a whole bunch of code that is dependent on the ComboBox type, and I want to be able to use it on a new UI, but the UI that I want to use it for needs to look like a RadioButton for usability reasons. Is it possible to have a ComboBox control look like a set of RadioButtons? My suggestion would be to use an ItemsControl with a DataTemplate that would render RadioButtons. To the ItemsControl you'd bind the same thing you're binding to the ComboBox.One caveat is that you need to set the GroupName of the radio buttons to something that would be the same to the group,...

 wpf                     2 answers                     29 view
 2018-10-22         Lance

WPF render performance with BitmapSource

I've created a WPF control (inheriting from FrameworkElement) that displays a tiled graphic that can be panned. Each tile is 256x256 pixels at 24bpp. I've overridden OnRender. There, I load any new tiles (as BitmapFrame), then draw all visible tiles using drawingContext.DrawImage.Now, whenever there are more than a handful new tiles per render cycle, the framerate drops from 60fps to zero for about a second. This is not caused by loading the images (which takes in the order of milliseconds), nor by DrawImage (which takes no time at all, as it merely fills some intermediate ...

 wpf                     2 answers                     32 view
 2018-10-22         Salome

WPF Trigger to change Cursor

I need to change the cursor of a TreeViewItem in a trigger. This code works for all other properties but not Cursor:<Style.Triggers> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="QuickPhrases:TreeViewChecker.IsMouseDirectlyOverItem" Value="True"> </Condition> <Condition Property="CanSelect" Value="True"></Condition> </MultiTrigger.Conditions> <Setter Property="BorderThickness" Value="0,0,0,1" /> <Setter Property="BorderBrush" Value="Blue" ...

 wpf                     1 answers                     85 view
 2018-10-22         Ulysses

Display sum of grouped items in ListView

I'm creating a WPF TimeCard app using the MVVM design pattern, and I'm trying to display the sum (total) hours the user has clocked in grouped by each day. I have a ListView with all of the TimeCard data broken into groups using the following XAML:<ListView.GroupStyle> <GroupStyle ContainerStyle="{StaticResource GroupItemStyle}"> <GroupStyle.HeaderTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Path=Name, StringFormat=\{0:D\}}" FontWeight="Bold"/...

 wpf                     3 answers                     26 view
 2018-10-22         Moore

WPF - Confusion with namespaces and "odd" errors

I've been trying to get my head around XAML and it's namespaces and I just cannot seem to get the logics of things. For example, I'm trying to animate a gridrow's GridLength property following a tutorial. I can get the sample code to run just fine. But trying to actually port the features into my own code seems to be impossible. I always run into odd errors which doesn't occur in the source code. Animating the GridLength property isn't possible, so I need to create a new .vb file containing the code making it possible. But trying to actually reach what's in there I can't ge...

 wpf                     2 answers                     54 view
 2018-10-22         Adela

reflect values to combo box from datagrid on Selection Changed event

I have a combobox and textbox using which values are filled into DataGridViewfor display purpose.The datagriduses SelectionChanged event.I am Trying to reflect the same data (when the user moves keys up and down or on mouse click) onto the combobox and textbox on SelectionChanged event of datagridPrivate Sub DataGridView1_SelectionChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGridView1.SelectionChangedcombobox.Text = DataGridView1.CurrentRow.Cells("DatabaseTable_ColumnName1").Value.ToString()textbox.Text = DataGridView1.CurrentRow.Cells("Da...

 wpf                     1 answers                     93 view
 2018-10-22         Bertram

RadGridView GridViewSelectColumn even when disabled still selectable

I am using a Telerik Gridview to give the option of selecting all to users.I am using styles to make a few checkboxes disable which works fine. But, still users can select the disabled by clicking on the disabled check box or by selecting all.Anyone can help? Thanks in advance<TelerikGridView:RadGridView Name="dataGridView" Height="485" Grid.Row="0" AutoGenerateColumns="False" ItemsSource="{Binding Path=Items, Mode=TwoWay}" IsReadO...

 wpf                     1 answers                     19 view
 2018-10-22         Clare

Is SQL Azure suitable for Desktop client applications

I have a client that runs a small business. They need a custom database solution and I'm looking into various options. My experience is limited to .NET using local SQL Servers (no ASP.NET), however, this client is non-technical and would benefit from being able to outsource the DBA tasks. I'm a complete Azure noob, I just scanned the tutorials and they all appear targeted at developing MVC ASP solutions. The client doesn't need a browser based solution. A fat desktop client used from different geographical offices would be the least expensive option I can deliver. I'm just...

 wpf                     2 answers                     97 view
 2018-10-22         Benjamin

Implementing INotifyPropertyChanged with POCO

It's not clear to me on how to wire-up an entity that reflects the binding context of a ListViewItem.XAML: <ListView x:Name="AssignedMaterialsList" Grid.Row="7" Grid.ColumnSpan="2" ItemsSource="{Binding AssignedMaterials}" SelectedItem="{Binding SelectedAssignedMaterial}"> <ListView.ItemTemplate> <DataTemplate> <ViewCell> <ViewCell.View> <Grid> <Grid.RowDefinitions> <RowDefinition /> ...

 wpf                     4 answers                     5 view
 2018-10-22         Ferdinand

When I run wpf project application, combobox is not responding to the mouse click and drop down list is not appearing

I am working on wpf application and I am kinda new. I have added combobox to the stackpanel where first child is menu and second child combobox. Look at the code below:<Grid> <StackPanel> <Menu Background="Chocolate" Height="30" VerticalAlignment="Top"> <MenuItem Header="File"></MenuItem> <MenuItem Header="Edit"></MenuItem> <MenuItem Header="View"></MenuItem> <MenuItem Header="Help"></MenuItem> </Menu> <ComboBox Width="100" Height="30" Loade...

 wpf                     1 answers                     85 view
 2018-10-22         Roxanne

how to make first row of DataGrid ReadOnly in wpf

i have a data from database in Datagrid and i want to edit all data without first row: I want to use only first row as a read-only and others I want to edit Jaama Rs and BaNaam Amount.Here is the code: <DataGrid AutoGenerateColumns="False" Height="463" HorizontalAlignment="Left" Margin="10,43,0,0" x:Name="gridcustomer" VerticalAlignment="Top" Width="911" IsReadOnly="True" ColumnWidth="*"> <DataGrid.Columns> <DataGridTextColu...

 wpf                     1 answers                     27 view
 2018-10-22         Rosalind

How to resize textbox upon inserting text programmatically in WPF application?

I am kinda new to WPF. I am programatically inserting text into textbox. This textbox is added to stackpanel programatically.The problem is the textbox is not resizing. I have set textbox textwrapping to wrap.textbox.TextWrapping=TextWrapping.Wrap;Please guide me, how to set the text box resize after assigning text to it. textbox.Text="some long paragraph text"; Increase the width of textbox or define MaxWidth and use this TextWrapping Property.It May help You. [XXX]after bit struggle, finally I figured out the solution. In my case, by saying resize I mean, the textbo...

 wpf                     2 answers                     44 view
 2018-10-22         Joyce

My WPF UI disappears when I set a style for Grid in App.xaml

I have a window with a grid containing an image and some buttons:<Window x:Class="Wormholes.Views.TitleWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:Wormholes" xmlns:commands="clr-namespace:Wormholes.Commands" mc:Ignorable="d" Title="Warning: Weird Wormholes!" Height="450" W...

 wpf                     1 answers                     128 view

Page 1 of 519  |  Show More Pages:  Top Prev Next Last