Dinesh Santhalingam

Dinesh Santhalingam

  • NA
  • 737
  • 367.5k

Find duplicate Rows and highlights in WPF

Aug 31 2017 8:37 AM
I have a datagrid view in my WPF Form.
 
 
I want to highlight the Row duplicates based on the LicenseName.
 
I bind a datatable to my Gridview as follows.
 
  1. public DataTable table = new DataTable();  
  2.         private void showdetailsbtn_Click(object sender, RoutedEventArgs e)  
  3.         {  
  4.             table.Columns.Add("Subcategoryname", typeof(string));  
  5.             table.Columns.Add("Totallicense", typeof(int));  
  6.             table.Columns.Add("Inuse", typeof(int));  
  7.              // Here we add five DataRows.  
  8.             table.Rows.Add("Indocin", 10,10);  
  9.             table.Rows.Add("Indocin", 20, 10);  
  10.             table.Rows.Add("Hydralazine", 5,4);  
  11.             table.Rows.Add("Combivent", 11,2);  
  12.             table.Rows.Add("Dilantin", 6,3);  
  13.   
  14.             licensegridview.DataContext = table;  
  15.   }  
 Please help me to solve my problem .
 

Answers (2)