Questions tagged [itemssource]
374 questions
0
votes
1 answer
Why does the ScrollBar moves when I delete an ItemsSource element?
I have a grid which ItemsSource is bound to a list of string. When I remove an element from the ItemsSource, the ScrollBar moves to the removed element, which is problematic for me.
For example, my grid contains 100 rows. The user is focusing the…

Morgan M.
- 846
- 2
- 9
- 27
0
votes
2 answers
Fill MYSQL database with datagrid information in C# wpf
Believe me I have googled it. Its become clear that the C# code used on win-forms doesn't work on C# WPF for semi-obvious reasons. What's not obvious though is how to Fill a MYSQL table with modified or completely new data from a data grid. It works…

Tim
- 45
- 7
0
votes
1 answer
MVVM WPF ObservableCollection : Error addign items, ItemsSource binding
I'm having troubles adding items to an ObservableCollection while using a listbox with ItemsSource. I add dummy data for testing in my viewmodels constructor.
My viewmodel:
public class KabaDeviceListViewModel : KabaBase
{
private…

user2135342
- 17
- 3
0
votes
1 answer
Get typeof DataGrid data and cast as it
I'm having a problem with getting data of gridview and convering it into DataTable. Acually its like some of datagrids in my application have ItemsSource which I can cast as DataView, but another got ItemsSource defined in application.
For…

user13657
- 745
- 3
- 17
- 36
0
votes
1 answer
Binding Two ComboBoxs to the Same Source WPF
I have the following XAML where I have two combobox controls with the same ItemsScource. I used the IsSynchronizedWithCurrentItem=False to attempt to get them to act individually. But still changing one changes the other.
XAML

Harrison
- 3,843
- 7
- 22
- 49
0
votes
2 answers
Sort rows by clicking in the column header DataGrid with AutoGenerated columns and IEnumerable ItemsSource
Im using a datagrid filling the itemsSource by reflection (methodDefinition.Invoke(..)) the target method returns an IQueryable< T > wich T is an EntityType known at runtime.
Since the return type is IQueryable< T >, and IQueryable< T > implements…

Rafael A. M. S.
- 637
- 1
- 6
- 27
0
votes
1 answer
In ListBox cannot add Items after ItemSource is set to null
I have assigned ItemsSource property of first ListBox 'ListBox1' as the ItemsSource of another ListBox namely 'ListBox2' . If I set ListBox2's ItemsSource as null, then I am unable to add any Items further to ListBox1's ItemsSource.
Below is the…

KumarDP
- 1
- 2
0
votes
2 answers
Binding to 2 Datasources
I want to bind my Datatemplate to 2 Datasources, one datasource that will actually define what is in the ListBox and other that will determine how many ListBoxes are there and what Items in the Listbox are selected\checked.
I have following…

user2071531
- 17
- 2
0
votes
3 answers
Silverlight 3: Using list of UserControls as ItemsSource for TreeView
I want to populate a TreeView with UserControls, but I only want the Name property to show up, not the entire UserControl. The following code gives me weird crashes as soon as I add something to myUCs:
C#:
var myUCs = new…

eriksmith200
- 2,159
- 5
- 22
- 33
0
votes
1 answer
UI not updating after binding the ItemsSource
i am binding an ItemsSource from a ObservableCollection with code below
Services.RestServices.GetNotifications(UserID, ++Page).ContinueWith((task) =>
{
Dispatcher.BeginInvoke((Action)(() =>
{
…

Ashok Damani
- 3,896
- 4
- 30
- 48
0
votes
1 answer
Filter an itemssource of a listbox
i'm working on this example: http://code.msdn.microsoft.com/wpapps/Beginners-for-how-to-use-45690caa
i have inserted a new column in the table, called "category"
now i need to view in the listbox only the rows with category == "card"
this is the…

Alessandro
- 23
- 4
0
votes
2 answers
Use UIElements as ItemsSource of ListBox in Silverlight
I've noticed that if you have anything deriving from UIElement as items in a ListBox in Silverlight it renders the object as is and isn't paying any attention to settings of DisplayMemberPath and/or ListBox.ItemTemplate.
For example if you have XAML…

Alan Mendelevich
- 3,591
- 4
- 32
- 50
0
votes
1 answer
C# WPF DataGrid (ItemsSource = Database Table) - additional column: How to keep changes when (re-)sorting the DataGrid?
got a tricky question here:
I have a DataGrid that's being filled (DataGrid.ItemsSource) by an Access Table.
What's best practice to show additional columns for the user and keep changes in this column upon (re-)sorting?
In my case the additional…

ray
- 149
- 1
- 4
- 18
0
votes
1 answer
In WPF, accessing containers within ListBox
I'm creating a DerivedListBox : ListBox and a DerivedHeaderedContentControl : HeaderedContentControl, which will serve as a container for each item in the ListBox.
In order to calculate the size available for the expanded content of the…
Jim
0
votes
1 answer
How to format data for display using an ItemsSource?
I'm pretty new to WPF, so pardon my ignorance. I currently have a List of objects that I am using as an ItemsSource for a DataGrid. One of the fields of the objects is a float data type, and of course displays decimal places on the DataGrid when…

Tevis
- 729
- 1
- 12
- 27