2011-07-18 11 views
1

WPFのスキャッタビュー内にデータグリッドを配置しました。私はタッチして、データグリッドから行を選択することはできません。タッチダウンイベントでは、選択されたセルの値が返されます。しかし、行全体を選択したり強調表示したりすることはありません。Scatterview Surface2アプリケーション内のDatagrid WPF

<Grid Background="{StaticResource WindowBackground}" > 
    <s:ScatterView> 
     <s:ScatterViewItem Width="500" Height="300" CanRotate="False" Orientation="0" > 
      <DataGrid AutoGenerateColumns="True" TouchDown="DgTest_TouchDown" Name="DgTest" /> 
     </s:ScatterViewItem> 
    </s:ScatterView> 

答えて

1

次のことを試してみてください。

// Declare event handlers for the Grid 
    DgTest.PreviewTouchDown += new EventHandler<TouchEventArgs>(On_DgTest_PreviewTouchDown); 
    DgTest.PreviewTouchUp += new EventHandler<TouchEventArgs>(On_DgTest_PreviewTouchUp); 

    void On_DgTest_PreviewTouchDown(object sender, System.Windows.Input.TouchEventArgs e) 
    { 

    //You need to capture the touch before the ScatterViewItem handles its own touch which will  
    //block you from receiving the touch up event 

    DgTest.CaptureTouch(e.TouchDevice); 
    e.Handled = true; 

    } 

    void On_DgTest_PreviewTouchUp (object sender, System.Windows.Input.TouchEventArgs e) 
    { 
    DgTest.ReleaseAllTouches(); 
    }