Filter Dataset/Current DG Source

I have a DataGrid bound to a dataset - what I want to do is, when the user select s a row, to filter the grid's source and bind labels with details from the dataset  - specific to the row selected (datagrid contains product list - selecting row will bind labels above datagrid to product details)
tbaseflugAsked:
Who is Participating?
 
AGBrownCommented:
Create an event handler for the SelectedIndexChanged event. Inside that, you can pick up the new selected item by using:
myDataGrid.SelectedItem.

This will be a DataGridItem (can be cast down to a TableRow) from the datagrid. From this you can get your row identifier (product ID or name) and use that to get the details from the database that you want. Alternatively, if all the info is in the row, then you can just pick it out and write it to the labels.

Andy
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.