hello I've been struggling in this part of my code in which I need to instantiate a window where if the student record is found in my list when I search it, it will open another window of it so that it can be edited.
Scenario is for example like this. my list has a student named : James and Roger. when I input Roger in the textbox and search for it, another window will pop up and displays all of Roger's details. how can I do that? I tried it but everytime I searched Roger's name, James' details pop up ( cs it was the first detail added in the list.) I'll be waiting for the response. Thanks in advance. Here is my code.
public partial class EditStudent : Window
{
List<Data> editstudentdata = new List<Data>();
public EditStudent(List<Data>studentdata)
{
InitializeComponent();
editstudentdata = studentdata;
DataContext = studentdata;
}
void searchbtn(object sender, RoutedEventArgs e)
{
for ( int i = 0; i < editstudentdata.Count ; i++ )
{
if ( editstudentdata[i].idnum == searchidnumbox.Text)
{
( What should I input here? )
}
if ( editstudentdata[i].idnum != searchidnumbox.Text)
{
resultblock.Text = "Data not found!!!" ;
}
}
}