.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to increase the height of Expander control HEADER in XAML

Posted By:      Posted Date: September 30, 2010    Points: 0   Category :WPF


How to increase the height of Expander control HEADER in XAML?



Many Thanks Deepak

View Complete Post

More Related Resource Links

Looking to get the IsMouseOver of a button inside a header of an expander all though xaml

<Window x:Class="Testwpf.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <Expander x:Name="expan" IsExpanded="True" AllowDrop="True"> <Expander.Header> <Grid x:Name="grd"> <TextBlock Text="asdfhasodfjasdfj asjf aspd fk" HorizontalAlignment="Left" Margin="20,4,0,0"/> <Button x:Name="BtnHeaderGreen" Content="1" Width="25" HorizontalAlignment="Left"/> </Grid> </Expander.Header> <Expander.Content> <Grid > <Canvas Margin="0,2,0,0" x:Name="can" Panel.ZIndex="99"> <Canvas.Style> <Style TargetType="{x:Type Canvas}"> <Style.Triggers> <DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Expander}}, Path=Header.IsMouseOver}" Value="true"> <Setter Property="Visibility" Value="Visible"/>

Find a header control


Via RowDataBound, how to find a control in the header row?

This is what I have but not working!!!

If e.Row.RowType = DataControlRowType.Header Then
  Dim cbHeader As CheckBox = CType(GV_update.HeaderRow.FindControl("HeaderLevelCheckBox"), CheckBox)
End If


How to get XAML to reconize my user control implementation?

