2017-09-28 9 views
0

今日、私はsyncfusionツールをダウンロードし、スライディングプロパティを持つデータグリッドを使用するようになりました。右または左にスライドするときに関数を実行する方法を知りたいので、誰かが私に例を挙げることができますか?右または左にスライドするときに関数を実行する方法は? Xamarin Android Syncfusion

これは私が右または左にラインをスライドさせたときに実行されるどのようなイベントに私のコード

protected override void OnCreate(Bundle savedInstanceState) 
     { 

      base.OnCreate(savedInstanceState); 
      SetContentView(Resource.Layout.CompartirVale); 

      btnDel = FindViewById<Button>(Resource.Id.btnDelShared); 
      btnAl = FindViewById<Button>(Resource.Id.btnAlShared); 
      btnBuscarRelacionPago = FindViewById<Button>(Resource.Id.btnBuscarValeShared); 
      // 
      RelativeLayout layout = (RelativeLayout)FindViewById(Resource.Id.RelativeCompartirVale); 
      imgPDF = FindViewById<ImageView>(Resource.Id.imgPDFShared); 
      imgwhats = FindViewById<ImageView>(Resource.Id.imgWhatsApp); 
      dataGrid = new SfDataGrid(BaseContext); 
      layout.AddView(dataGrid); 
      this.dataGrid.AllowSwiping = true; 

      OrderInfoRepository viewModel = new OrderInfoRepository(); 
      dataGrid.ItemsSource = viewModel.OrderInfoCollection; 
      ActionBar.SetDisplayHomeAsUpEnabled(true); 
      // 
      SwipeView leftSwipeView = new SwipeView(BaseContext); 
      SwipeView rightSwipeView = new SwipeView(BaseContext); 
      LinearLayout editView = new LinearLayout(BaseContext); 
      LinearLayout deleteView = new LinearLayout(BaseContext); 

      ImageView editImage = new ImageView(BaseContext); 
      editImage.SetImageResource(Resource.Drawable.whatsapp); 
      editImage.SetBackgroundColor(Color.ParseColor("#FFFFFF")); 

      ImageView deleteImage = new ImageView(BaseContext); 
      deleteImage.SetImageResource(Resource.Drawable.gmail); 
      deleteImage.SetBackgroundColor(Color.ParseColor("#FFFFFF")); 

      editView.AddView(editImage, ViewGroup.LayoutParams.MatchParent, (int)dataGrid.RowHeight); 
      //editView.AddView(edit, ViewGroup.LayoutParams.MatchParent, (int)dataGrid.RowHeight); 

      deleteView.AddView(deleteImage, ViewGroup.LayoutParams.MatchParent, (int)dataGrid.RowHeight); 
      //deleteView.AddView(delete, ViewGroup.LayoutParams.MatchParent, (int)dataGrid.RowHeight); 

      leftSwipeView.AddView(editView, dataGrid.MaxSwipeOffset, (int)dataGrid.RowHeight); 
      rightSwipeView.AddView(deleteView, dataGrid.MaxSwipeOffset, (int)dataGrid.RowHeight); 

      dataGrid.LeftSwipeView = leftSwipeView; 
      dataGrid.RightSwipeView = rightSwipeView; 
      // 
     } 

のですか?

答えて

0

SfDataGridでは、スワイプ中に3つのイベントが発生します。スワイププロセスを開始すると、SwipeStartedイベントが発生します。スワイプが進行中の場合、スワイプイベントが発生します。スワイプ操作が終了すると、SwipeEndedイベントが発生します。

dataGrid.SwipeStarted += DataGrid_SwipeStarted; 
dataGrid.Swiping += DataGrid_Swiping; 
dataGrid.SwipeEnded += DataGrid_SwipeEnded; 

//Swipe ended event will fire once you the swiping process is ended 
private void DataGrid_SwipeEnded(object sender, SwipeEndedEventArgs e) 
{ 

} 
//Swiping event will fire when the swiping process is in progress 
private void DataGrid_Swiping(object sender, SwipingEventArgs e) 
{ 

}  
//Swipe started event will fire once you started the swiping process 
private void DataGrid_SwipeStarted(object sender, SwipeStartedEventArgs e) 
{ 

} 

がSfDataGridスワイプ機能とそのイベント、 UGリンクについての詳細を知るには、以下のUGリンクを参照してください、以下のコードを参照してください。また https://help.syncfusion.com/xamarin-android/sfdatagrid/swiping

を、我々はスワイプ機能を使用してサンプルを用意しました以下のリンクからダウンロードすることができます。 サンプルリンク:http://www.syncfusion.com/downloads/support/forum/132930/ze/Sample1951506069

よろしくお願いします。

関連する問題