2017-09-28 15 views
0

오늘 나는 syncfusion 도구를 다운로드하고 슬라이딩 속성을 가진 데이터 격자를 사용하여, 오른쪽 또는 왼쪽으로 슬라이드 할 때 함수를 실행하는 방법을 알고 싶습니다. 누군가가 내게 예제를 줄 수 있습니까?오른쪽 또는 왼쪽으로 밀 때 함수를 실행하는 방법은 무엇입니까? Xamarin 안드로이드 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에서 스 와이프 중에 세 가지 이벤트가 발생합니다. 스 와이프 프로세스를 시작하면 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

감사합니다. Divakar.