Hi
I have an doubt
I have images in my local directory
I need to display those images in a grid view in WPF covering both columns and rows
Exactly to say i need those images to be displayed in the matrix format
can u please help how can i achieve this in WPF datagrid
Thanks in Advance
Mageshwaran RPosted Nov 18, 2019, 11:15 AM
Piyush PansuriyaPosted Oct 11, 2018, 1:27 AM
Bharat KumarPosted Oct 10, 2018, 10:42 PM
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing.Imaging;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
{
///
/// Interaction logic for MainWindow.xaml
///
public partial class MainWindow : Window
{
public class MyItemType
{
//public byte[] Icon { get; set; }
}
{
InitializeComponent();
imagelist();
}
private void imagelist()
{
list.Add(new MyDataObject() { ImageFilePath = new Uri("file:///C:/Users/user/Downloads/1.png") });
list.Add(new MyDataObject() { ImageFilePath = new Uri("file:///C:/Users/user/Downloads/2.jpg") });
list.Add(new MyDataObject() { ImageFilePath = new Uri("file:///C:/Users/user/Downloads/3.jpg") });
dataGrid1.ItemsSource = list;
}
public class MyDataObject
{
public Uri ImageFilePath { get; set; }
}
}
Bharat KumarPosted Oct 10, 2018, 10:41 PM
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp1"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
Piyush PansuriyaPosted Oct 10, 2018, 6:05 AM