I tried below code to retrieve directory name but it shows Length?
List<string> merchants = new List<string>();
foreach (string i in Directory.GetDirectories(Directory.GetCurrentDirectory() + "/Data/").ToList())
{
merchants.Add(i);
}
merchantTable.ItemsSource = merchants;
result is
|Length|
_______________________
|20 |
|29 |
i tried below answers but same problem
Getting the folder name from a path
WPF Code
<DataGrid x:Name="merchantTable" HorizontalAlignment="Left" Margin="15,39,0,0" VerticalAlignment="Top" Width="208" Height="343"/>
Update
i use MessageBox it shows
Returned values are Full path like C:\.....\Data\.....