Click here to Skip to main content
15,511,378 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Data Binding Problem Pin
#realJSOP25-Apr-09 3:52
mva#realJSOP25-Apr-09 3:52 
GeneralRe: Data Binding Problem Pin
Mark Salsbery25-Apr-09 7:58
Mark Salsbery25-Apr-09 7:58 
QuestionMaking a template for a ListView in WPF ? Pin
Mohammad Dayyan23-Apr-09 5:55
Mohammad Dayyan23-Apr-09 5:55 
QuestionRe: Making a template for a ListView in WPF ? Pin
Mark Salsbery23-Apr-09 8:04
Mark Salsbery23-Apr-09 8:04 
AnswerRe: Making a template for a ListView in WPF ? Pin
Mohammad Dayyan23-Apr-09 8:21
Mohammad Dayyan23-Apr-09 8:21 
GeneralRe: Making a template for a ListView in WPF ? Pin
Mark Salsbery23-Apr-09 8:55
Mark Salsbery23-Apr-09 8:55 
GeneralRe: Making a template for a ListView in WPF ? Pin
Mohammad Dayyan23-Apr-09 9:13
Mohammad Dayyan23-Apr-09 9:13 
GeneralRe: Making a template for a ListView in WPF ? Pin
Mark Salsbery23-Apr-09 9:29
Mark Salsbery23-Apr-09 9:29 
Sure - you can re template the control, but you need to provide
the items presenter to show the items.

Here's a default template for a ListView you can use as a starting place:
<SolidColorBrush x:Key="ListBorder" Color="#828790"/>
<Style x:Key="ListViewStyle1" TargetType="{x:Type ListView}">
    <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
    <Setter Property="BorderBrush" Value="{StaticResource ListBorder}"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
    <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
    <Setter Property="VerticalContentAlignment" Value="Center"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type ListView}">
                <Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="1">
                    <ScrollViewer Padding="{TemplateBinding Padding}" Focusable="false">
                        <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                    </ScrollViewer>
                </Border>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                    </Trigger>
                    <Trigger Property="IsGrouping" Value="true">
                        <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>


Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Making a template for a ListView in WPF ? Pin
Mohammad Dayyan23-Apr-09 9:45
Mohammad Dayyan23-Apr-09 9:45 
Questionbinding problem Pin
spurnd22-Apr-09 22:48
spurnd22-Apr-09 22:48 
AnswerRe: binding problem Pin
Pete O'Hanlon23-Apr-09 1:28
mvaPete O'Hanlon23-Apr-09 1:28 
GeneralRe: binding problem Pin
User 171649223-Apr-09 2:25
professionalUser 171649223-Apr-09 2:25 
GeneralRe: binding problem Pin
Pete O'Hanlon23-Apr-09 2:42
mvaPete O'Hanlon23-Apr-09 2:42 
QuestionPrint Datatable Pin
Prajeesh22-Apr-09 20:06
Prajeesh22-Apr-09 20:06 
AnswerRe: Print Datatable Pin
Pete O'Hanlon23-Apr-09 23:17
mvaPete O'Hanlon23-Apr-09 23:17 
QuestionWPF UserControl Library - I'm at a loss [modified] Pin
#realJSOP22-Apr-09 4:58
mva#realJSOP22-Apr-09 4:58 
AnswerRe: WPF UserControl Library - I'm at a loss Pin
barker77022-Apr-09 7:06
barker77022-Apr-09 7:06 
GeneralRe: WPF UserControl Library - I'm at a loss Pin
led mike23-Apr-09 11:00
led mike23-Apr-09 11:00 
AnswerRe: WPF UserControl Library - I'm at a loss Pin
Pete O'Hanlon23-Apr-09 1:16
mvaPete O'Hanlon23-Apr-09 1:16 
GeneralRe: WPF UserControl Library - I'm at a loss Pin
#realJSOP23-Apr-09 3:45
mva#realJSOP23-Apr-09 3:45 
JokeRe: WPF UserControl Library - I'm at a loss Pin
Michael Bookatz23-Apr-09 5:34
Michael Bookatz23-Apr-09 5:34 
GeneralRe: WPF UserControl Library - I'm at a loss Pin
#realJSOP23-Apr-09 5:56
mva#realJSOP23-Apr-09 5:56 
GeneralRe: WPF UserControl Library - I'm at a loss Pin
led mike23-Apr-09 11:05
led mike23-Apr-09 11:05 
GeneralRe: WPF UserControl Library - I'm at a loss Pin
0x3c023-Apr-09 11:21
0x3c023-Apr-09 11:21 
QuestionClearing the screens Pin
Hema Bairavan22-Apr-09 1:28
Hema Bairavan22-Apr-09 1:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.