Questions tagged [itemsource]

134 questions
1
vote
1 answer

How to bind the ItemSource inside the DataGrid to an element outside the DataContext, eg. ViewModel in Silverlight 4

I have a DataGrid with some text columns and a button. I want to bind button to a command on the ViewModel. Since, Columns are inside the context of the ItemSource, i want to change the DataContext for the button to something outside the DataGrid(to…
Amar
  • 11
  • 2
1
vote
1 answer

How to update ItemSource of ContextMenu with using MVVM

I have a ContextMenu and I am trying to bind a list from my ViewModel class. I set this List with using two different Methods. OnZonesReceived method is triggered when changes are made and OnItemReceivedmethod is triggered when selected tab item…
1
vote
2 answers

Create a custom DataGrid's ItemsSource - not working

I am trying to replicate the solution from Create a custom DataGrid's ItemsSource but my rows are not populating. The columns appears with the correct headers, but no data in the grid. Can anyone please tell me what I am doing wrong? using…
1
vote
1 answer

Update items in a listview in real time with Xamarin forms pcl - c #

My goal is to make the update of a listview of records in real time. in the load page i set: List myitems = new List(); ... ... listView.IsVisible = false; listView.RowHeight = 55; …
Mr. Developer
  • 3,295
  • 7
  • 43
  • 110
1
vote
4 answers

Add prefix to ItemSource values in ComboBox

This is in my app.xaml file (cut down):
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
1
vote
5 answers

Arrange dynamic list of buttons horizontally in dockpanel

I am using dockpanel to display a list of buttons that are read from an itemsource and want to display them horizontally but it displays them vertically. I am using the following code:
user3625024
  • 319
  • 1
  • 2
  • 11
1
vote
2 answers

WPF templating with ObservableCollection

I am working on a local project and I have some issues. I want to create a template for some results that have 3 strings(where 1 is a hyperlink) and a picture and they come as an ObservableCollection of results type binded to ItemSource. public…
1
vote
1 answer

Bind Usercontrol contained in a ObservableCollection in a WrapPanel

I have a class defined this way: public class CustomClass { string Name; int Age; Usercontrol usercontrol; } where Usercontrol is a visual element that I want to insert in a WrapPanel. CustomClass is organized in…
Hamma
  • 183
  • 1
  • 4
  • 12
1
vote
1 answer

How to dynamically add UserControl to ItemsControl?

I have a WPF UserControl which is dynamically created at runtime. Depending on user interaction, from 1-5 of these controls is created and should be added to the UI. I have an ObservableCollection PlayerSpecViews in the xaml.cs…
IAbstract
  • 19,551
  • 15
  • 98
  • 146
1
vote
1 answer

Get Value Off Checkboxes in Datagrid

I want to get the value off checkbox from a datagrid in WPF This is my code [XAML]
Coder Passion
  • 65
  • 1
  • 11
1
vote
1 answer

Bound DataGrid ItemSource retuen null or blank objects

My DataGrid's ItemSource returns empty objects or null. What can be the case ? All properties are bound. While adding data, it shows proper on the Grid, but while retrieving it gives null. XML
Tvd
  • 4,463
  • 18
  • 79
  • 125
1
vote
2 answers

How to add templates for datagrid columns?

I'm adding dynamically an itemsource to the datagrid: datagrid.ItemsSource = _table.DefaultView; foreach (DataColumn column in _table.Columns) { if (column.DataType == typeof(bool)) { …
Nerielle
  • 984
  • 1
  • 11
  • 29
0
votes
3 answers

DatatGrid Itemsource using Linq i cant select any record except first

Hey im currently having problems with WPF Datagrid using linq, currently im displaying a group of records from three tables into a datagrid, this works fine and i retrieve all the relevant information correctly. However when i load the datagrid and…
Halfie44
  • 33
  • 1
  • 6
0
votes
0 answers

How to retrieve the value in a treeview while the itemsource of the treeview is bound to a combobox

I have a dictionary as the itemsource of a combobox, the displayed value is the key. public Dictionary> LoadedTemplateViews; In XAML, I have a combobox and a treeview:
BabyHai
  • 89
  • 1
  • 9
0
votes
1 answer

Pass in current item of a list as constructor's argument in XAML

I have CarouselView that has a Dictionary
Clay H
  • 1
  • 1
1 2
3
8 9