user9107638
user9107638

Reputation:

create custom grid control wpf

hi i want load some data from database but i dont want to use default wpf grid control i want create a tiny control just like this pic: control

And in some way, like these, I display the information in control:

foreach (var element in data)
{
    myControl.newitem.Title = element.Title;
 myControl.newitem.Content = element.Content;
 myControl.newitem.Image = element.Image;
 myControl.newitem.Date = element.Date ;
}

Upvotes: 0

Views: 429

Answers (1)

Markus
Markus

Reputation: 2261

I would use the standard WPF ItemsControl for this.

<ItemsControl ItemsSource="{Binding data}">
  <ItemsControl.ItemTemplate>
    <DataTemplate>
        <Grid>
            ....
        </Grid>
    </DataTemplate>
  </ItemsControl.ItemTemplate>
</ItemsControl>

Upvotes: 1

Related Questions