I am developing a User Interface to view the student details from a student Database. I have three datagrids in my application as follows:
The first datagrid at the left is for selecting the Student from the list and the other two must display the information about the selected student.
the Student Info datagrid is dependent on Select a Student datagrid and the Personal Information datagrid is dependent on Student Info datagrid.
I have done the database connectivity to populate the list of students in the Select a Student datagrid, but I dont know how to proceed further. So far I have understood that I should create a DataGridView.CellClick
Event.
Could anybody suggest me to proceed further.
You can bind the ItemsSource
of the Personal Information datagrid to the SelectedItem
of the Student Info datagrid and the ItemsSource of the Student Info datagrid to the SelectedItem
of the Select a Student datagrid.
That way the Student Info datagrid will automatically update as you select a student and the Student Info datagrid will automatically update as you select an item in the Student Info datagrid.
The Binding:
ItemsSource="{Binding ElementName=StudentDataGrid, Path=SelectedItem.StudentInfo}"
Replace the ElementName and the Path with the name of your datagrids and the correct property.