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

How To Insert Or Add Emojis In Microsoft Teams Status Message

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.