Click here to Skip to main content
14,267,280 members

Silverlight / WPF

 
GeneralRe: DP not Working Pin
Kevin Marois28-Jul-16 13:29
professionalKevin Marois28-Jul-16 13:29 
GeneralRe: DP not Working Pin
PureNsanity28-Jul-16 13:51
professionalPureNsanity28-Jul-16 13:51 
GeneralRe: DP not Working Pin
Kevin Marois28-Jul-16 14:14
professionalKevin Marois28-Jul-16 14:14 
SuggestionRe: DP not Working Pin
Richard Deeming29-Jul-16 2:11
mveRichard Deeming29-Jul-16 2:11 
GeneralRe: DP not Working Pin
Richard Deeming29-Jul-16 2:12
mveRichard Deeming29-Jul-16 2:12 
GeneralRe: DP not Working Pin
PureNsanity29-Jul-16 3:47
professionalPureNsanity29-Jul-16 3:47 
AnswerRe: DP not Working Pin
Meshack Musundi2-Aug-16 22:33
professionalMeshack Musundi2-Aug-16 22:33 
QuestionScrolling data table area on a XAML page Pin
holdorf26-Jul-16 13:41
memberholdorf26-Jul-16 13:41 
I have been trying for several days to come up with a solution for the my application page. My page contains an upper section with a menu, page header, and two columns for a human head silhouette image and empty white section. That section works fine. What I have been trying to add to my page are two DataGrids side by side so it will create a single table of a total of four columns. Now on each DataGrid the first column is a Description and the second column is the Value it displayed for the Description. What I am trying to do is have a table on the page that appears to make up a single table with 17 rows of Description/values. I don't want either DataGrid to have a scroll bar and each not to be able to scroll. In some of the DataGrid cell a want a background color of blue. Now on the page this table is in a DockPanel with a height of 368 units. What I want is the DockPanel to have a scroll bar so both DataGrids can be scrolled up and down as a single table. First, I have found the it is almost impossible to change the background of a DataGrid Column's Cell. Next my DockPanel scroll bar does not appear and each of the DataGrids are still able to scroll. Below is both the XAML and the code behind. I am only showing 8 rows for testing. If anyone can help that would be great.

Page XAML

  <ScrollViewer Height="368" Width="900" VerticalScrollBarVisibility="Auto">
     <DockPanel Background="White" Height="368" VerticalAlignment="Top">
         <DataGrid Name="main1" ScrollViewer.CanContentScroll="False" AutoGenerateColumns="False" BorderBrush="White" DockPanel.Dock="Left" HorizontalAlignment="Left" Width="495" >
             <DataGrid.Columns>
                 <DataGridTextColumn FontSize="14" FontWeight="Bold" Header="Test Description" Binding="{Binding Description }" />
                 <DataGridTextColumn FontSize="14" FontWeight="Bold"  Binding="{Binding Value}" />
             </DataGrid.Columns>
        </DataGrid>
         <DataGrid Name="main1" ScrollViewer.CanContentScroll="False" AutoGenerateColumns="False" BorderBrush="White" DockPanel.Dock="Left" HorizontalAlignment="Left" Width="495" >
             <DataGrid.Columns>
                 <DataGridTextColumn FontSize="14" FontWeight="Bold" Header="Test Description" Binding="{Binding Description }" />
                 <DataGridTextColumn FontSize="14" FontWeight="Bold"  Binding="{Binding Value}" />
             </DataGrid.Columns>
        </DataGrid>
    </DockPanel>
</ScrollViewer> 



Code behind:

List<InformationValues> InformationValuess = new List<InformationValues>();
List<InformationValues> InformationValuess2 = new List<InformationValues>();
List<InformationValues> InformationValuess3 = new List<InformationValues>();
List<InformationValues> InformationValuess4 = new List<InformationValues>();

InformationValuess.Add(new InformationValues() { Description = "Test Description1", Value = "Test Value1" });
InformationValuess.Add(new InformationValues() { Description = "Test Description2", Value = "Test Value2" });
InformationValuess.Add(new InformationValues() { Description = "Test Description3", Value = "Test Value3" });
InformationValuess.Add(new InformationValues() { Description = "Test Description4", Value = "Test Value4" });

InformationValuess2.Add(new InformationValues() { Description = "Test Description1", Value = "Test Value1" });
InformationValuess2.Add(new InformationValues() { Description = "Test Description2", Value = "Test Value2" });
InformationValuess2.Add(new InformationValues() { Description = "Test Description3", Value = "Test Value3" });
InformationValuess2.Add(new InformationValues() { Description = "Test Description4", Value = "Test Value4" });

InformationValuess3.Add(new InformationValues() { Description = "Test Description1", Value = "Test Value1" });
InformationValuess3.Add(new InformationValues() { Description = "Test Description2", Value = "Test Value2" });
InformationValuess3.Add(new InformationValues() { Description = "Test Description3", Value = "Test Value3" });
InformationValuess3.Add(new InformationValues() { Description = "Test Description4", Value = "Test Value4" });

InformationValuess4.Add(new InformationValues() { Description = "Test Description1", Value = "Test Value1" });
InformationValuess4.Add(new InformationValues() { Description = "Test Description2", Value = "Test Value2" });
InformationValuess4.Add(new InformationValues() { Description = "Test Description3", Value = "Test Value3" });
InformationValuess4.Add(new InformationValues() { Description = "Test Description4", Value = "Test Value4" });



main1.ItemsSource = InformationValuess;
main2.ItemsSource = InformationValuess2;

AnswerRe: Scrolling data table area on a XAML page Pin
Mycroft Holmes26-Jul-16 14:32
memberMycroft Holmes26-Jul-16 14:32 
GeneralRe: Scrolling data table area on a XAML page Pin
holdorf27-Jul-16 0:31
memberholdorf27-Jul-16 0:31 
GeneralRe: Scrolling data table area on a XAML page Pin
Mycroft Holmes27-Jul-16 12:44
memberMycroft Holmes27-Jul-16 12:44 
QuestionWhere to call OnPropertyChanged Pin
Bernhard Hiller25-Jul-16 21:47
memberBernhard Hiller25-Jul-16 21:47 
AnswerRe: Where to call OnPropertyChanged Pin
Gerry Schmitz26-Jul-16 3:47
mveGerry Schmitz26-Jul-16 3:47 
QuestionEnter key invokes button click Pin
GrooverFromHolland23-Jul-16 9:44
memberGrooverFromHolland23-Jul-16 9:44 
AnswerRe: Enter key invokes button click Pin
Mycroft Holmes23-Jul-16 14:28
memberMycroft Holmes23-Jul-16 14:28 
GeneralRe: Enter key invokes button click Pin
GrooverFromHolland24-Jul-16 0:19
memberGrooverFromHolland24-Jul-16 0:19 
GeneralRe: Enter key invokes button click Pin
Mycroft Holmes24-Jul-16 14:34
memberMycroft Holmes24-Jul-16 14:34 
QuestionUsing negative height margin values to properly vertically align a control Pin
holdorf22-Jul-16 14:22
memberholdorf22-Jul-16 14:22 
AnswerRe: Using negative height margin values to properly vertically align a control Pin
holdorf23-Jul-16 4:50
memberholdorf23-Jul-16 4:50 
GeneralRe: Using negative height margin values to properly vertically align a control Pin
holdorf23-Jul-16 9:47
memberholdorf23-Jul-16 9:47 
QuestionList Control Question Pin
Kevin Marois21-Jul-16 14:36
professionalKevin Marois21-Jul-16 14:36 
AnswerRe: List Control Question Pin
Gerry Schmitz22-Jul-16 11:18
mveGerry Schmitz22-Jul-16 11:18 
QuestionKeeping correct layout when browser is resized Pin
holdorf17-Jul-16 3:37
memberholdorf17-Jul-16 3:37 
AnswerRe: Keeping correct layout when browser is resized Pin
Gerry Schmitz18-Jul-16 6:19
mveGerry Schmitz18-Jul-16 6:19 
QuestionStyling a Drag and Drop Items behavior in a WPF ListView Pin
Kenneth Haugland13-Jul-16 5:43
professionalKenneth Haugland13-Jul-16 5:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.