Could anyone possibly explain to me why the following simple example works:
<ItemsControl x:Class="UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Grid />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="5" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid Background="Yellow" />
<GridSplitter Grid.Row="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" />
<Grid Grid.Row="2"
Background="Orange" />
</Grid>
</ItemsControl>
...but when I make the ItemsPanelTemplate's the main one, it does not:
<ItemsControl x:Class="UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="5" />
<RowDefinition />
</Grid.RowDefinitions>
</Grid>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<Grid Background="Yellow" />
<GridSplitter Grid.Row="1"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" />
<Grid Grid.Row="2" Background="Orange" />
</ItemsControl>
They both display a Yellow box on top of an Orange box, with a horizontal splitter between them. In the first example the splitter works correctly, allowing you to resize the two areas. In the second example (that produces a near identical visual tree), the splitter is locked, it won't allow me to drag it to resize the two areas!
This is a very simplified example of what I'm trying to achieve - but it demonstrates the issue I'm getting in my actual app. I must be missing something, what's stopping the splitter from functioning? All three children get added to the ItemsPanelTemplate grid ok....
Any explanation or fix would be much appreciated!
Regards,
Dave
oh no one replied? it is because the GridSplitter must be the immediate child of the parent Grid to know the actual size of the columns.
Related
Having problems creating such a layout. Controllers trigger dash content, and the layout should be created. Now I have this definitions, and I am blocked.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
"http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
<tiles-definitions>
<definition name="masterLayout" template="/WEB-INF/jsp/layout/master.jsp">
<put-attribute name="headerInclude" value="" />
<put-attribute name="body" value="" />
<put-attribute name="footerInclude" value="" />
</definition>
<definition name="dashboardLayout" extends="masterLayout">
<put-attribute name="body" value="dashboardLayoutBody" />
</definition>
<definition name="dashboardLayoutBody" template="/WEB-INF/jsp/layout/dashboard.jsp">
<put-attribute name="menu" value="/WEB-INF/jsp/parts/menu.jsp" />
<put-attribute name="body"/>
</definition>
<!-- this page is triggered -->
<definition name="login_page" extends="masterLayout">
<put-attribute name="body" value="/WEB-INF/jsp/layout/login.jsp" />
</definition>
<!-- this page is triggered -->
<definition name="some_page" extends="dashboardLayout">
<put-attribute name="body" value="/WEB-INF/jsp/content/admin_groups/supervisor.jsp"/>
</definition>
</tiles-definitions>
master layout has this content
<!DOCTYPE html>
<html>
<head>
<!-- Master css, js, meta, tags additions .... -->
<tiles:insertAttribute name="headerInclude"/>
</head>
<body>
<tiles:insertAttribute name="body"/>
<!-- Master css, js, meta, tags additions .... -->
<tiles:insertAttribute name="footerInclude"/>
</body>
</html>
I need somehow to extend template and also have own template, to include menu there
As a new comer to jsp templating, I didn't realized that I can use jsp:include in parallel with Aapache Tiles, which solved the problem.
The main problem was that I couldn't include the menu once only in the dashboard layout, and be used everywhere.
Using only tiles, there is cascade attribute on a put-attribute tag that allow that to be used in other attributes also.
Keep in mind that cascade needs DOCTYPE tiles-definition minimum version 2.1
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN"
"http://tiles.apache.org/dtds/tiles-config_2_1.dtd">
I build a SSRS report. In both edit and preview mode it show the headers for the columns in normal non bold. However when I run the same SSRS report from our report server the header text shows up as bold. I tried removing the report multiple times. I tried clearing my internet cache and nothing. Any ideas?
Update: I uploaded same report(With changes) to server but with different name and everything is the same on the report.
Update 2: I show NO cache on for the reports. I tried rebooting the server that has both SSRS and SQL running on it and no change. Thinking it may be within the report but after checked I do not see anything that would cause it.
Update 3 for Jerry:
<TablixCell>
<CellContents>
<Textbox Name="nop123">
<CanGrow>true</CanGrow>
<KeepTogether>true</KeepTogether>
<Paragraphs>
<Paragraph>
<TextRuns>
<TextRun>
<Value>Number of Parts</Value>
<Style>
<TextDecoration>None</TextDecoration>
</Style>
</TextRun>
</TextRuns>
<Style>
<TextAlign>Center</TextAlign>
</Style>
</Paragraph>
</Paragraphs>
<Style>
<Border>
<Color>LightGrey</Color>
</Border>
<VerticalAlign>Middle</VerticalAlign>
<PaddingLeft>2pt</PaddingLeft>
<PaddingRight>2pt</PaddingRight>
<PaddingTop>2pt</PaddingTop>
<PaddingBottom>2pt</PaddingBottom>
<WritingMode>Rotate270</WritingMode>
</Style>
</Textbox>
<rd:Selected>true</rd:Selected>
</CellContents>
</TablixCell>
I've got some TextBlock in my wp8 app which have the same style: for example, they all need to be underlined, bold and something else..
Is there the possibility to centralize this common style without repeating all style's declarations for each TextBlock in my application?
Could you give me some working example?
Thanks in advance!
In App.xaml resources you can define global styles for all pages. If you want to have the same style for all TextBlock, the style has to contain only TargetType, but not x:Key.
<Application.Resources>
<ResourceDictionary>
<!-- All TextBlock(s) -->
<Style
TargetType="TextBlock">
<Setter
Property="FontSize"
Value="{StaticResource PhoneFontSizeExtraLarge}" />
<Setter
Property="FontWeight"
Value="Bold" />
<!-- something else -->
</Style>
</ResourceDictionary>
</Application.Resources>
In my windows phone 8 application, I want to open a page in web browser.
For that I have taken WebBrowser.
<Grid x:Name="ContentPanel" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0">
<phone:WebBrowser x:Name="addComBrowser" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0" MinWidth="480" MinHeight="796" />
</Grid>
Now in the code behind file I've set the url.
Uri uri = new Uri("http://blablabla.....");
addComBrowser.Source = uri;
Now when I run the app, The content in the browser displaying in very small size.
Below is the output.
How should I increase the font size of how should i increase the zoom level.
Thanks.
If you can change the HTML maybe you can add the viewport metadata:
https://developer.mozilla.org/en/Mobile/Viewport_meta_tag
Insert this in between <head> and </head> in your html
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
I am trying to display a browser in a ViewBox element on a Windows Phone 8 Nokia Lumia.
The WebBrowser is displaying when it is alone, but when I put it in a ViewBox element, it does not show.
Here is my sample code:
<phone:PhoneApplicationPage
x:Class="PhoneApp2.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<!--LayoutRoot is the root grid where all page content is placed-->
<Viewbox Stretch="Fill" >
<phone:WebBrowser Source="http://google.com" />
</Viewbox>
</phone:PhoneApplicationPage>
hey the problem is the default height and width of viewbox control..just set the height and width of your view box control ..like this it will work..
<Viewbox Grid.Row="0" VerticalAlignment="Top" HorizontalAlignment="Left">
<phone:WebBrowser Grid.Row="0" Height="800" Source="http://www.google.com" Width="500" />
</Viewbox>
any query..comment below..