How to set event handler for AutoGeneratingColumn in my scenario

BitSmithy 2,041 Reputation points
2021-02-12T20:50:44.527+00:00

Hello,

If I decare such class

public class BSDataGridT : DataGrid
{
}

I can see event AutoGeneratingColumn and I can set event handler for it.

But if I declare this class using general parameter

public class BSDataGridT<T> : DataGrid
{
}

I cant see this event, and I cant declare event handler for this event

How to declare event handler for AutoGeneratingColumn in the second described class.

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Yan Gu - MSFT 2,676 Reputation points
    2021-02-15T02:15:33.523+00:00

    Hello,

    Welcome to Microsoft Q&A.

    public class BSDataGridT<T> : DataGrid  
    {  
        public BSDataGridT()  
        {  
            this.AutoGeneratingColumn += BSDataGridT_AutoGeneratingColumn;  
        }  
      
        private void BSDataGridT_AutoGeneratingColumn(object sender, DataGridAutoGeneratingColumnEventArgs e)  
        {  
              
        }  
    }  
    

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.