Let say I want to implement a Singleton pattern for a UserControl as shown below.  How would I get XAML to be able to use this in Markup?    public class UserControlViewBase : UserControl     {         private UserControl _instance;         public UserControl getInstance() {               if (_instance == null) {                  //use reflection to instantiate based on callers type                 //get assembly name.                 Assembly asm = Assembly.GetExecutingAssembly();                 string classname = "View2";                 object o = asm.CreateInstance(classname);    &nbs

Full desired height of a RichTextBox control?

I don't mean the control's .Height property... ...I have a WinForm with a RichTextBox control, and another control underneath the RichTextBox control.  The RichTextBox control is anchored on the left, top, and right sides, so the width is automatically resized as the parent form is resized.  (it also has its Multiline and and WordWrap properties set to True) The item underneath the RichTextBox needs to always be right underneath it (little whitespace), and the RichTextBox needs to always display its entire text (nothing hidden). As I get the form's resize event, I'd like to update the RichTextBox's hight so all text is displayed, however I'm not seeing any properities or methods which would be helpful.  There is the PrefferredHeight property, but it is always returning 13. Basically, it comes dowen to this: when WordWrap is set to true, is there a way to see what the desired height is?  Or is there a way to see if any of the text is clipped? If not, I suppose my next step would be to roll my own custom control and draw the text myself, keeping track of the autowrap and line count, but I thought I'd post a message here first and see if anyone has a better idea. Thanks, Jeff      

expander control - how to expand "over" something?

I've re-styled the standard expander control to expand horizontally and I am looking for a way for the expander to "expand" over top of other controls on the window instead of pushing them around and forcing the UI to re-draw portions of itself. This is a direct copy of the Visual Studio side and bottom menu pop out behaviors, if that helps anyone understand what I am trying to achieve. I have searched these forums and I found a solution that involves using a Canvas to wrap around the expander but I was looking for a way to accomplish this same task without the Canvas object. The reason for this is that canvas does not provide a method to resize its children and my expander currently can resize itself if provided more room. I do not wish to break this behavior. I obviously tried setting the Panel.Zindex directly on my expander object but this didn't do much for me.  If anyone has any suggestions I can try post them here so I can try to add them in over the next couple of weeks to my project. Thanks in advance for any assistance!

how to find control from header template of a datalist?

 Hi,I have a textbox in header template of a datalist. From code behind i've to access these textbox from page_load event.I tried with the following code. DataList.Controls[0].FindControl("myControl") But it have error. how to solve it? 

WPF control size is larger than explicitly set width and height values.

I created a Canvas with fixed Width and Height (256x256). Next to it I put an Image control displaying a 256x256 texture without stretching. How is it possible that actual sizes of both controls on the screen differ so much? Here - is the screenshot illustrating size mismatch. And here - the TestLines256.png in case someone liked to check it (and maybe point out that I'm stupid and this texture is 180x180 and not 256x256 as I claimed). XAML with creation of the controls:   <Window x:Class="OversizedQuad.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" SizeToContent="WidthAndHeight"> <StackPanel Orientation="Horizontal"> <Canvas Width="256" Height="256" Background="Red" /> <Image Stretch="None" Source="TestLines256.png" /> </StackPanel>

Dynamically Binding Header of Repeater Control

Hi , I am stuck up into following Issue while binding Repeater control dynamically from database I have repeater control which I want to populate from database.. asp:Repeater id="Repeater1" runat="server">   <HeaderTemplate>      <table border="1">         <tr bgcolor="#ffcc99">            <th><asp:label id="Lname" runat ="server" text = "???"  ></asp:label></th> <th><asp:label id="Fname" runat ="server" text = "???"  ></asp:label></th>         </tr>   </HeaderTemplate>   <ItemTemplate>      <tr bgcolor="#ffcccc">        <td><%# DataBinder.Eval(Container.DataItem, "Col1") %></td>        <td><%# DataBinder.Eval(Container.DataItem, "Col2") %></td>      </tr>   </ItemTemplate>   <FooterTemplate>   </table>   </FooterTemplate></asp:Repeater&g

Cannot populate XAML items in template control that in contained within another template control

I have a template control Bookmark, and in MainWindow.xaml, this works just fine: <sdl:Bookmark> <sdl:Bookmark.Bookmarks> <sdl:BookmarkItem Name="test" Extent="-121.89,33.60,-117.09,36.32"> </sdl:BookmarkItem> </sdl:Bookmark.Bookmarks> </sdl:Bookmark> But, I also have a template control Titlebar which inside of its XAML contains a Bookmark control and in MainWindow.xaml, this does NOT work: <sdl:Titlebar x:Name="Titlebar"> <sdl:Titlebar.Bookmark> <sdl:Bookmark.Bookmarks> <!-- Doesn't like this --> <sdl:BookmarkItem Name="test" Extent="-121.89,33.60,-117.09,36.32"> </sdl:BookmarkItem> </sdl:Bookmark.Bookmarks> </sdl:Titlebar.Bookmark> </sdl:Titlebar> I get this error: Error 11 The tag 'Bookmark.Bookmarks' does not exist in XML namespace 'clr-namespace:SDL.ArcGIS.Client.Toolkit;assembly=SDL.ArcGIS.Client.Toolkit'. Line 45 Position 22. C:\Projects\SDL.ArcGIS.Client.Toolkit\SDL.ArcGIS.Client.Toolkit.WPFTestApplication\MainWindow.xaml 45 22 SDL.ArcGIS.Client.Toolkit.WPFTestApplication Bookmark does have a member property in the Titlebar class that is set to the template bookmark in OnApplyTemplate.  I tried making a dependency property for the Bookmark property too, but that didn't

How to Control each cells width and height of a Table ?

Hi, I want to fix the size of each cells of a table . for that i used Style like this: <td style="width:10px;height:10px"> contents </td> But it seems that there is no any effect of applying these settings.How can  i set its width and height. It seems that it purely depends on the contents of cells. Now, if suppose there are two rows, <tr id='r1'> <td id='d1'> content of size 10px </td> <td id='d2'> content of size 10px </td> </tr> <tr id='r2'> <td id='d3'> Content of size 400px </td> <td id='d4'> content of size 20px </td> </tr>   Then cell of id 'd1' will get a size of 400px ,since its just below cell is of size 400px. I want to fix its size. Is that possible ?  

Doubt regarding the expander control in WPF.

I want to use multiple expanders in a WPF application and i want to expand multiple expanders at the same time. I was thinking that it would be great if i could implement the following. If at any point in time, if only one expander is expanded, it shows its contents as it is but if any other expander is already expanded, then the expander being expanded would open with a scrollbar inside, displaying its contents on-scroll. thus we can have many expanders expanded at the same time without the problem of them overlapping. Any pointers or ideas regarding the same would be of great help. Regards Vignesh

validation control increase page size

Hi all,In my web page I have lot of validation controls. These controls emit some script block to the page, that increase my page size Is there any way to put that script in to separate js fileneed client validation also.

Button height doesn't increase with larger font size

Hi, I've got a couple buttons in a StackPanel that aren't increasing when I increase the font size. I think it has to do with the VerticalAlignment but I'm not catching what's going on. Here is the xaml: <StackPanel Grid.Row="3" Grid.RowSpan="1" Height="Auto" HorizontalAlignment="Stretch" Name="stackPanel1" VerticalAlignment="Stretch" Width="Auto" Orientation="Horizontal"> <Button Background="#FF7F3F96" BorderBrush="{x:Null}" Content="exit" FontFamily="Myriad Pro" FontSize="12" Foreground="White" Width="Auto" MinWidth="74" Margin="23,8,11,9" /> <Button BorderBrush="{x:Null}" Content="new" FontFamily="Myriad Pro" FontSize="12" Foreground="White" RenderTransformOrigin="-0.243,0.516" Width="Auto" MinWidth="74" Margin="11,8,11,9"> <Button.Background> <SolidColorBrush Color="{DynamicResource Green}" /> </Button.Background> </Button> </StackPanel>

IDE hangs when loading the Fluent XAML Control page

Hi All, This question is related to the MS Fluent WPF RibbonControl samples at http://fluent.codeplex.com. My OS is Vista. But the Fluent suite 1.3 is supposed to be stable. Nevertheless, the 3.5 NET sample apps will execute OK... but when I try to view the "window.xaml" code page in the VS2008 Pro IDE, the page loader hangs (the devenv.exe process consumes 50% of the CPU time) and never completes. Is the IDE configured properly? I'm new to Fluent and just installed the Samples. Also, I installed and uninstalled the MS Ribbon Control samples for WPF. If anyone can help... Please do! Thanks, King

Adding XAML via control property

Hi, I'm attempting to create a custom chart control that has 1 or many line series within it. My question is, is it possible to create a property of that control, that when checked in the designer, will automatically add the line series xaml within the chart series? For example, if you click on the "Add Test Series" check box, which is of type boolean, it will then add <chartingToolkit:LineSeries /> into the xaml of the control as well as to the series of the control.   <local:TestChartControl> <chartingToolkit:LineSeries /> </local:TestChartControl>     Thanks  

How To Setup Expander Control for TabItems in TabControl?

Hii.. I'm having a TabControl which TabStripPlacement is left side means all TabItems are exist in left side of window (Look like side menu).. so i want to place Expander control for TabItems only, which is used like expand the expander and select respective TabItem and close expander like that.   sample picture...                        _________________________________________________________________________ TabItem1   E   |                                                                                                                               | TabItem2   X   |      &n

Unhandled exception in XAML editor from control that accesses database. - "System.Data.SqlServerCe.S



Im having a bit of difficulty with some WPF/C#/SQL Server CE code.

I have a WPF User Control with the following line of code in the constructor:

MyDatabase database = new
 MyDatabase("Data Source=|DataDirectory|\\MyDatabase.sdf"

where MyDatabase is a class generated using SQLMetal.exe from MyDatabase.sdf.


When I added this control to other controls, the application runs fine and I'm able to access my database. When I try to edit these parent controls,  the XAML editor throws the following error:


>The database file cannot be found. Check the path to the database. [ Data Source = D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MyDatabase.sdf ]


Why does the XAML editor redirect my DataDirectory to "D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\" and why does the XAML editor execute my database access code?


How can I fix this so I can use this control in a XAML editor?


Greg S.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend