Click here to Skip to main content
15,613,470 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want when user clicked on datagrid row then show popup under row
how can i do this?
ridoy 16-Dec-12 7:09am
ARIA 5 16-Dec-12 7:18am    
I've already reviewed this address,
but this method does not work because tooltip is not permanent.
chester_it21 16-Dec-12 15:38pm    
hi, see my solution

1 solution

You can use
in XAML into Control DataGrid

to be this :

and in Code Behind :

private void DataGrid1SelectedCellsChanged(object sender, System.Windows.Controls.SelectedCellsChangedEventArgs e)
                var dataView = dataGrid1.CurrentCell.Item as DataRowView;
                if (dataView == null)
// some code her if not have value selected
                    var dataRow1 = dataView.Row[0].ToString();
                    var dataRow2 = dataView.Row[1].ToString();
                    var dataRow3 = dataView.Row[2].ToString();
// it depends on the number of row
		    MessageBox.Show("You have selected :" + dataRow1 +"," + dataRow2 +"," + dataRow3 );

            catch (Exception ex)
Share this answer
ARIA 5 17-Dec-12 3:42am    
Thanks chester_it21
your solution dose not work,
i think after click on specific row we must cast datgridRow to specific class
however thanks for your help,
but i want show popup under specific row,so how to show popup at position of mouse pointer.
chester_it21 17-Dec-12 21:42pm    
hi ARIA, what you want to show in Popup...??
datarow from datagrid..??
ARIA 5 18-Dec-12 3:41am    
hi Chester thanks,
i have one popup that contains some tools.
chester_it21 17-Dec-12 21:46pm    
or see this for reference :
ARIA 5 18-Dec-12 4:19am    
thank u very much.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900