IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Windows Presentation Foundation Discussion :

Probleme de scrolling avec la Datagrid de WPFToolKit


Sujet :

Windows Presentation Foundation

Mode arborescent

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Février 2004
    Messages
    62
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 62
    Par défaut Probleme de scrolling avec la Datagrid de WPFToolKit
    Bonjour j'ai une Datagrid avec une colone que j'ai templater qui represente une checkbox. Jusqu'ici tout va bien.

    Parcontre en execustion lorsque je coche admetton les 5 premiere rangée et que je scroll pour aller plus bas je me rend compte qu'il y en a d'autre de sélectionner. Ce n'est pas moi qui les a sélectionner. Tous cela c'est produit lorsque j'ai scroller pour aller voir d'autre enregistrement.

    Voici des copie d'écran démontrant mon probleme ( assez space lol )

    1. Datagrid_prise_1.JPG : Je rentre dans ma fenetre je sélectionne les 5 premier
    2. Datagrid_prise_2.JPG : Je scroll vers le bas tous de suite apres avoir coché mes 5 enregistrement
    3. Datagrid_prise_3.JPG Je reviens dans le haut de ma grille avec la scroll bar et la sélection initiale a changé.

    A mon avis c'est un probleme dans le xaml. Car j'ai commenter tous le code behind qui etais en rapport avec cette sélection et le problème persiste toujours.

    Je vais paster mon xaml(Les ligne interessante sont en bold) de mon user control si vous pourriez avoir une idée pour résoudre mon problème ce serais sympas.

    Merci Beaucoup.
    Pascal Wick
    Programmeur-Analyste Sr.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    
    <UserControl  x:Class="JMB.FRAMEWORK.WPF.UserControls.JMBSearchControl"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:jmb="clr-namespace:JMB.Framework.WPF;assembly=JMB.Framework.WPF"
        xmlns:jmbGrid="clr-namespace:Microsoft.Windows.Controls;assembly=WpfToolkit"
        xmlns:local="clr-namespace:JMB.FRAMEWORK.WPF.UserControls"
        Height="544" Width="422" Name="ctl" Style="{DynamicResource JMBSearchControlStyle}" >
        <UserControl.Resources>
            <ControlTemplate x:Key="grdMultiSelectTemplateAutoGenerateColumns" TargetType="{x:Type jmbGrid:DataGrid}">
                <jmbGrid:DataGrid AutoGenerateColumns="True" 
                                  ItemsSource="{Binding Path=Datasource.DefaultView, ElementName=ctl}"
                                  SelectionChanged="DataGrid_SelectionChanged">                               
                    <jmbGrid:DataGrid.Columns>
                        <jmbGrid:DataGridTemplateColumn Width="60">
                            <jmbGrid:DataGridTemplateColumn.Header>
                                <TextBlock HorizontalAlignment="Center">Sélection</TextBlock>
                            </jmbGrid:DataGridTemplateColumn.Header>
                            <jmbGrid:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <CheckBox x:Name="chkCol" Checked="chkCol_Checked" Unchecked="chkCol_Unchecked"></CheckBox>
                                </DataTemplate>
                            </jmbGrid:DataGridTemplateColumn.CellTemplate>
                        </jmbGrid:DataGridTemplateColumn>
                    </jmbGrid:DataGrid.Columns>       
                </jmbGrid:DataGrid>
            </ControlTemplate>        <ControlTemplate x:Key="grdSingleSelectTemplateAutoGenerateColumns" TargetType="{x:Type jmbGrid:DataGrid}">
                <jmbGrid:DataGrid AutoGenerateColumns="True" ItemsSource="{Binding Path=Datasource.DefaultView, ElementName=ctl}">
                </jmbGrid:DataGrid>
            </ControlTemplate>
            <Style x:Key="JMBSearchControlStyle" TargetType="{x:Type UserControl}">
                <Style.Triggers>
                    <Trigger Property="local:JMBSearchControl.DisplayDataAtOpening" Value="True">
                        <Setter Property="local:JMBSearchControl.VResultVisibility" Value="Visible"/>
                    </Trigger>
                    <Trigger Property="local:JMBSearchControl.DisplayDataAtOpening" Value="False">
                        <Setter Property="local:JMBSearchControl.VResultVisibility" Value="Collapsed"/>
                    </Trigger>
                    <Trigger Property="local:JMBSearchControl.MultiSelect" Value="True">
                        <Setter Property="local:JMBSearchControl.GridTemplate" Value="{StaticResource grdMultiSelectTemplateAutoGenerateColumns}"/>
                    </Trigger>
                    <Trigger Property="local:JMBSearchControl.MultiSelect" Value="False">
                        <Setter Property="local:JMBSearchControl.GridTemplate" Value="{StaticResource grdSingleSelectTemplateAutoGenerateColumns}"/>
                    </Trigger>
                </Style.Triggers>
            </Style>
        </UserControl.Resources>   
         
        <!--Definition du controle-->
        <Grid Width="379" Height="507" Name="_grdMain">
            <StackPanel Orientation="Vertical">
                <jmb:View jmb:ViewItem.LabelPadding="3" 
                              jmb:ViewItem.LabelPosition="Left" 
                              Name="vSearch" Height="161" 
                              MinHeight="32.35" MinWidth="365" 
                              Width="371" 
                              Margin="3.2,10,14.5,0" 
                              VerticalAlignment="Top"
                              jmb:ViewItem.ContentPadding="2"
                              >
                    <jmb:View.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Vertical"></StackPanel>
                        </ItemsPanelTemplate>
                    </jmb:View.ItemsPanel>
                    <TextBox Name="txtSearch1" TextChanged="txtSearch1_TextChanged"  Height="25" Width="290" jmb:ViewItem.LabelContent="Critère1"/>
                    <TextBox Name="txtSearch2"   Height="25" Width="290" jmb:ViewItem.LabelContent="Critère1"/>
                    <TextBox Name="txtSearch3"   Height="25" Width="290" jmb:ViewItem.LabelContent="Critère1"/>
                    <TextBox Name="txtSearch4"   Height="25" Width="290" jmb:ViewItem.LabelContent="Critère1" Visibility="{Binding Path=VResultVisibility, ElementName=ctl}"/>
                    <Button  Click="btnSearch_Click"  Name="btnSearch" Width="25" Height="25" IsEnabled="False"></Button>
                </jmb:View>
                <jmb:View Margin="0,5"
                          Name="vResult" 
                          Height="323" Width="369" Visibility="{Binding Path=VResultVisibility, ElementName=ctl}">
                    <jmbGrid:DataGrid                   
                        Name="grdResult" 
                        Width="369" Height="327" MinHeight="327" MinWidth="369"
                        Template="{Binding Path=GridTemplate, ElementName=ctl}"
                        >                    
                    </jmbGrid:DataGrid>                
                </jmb:View>
            </StackPanel>
        </Grid>    
    </UserControl>
    Images attachées Images attachées    

Discussions similaires

  1. Probleme de scroll bar avec IE.
    Par defacta dans le forum Balisage (X)HTML et validation W3C
    Réponses: 5
    Dernier message: 30/07/2007, 14h36
  2. probleme avec le dataGrid
    Par obydissonn dans le forum C#
    Réponses: 1
    Dernier message: 05/05/2007, 09h39
  3. probleme avec le dataGrid
    Par obydissonn dans le forum C#
    Réponses: 2
    Dernier message: 02/05/2007, 15h45
  4. probleme avec les datagrid
    Par zalalus dans le forum ASP.NET
    Réponses: 2
    Dernier message: 26/04/2007, 16h00
  5. [FLASH 8] Probleme de scrolling avec clip
    Par Mr-Hunter dans le forum Flash
    Réponses: 1
    Dernier message: 28/11/2005, 22h04

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo