.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

Default style on control?

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :WPF

What is the proper way to set up default styles for a Custom Control Library?

I wanted to have the control and style in the same library but it was not calling the OnApplyTemplate().
Company.Framework -> WPF -> Controls -> MyControl -> MyControl.cs
Company.Framework -> WPF -> Controls -> MyControl -> MyControlStyle.xaml

I realized I needed a Generic.xaml.  When I had it set up this way, my modules would throw errors when trying to load.
Company.Framework -> WPF -> Controls -> MyControl -> MyControl.cs
Company.Framework -> WPF -> Controls -> MyControl -> MyControlStyle.xaml
Company.Framework ->Themes -> Generic.xaml
Company.Shell ->App.xaml

This is currently how I have it set up. It works, but I want the default style back with the control.
Company.Framework -> WPF -> Controls -> MyControl -> MyControl.cs
Company.Shell -> DefaultSkin -> Resources -> MyControlStyle.xaml
Company.Shell -> DefaultSkin -> Resources.xaml


View Complete Post

More Related Resource Links

default style for control

Hi all , I have a problem when I use button in some code base , I found some guys already defined lots of style for the button and buttonbase , but I want to use the default style in WPF , can I prevent the button inherit the style from custom , only use the WPF ?

ASP.NET repeater control - databind with style

even used the inline editing features, which I at the time thought was the coolest way possible to write ASP.NET code ( I managed to write code to hide all other rows and only show the current one - the row being edited). With a nice looking EditTemplate it looked indeed very slick but it really turned into giant and hard to manage code behind files.

Is it possible to change the title bar background and the font style on default template?



Is there any way to change the default top link /title bar picture and the fonts of the title without breaking anything in the layout/structure?

I have changed the theme to Obsedian and I would also like to change the picture of the title bar of this theme and also the font/style of the title, top link bar, menus..etc. Is there a way to do this?

Please note: I am using WSS 3.0 and I am not the Administrator of the sharepoint. I am only the site admin of some sites on this sharepoint. I can do some basic customization using SPD.

Basically, what I am trying to do is that I want to set up a sharepoint site, however I want to make it NOT look like a sharepoint site.Well I know this is possible, but for my case it might be just partially possible due to the limitation that I am not the Site collection admin and hence I do not have direct access to the server itself.

What I want is to hide most of the sharepoint links/menus/bars, etc and use my own buttons/hyperlinks etc .. for user to navigate on the sites.

Thanks in advance for your help/advices.



Change the Default Date in the Date Picker Control

Hi, I have a WPF Datagrid in which one of the columns is a Date Column. So i have used a DataTemplateColumn as Follows     <my:DataGridTemplateColumn CellTemplate="{StaticResource EffDateDateTimePickerControl}"   CellEditingTemplate="{StaticResource addrEffDate}" Header="Effective Date"/> And in my Resource File i have written the following code: Style   TargetType="{x:Type my:Calendar}" x:Key="CalenderControlTemplate">     <Setter Property="Template">     <Setter.Value>     <ControlTemplate TargetType="my:Calendar" >     <my:CalendarItem Name="myCalendarItem"   Background="White"   BorderBrush="Black"   BorderThickness="1"   VerticalAlignment="Center" />     </ControlTemplate>       </Setter.Value>     </Setter>     </Style>       <DataTemplate x:Key="EffDateDateTimePickerControl">     <Label x:Name="lblEffDate" Content="{Binding effectiveDate,Mode=TwoWay}" ></Label>     </DataTemplate>     <DataTemplate x:Ke

How to use CSS to style just one of the columns in a GridView control

<asp:Boundfield Datafield="City" Headertext="City" sortexpression="City" CONTROLSTYLE-CSSCLASS="allcaps"/> I'm trying to use the CSS property "text transform" to make just one specific GridView column "all caps" (see above), but it has no effect. It only works when I place the reference to the class ".allcaps"  in the main tag at the top of the GridView control---but that makes all columns "all caps". How can I style just one column using CSS?   Thanks.  

How to Set default file name of image in FileUpload Control

helloi want to set  default value in Fileupload control.Because when i select file name using fileupload then save that file to sqlserver database i got problem when no file is select. so i found alternate of that i should store default image into database through fileupload control but now my query is how to set default image to fileupload control.please i want source code.i really need it......tnx in advance

UPDATED: AJAX FAQ? And: How to Style the AJAX tab control's tabs: complete information

UPDATE April 08, 2009: for the latest version of this post, with up-to-date info on styling the Tab control, see my just updated Blog post -- the info below is somewhat outdated and does not have some additional details I have added to the Blog post.   First of all, I would like to suggest that the AJAX section of the ASP.NET forums have its own FAQ section. I was going to post this in the general ASP.NET FAQ, but it didn't really fit, and there was no AJAX FAQ, so I'm posting it here. Next: I have been looking for details on how to style the Tabs in the AJAX Toolkit's Tab control for over a week now. I have found information that is misleading, incomplete, outdated, and just plain wrong. And nowhere have I come across all the information needed to make it work in one place. So, I am posting this here. I hope that an AJAX FAQ can be created, and this post moved there.   I am including some background information, about the difficulties people are having in finding information on styling the tabs, first; after that I will include the complete instructions for styling the tabs. First: the information on the documentation page for styling the tabs is misleading at best, as well as incomplete. The docs tell you that you can simply add your styles to your project as CSS, and neglect to tell you that you must add a "CssClass" attribu

Is there a way to set default style properties for a table or matrix?


We have a company standard we use for fonts, color, background, borders. 

Is there a way to set the default font to say 8 pt (vs 10 pt) so that I do not have to change every textbox and column header when adding columns to a table?



Style Trigger or or Control Template to swap GradientStops


I have an Ellipse that is part of a UserControl.

     <GradientStop Color="{Binding Path=CommandBg, FallbackValue=DarkBlue}" Offset="{Binding Path=CommandGradient,FallbackValue=2}" />
     <GradientStop Color="White" Offset="0" />

The Grid Has two events:


And on the mouse down event I want to swap the GradientStop properties, and then on MouseUp, swap them back.

How can this be accomplised in XAML?



how to restore view style to default... urgent


dear friends,

I have changed default font size of '.ts-syslabl' in view style of "Boxed" for a page. But it is reflecting in all view styles. May be i corrupted main css core file or vwstyles file with respect to that site collection. How to restore to default file with respect to css. Kindly help me out . It is urgent ...please.. It is the problem with only one site collection in which i tried.

I used Sharepoint designer 2010 .

pleasehelp me out

CalendarExtender loses style when placed inside a web user control.


I'm losing the format of the calendarExtender when I include it within a web user control. The code below is included within a user control. The user control is then dropped onto a page.

<asp:UpdatePanel id="UpdatePanel1" runat="server">
        <asp:GridView ID="GridView1" runat="server"
            AllowPaging="True" AllowSorting="True"
            EmptyDataText="There are no data records to display.">
                <asp:TemplateField HeaderText="Target_Date" SortExpression="Target_Date">

Opening links from WPF WebBrowser control in default browser instead of IE

I am working on a WPF application that uses System.Windows.Controls.WebBrowser to display an embedded HTML page.
The problem I have is that all links from that page that are to open an external browser window (with target="_blank") open Internet Explorer instead of the configured default browser.
How do I tell the WebBrowser control to respect the default browser settings?

Report viewer control is is displaying parameter item 'select a value' even when the default param



I am using SSRS 2008 R2,

I have set the default parameter of dropdown and in the output "select a value" item text is removed ,also in the Report Manager 'select a value' removed .

But when I am displaying the same reports in the ReportViewer control as ReportViewer1.ServerReport  in the the vs 2010 asp.net project the item select a value is reappearing in the output.

Could you please help me remove the default item text 'select a value' from the ReportViewer control aswel.


How to set default Image to RichFieldImage control in custom Publishing Page layout in Site defini




How to set  default Image to RichFieldImage control  in custom Publishing Page layout in Site definition?


Override Default MS contextmenu in custom control

I am creating a custom TextBox control with default ContextMenu as below.



<ContextMenu >

Jquery UI buttons style return back to windows default button



i have placed my 

    <link type="text/css" href="css/smoothness/jquery-ui-1.8.5.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.5.custom.min.js"></script>

<link type="text/css" href="css/smoothness/jquery-ui-1.8.5.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.5.custom.min.js"></script>

under my template.master - master page.

so i make a new page based on my master page.&nb

How to change style for a control contained in a ControlTemplate


How to change style for a control contained in a ControlTemplate


I have defined a ControlTemplate as shown below (pretty much just a combobox kind of control).

I hoped that I would be able to change the control template for the dropdown button where used on the form by overwriting the DropDownButtonStyle like this, but it doesn’t work.


How can I overwrite the style for a control contained in a control template? (other than exposing the control as a property on the custom control)


UserControl.Resources – this should give me the brown button style

<Style x:Key="DropDownButtonStyle

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