logo
down
shadow

ScrollViewer in datagrid doesn't work as attribute


ScrollViewer in datagrid doesn't work as attribute

By : user2949549
Date : November 17 2020, 01:00 AM
Does that help You need to give your Grid a height, or change your StackPanel to something that limits the size of it's children, such as a DockPanel or Grid.
code :
<DataGrid x:Name="dg" Height="400" />
<Grid>
    <DataGrid x:Name="dg" ... />
</Grid>   


Share : facebook icon twitter icon
Silverlight - DataGrid in Scrollviewer, Column.Width="*" makes datagrid take several screen-widths

Silverlight - DataGrid in Scrollviewer, Column.Width="*" makes datagrid take several screen-widths


By : servoyguru
Date : March 29 2020, 07:55 AM
To fix the issue you can do If you remove
dg.Columns[2].Width = new DataGridLength(1, DataGridLengthUnitType.Star);
ScrollViewer - scroll does not work with images inside ScrollViewer

ScrollViewer - scroll does not work with images inside ScrollViewer


By : AMMZ
Date : March 29 2020, 07:55 AM
To fix the issue you can do What solved this, in the end, was adding a static height to the ScrollViewer. I realise noone could have seen this as I omitted the part of the code that shows that this is inside a PivotItem.
According to this discussion: http://forums.create.msdn.com/forums/t/84933.aspx a ScrollViewer stops working properly when it is inside a Pivot, unless it has a static height defined.
Binding DataGrid columns to a SQL database doesnt work

Binding DataGrid columns to a SQL database doesnt work


By : user2999820
Date : March 29 2020, 07:55 AM
this will help In the property window, on the right of the property "Binding", you have a little square on wich you can click and select "Create binding". Then click on "more paremeter" and then you can choose your string format
For example in this case :
code :
StringFormat=\{0:d\}}"
C# WPF DataGrid Binding with ObservableCollection doesnt work

C# WPF DataGrid Binding with ObservableCollection doesnt work


By : Dean H
Date : March 29 2020, 07:55 AM
With these it helps If you populating a list and then assigning that to the list that is bound to the datagrid, then you need to implement INotifyPropertyChanged for that.
code :
<DataGrid x:Name="DataNahrungsmittel" ItemsSource="{Binding Path=NahrungsmittelKategorie}"></DataGrid>
NahrungsmittelKategorie = ListNahrungsmittel;
private static ObservableCollection<NahrungsmittelKategorie> nahrungsmittelKategorie = new ObservableCollection<NahrungsmittelKategorie>();

public static ObservableCollection<NahrungsmittelKategorie> NahrungsmittelKategorie
{
    get { return nahrungsmittelKategorie; }
    set { nahrungsmittelKategorie = value; NotifyPropertyChanged("NahrungsmittelKategorie")};
}
Setting the cell and row pointer in datagrid doesnt work

Setting the cell and row pointer in datagrid doesnt work


By : Mi Diez
Date : March 29 2020, 07:55 AM
this one helps. I have a form with a datagrid that has a list of records from the table. When the user selects one record to edit its value I want to return to the same row (record) in the datagrid and display it as selected. Of course the datagrid should show the new(edited) values. The code in the EditButton does all of it, but the result is not what expected. , As requested:
To set the current selected cell:
code :
this.dataGridView1.CurrentCell = this.dataGridView1[YourColumn,YourRow];
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org