Donate

Loop Through Datagrid In WPF (ItemSource Is Type Observable Collection)

Hello,

Assuming the databinding source of WPF Datagrid is of type ObservableCollection, the code below will loop through the WPF DataGrid.
  var row = GetDataGridRows(dgScripts);  
  foreach (DataGridRow r in row)  
  {  
     CScriptsInfo info = (CScriptsInfo)r.Item;  
     if(info.prog_name.ToString().Contains(txtScriptName.Text.Trim().ToUpper()))  
     {  
        r.IsSelected = true;  
     }  
  }

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

Remove Cookies From CookieContainer Class

How To Test Or Check Dead Pixels And Backlight Bleed On Your Monitor Using Dead Pixel Checker In Windows 11