Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6797975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:40:29+00:00 2026-05-26T18:40:29+00:00

I have a WPF dialog with a DataGrid on it. What I want to

  • 0

I have a WPF dialog with a DataGrid on it. What I want to do is be able to drop a file or folder onto the Datagrid and have the information show up. Each row will represent each file. For the life of me I can’t figure out how to insert the data and have the rows show up.

Here is the drop code…

public partial class SplitWindow : UserControl
{

    public SplitWindow()
    {
       this.InitializeComponent();
    }

    private void FilesDropped(object sender, System.Windows.DragEventArgs e)
    {

       if (e.Data.GetDataPresent(DataFormats.FileDrop))
       {
           DropDataGrid.Items.Clear(); 

           string[] droppedFilePaths = e.Data.GetData(DataFormats.FileDrop, true) as string[];

           foreach (string droppedFilePath in droppedFilePaths)
           {
               string name =          System.IO.Path.GetFileNameWithoutExtension(droppedFilePath);
               // insert row???
           }
       }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:40:29+00:00Added an answer on May 26, 2026 at 6:40 pm
    1. Create an ObservableCollection<string>
    2. Set that collection as the ItemsSource for the DataGrid
    3. Add file names to collection.

    You’ll have to mess around with the xaml to get things to look right.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WPF application where i show a dialog with nrDialog.WindowStartupLocation = WindowStartupLocation.CenterScreen;
I have a WPF project, and there is one dialog that I will re-use
I have a working WPF dialog that uses DataGrid. The DataGrid is set to
I have a WPF DataGrid that increases in height when I add data to
We have a WPF application that has a print preview dialog. When we create
In my WPF application I have created a window and show it as a
I have a WPF Toolkit DataGrid bound to an ObservableCollection of Car in my
I have a WPF application written in C#. This application has dialog windows in
I have a wpf datagrid that has it's columns generated dynamically in code and
I have seen this thread: WPF image resources and applied the information there. But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.