Just in a string, that code however doesnt work. Just an example, I need it more for "user selected" to give an example if I delete a user from my database I first must select the user from my datagrid. Thats easy right. But what about when I select and go to hit my button I need it to "store" the selected users imagePath.
Once I can do that im all set for doing my ftp delete as all I will have to do is ftpFileDelete(ipAddy, + imagePath)
And im done! Just not sure how to grab the imagepath upon selecting the user to delete.
private void button2_Click(object sender, RoutedEventArgs e)
// method to extract imagePath coloum from datagrid
Stu selected = dataGrid1.SelectedItem as Stu;
if (selected == null)
MessageBox.Show("You must select a user");
if(MessageBoxResult.Yes == MessageBox.Show("Are you sure", "delete user",
// ftp delete image via imagePath from datagrid
This post has been edited by Sparukus: 04 December 2010 - 06:37 AM
Works on my machine. Are you getting an exception? You're probably getting an index out of bounds exception because your grid is empty. Please post error codes when seeking help. We aren't mind readers.
Error 1 'System.Windows.Controls.DataGrid' does not contain a definition for 'Value' and no extension method 'Value' accepting a first argument of type 'System.Windows.Controls.DataGrid' could be found (are you missing a using directive or an assembly reference?)
Cannot apply indexing  to an expression of type to system.windows.controls.datagrid
but not sure how to add it to the "selected items"
This post has been edited by Sparukus: 04 December 2010 - 07:01 AM