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

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

Styles not applied

Posted By:      Posted Date: September 18, 2010    Points: 0   Category :WPF
i have a setup like <ribbon:RibbonGallery> <ribbon:RibbonGallery.Resources> <Style TargetType="ribbon:RibbonGalleryItem"> <Setter Property="Width" Value="24" /> <Setter Property="Padding" Value="0" /> </Style> <Style TargetType="Rectangle"> <Setter Property="Width" Value="16" /> <Setter Property="Height" Value="16" /> </Style> </ribbon:RibbonGallery.Resources> <ribbon:RibbonGalleryCategory Header="Automatic Color" HeaderVisibility="Collapsed" IsSharedColumnSizeScope="True"> <ribbon:RibbonGalleryItem Width="auto"> <StackPanel Orientation="Horizontal"> <Rectangle Fill="Black" /> <TextBlock Text="Automatic Color" Margin="12,0,0,0" FontWeight="Normal" /> </StackPanel> </ribbon:RibbonGalleryItem> </ribbon:RibbonGalleryCategory> <ribbon:RibbonGalleryCategory x:Name="themeColors" Header="Theme Colors" MinColumnCount="10" MaxColumnCount="10"> <ribbon:RibbonGalleryCategory.ItemTemplate> <DataTemplate> <Sta

View Complete Post

More Related Resource Links

css styles are not applied to the page when we use IE8 browser in normal mode


Hi All,


            I have development .net application using CSS.  which is is working fine in ie7.0. Now i am clinet want to use IE8. But some of CSS styles are not applied to the page when we use IE8 browser.  I am anable to lock the gridviw header in IE8 browser. I dont to want to apply compatibility mode as it is working fine. In normal IE8 mode I want to lock gridview header. Is it possible. Please give solution.




Ramadurai Jayaraman

Conditional styles for selected Html.ActionLink


Hi, I am trying to add an item selected class to an Html.ActionLink, I am very new to MVC so its all a bit confusing.

So far i have each of my ActionLinks lookins like this

<li><%: Html.ActionLink("Home", "Index", "Home", new { @class = ViewData["current"] == "Home" ? "selected" : "" })%></li>

And in the controller i have

public ActionResult Index() {
            ViewData.Add("current", "Home");
            return View();

Can any one tell where i am going wrong because the links now fail to respond, basically it isn't checking the condition == Home and if it is then its failing because it doesn't get to the controller.

Any ideas would be appreciated


Why do the aks master pages not get applied if the feature is not activated on the top site collecti


I installed AKS 2.0 and activated AKS feature. The problem I found was the aks master pages do not get applied if the feature is not activated on the top site collection. why is so?

example: If i activate the feature on http://<servername>/sites/<sitename> and apply the master page, I dont see any changes.

              But if i activate the same aks feature on http://<servername/ then everything started working on all sites.

              The reason i found is the CSS reference in the aks master pages.

              It reference should be given as follows:

                 for http://<servername>/sites/<sitename> ->  <link rel="stylesheet" type="text/css" href="../../Style%20Library/AKS/Aks_Band_Blueband.css"/>

                 for http://<servername>/ -><link rel="stylesheet" type="text/css" href="/Style%20Library/AKS/Aks_Band_Blueband.css"/>

So my question is, am i missing anything? am i supposed to activate the AKS feature on top level site collection at any cost? if yes, why is so? 

And after applying aks master pages, i see differnece in font sizes. Why the font size is getting changed?


Can't change Gridview row colors or styles in the DataBound event


I was highlighting certain rows in my gridview using code like this in the DataBound event:

        if (e.Row.RowType == DataControlRowType.DataRow)
            int vendorCheck = 0;
            //TODO make this shorter
            if (DataBinder.Eval(e.Row.DataItem, "vendorId") != System.DBNull.Value)

In a style template, express a property in terms of the controls properties it is applied to.

Hello,   In the style template below, which works fine, I'd like to express the "Points" property in terms of the applied to controls "Width" and "Height" properties.  As you see, the "Fill" property is expressed in terms of the "Background" property the template is applied to by means of Fill="{TemplateBinding Background}".  The following does not work:   Points="0,({TemplateBinding Height} / 4)  ({TemplateBinding Width} / 12.5),({TemplateBinding Height} / 4) . . ."   Is what I'm looking for possible, all in XAML, no code/converters? <Style x:Key="FolderButton" TargetType="Button"> <Setter Property="Margin" Value="2.5" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <Grid> <Polygon Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" Points="0,5 4,5 6,0 23,0 25,5 50,5 50,20 0,20"/> <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/> </Grid> </ControlTemplate>

Styles based on themselves?

Hi, I'd like to create e.g. a button style, change the template but keep the rest of the original button style (like minheight/height). How do I achieve this? Atm, I'm using this: <Style x:Key="Button" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}"> <Setter Property="Template"> <Setter.Value> <...> </Setter.Value> </Setter> </Style> I get the following exception in visual studio (note: it just shows up in vs error window, it compiles and runs fine): "In den Eigenschaftsausdrücken wurde eine Schleife erkannt." (Unfortunately, I don't have the English excpetion message, as far as I understood it basically says you should not create a style based on itself) If I remove the BasedOn-thingy, my buttons get smaller than the normal ones and I'd like to have a solution for this where I don't have to set all the original controls' behaviors and which works also for other controls.   Tobi

//Operator '+' cannot be applied to operands of type 'L' and 'L'

  public L Mymethod<L>(L mydate, L myname) {   //it is getting following errro   //Operator '+' cannot be applied to operands of type 'L' and 'L'   return (myname+myname); }   Can any one give me help how to solve following error

Styles and derived styles at the app.xaml level

Hi, We have a bunch of standard styles (in XAML Resource Dictionaries) that are defined for company wide consumption and we merge them into our App.XAML in all our applications. In some applications we want to override some portions of the standard company wide styles again at the application level (we could do this at the window level but that is not preferrable and maintainable). But this doesn't work. What we notice is that if we have a style defined for Button in our company-wide style definition (merged into App.XAML), then we cannot derive from it and override it within our App.XAML - this probably is because there are multiple style definitions for Button and the last one replaces (rather than override) the previous. So, can anyone suggest a good way to handle this scenario? Again, we don't want to override styles at Window level, we want to do so preferrably at App level. Thanks

Navigation settings not applied when site created from template?

Hi, I created a customized site on MOSS and disabled Quick Launch and enabled Tree View on it. But when I create new site from this template it has Quick Launch enabled and Tree View disabled. I downloaded the STP file and looked inside and in the details <Details> ... <EnableTreeView>1</EnableTreeView> <EnableQuickLaunch>0</EnableQuickLaunch> ... </Details> Does anyone have a clue why it does not work correctly? Does this work for you correctly?  

The site master page setting currently applied to this site is invalid. Please select a new master p

I have defined a new master page and set it as default for the main site.  Any time I create a new subsite it does not apply the new master page and defaults back to the default.master.  The Site Master Page Settings shows this error. The site master page setting currently applied to this site is invalid. Please select a new master page and apply it The system master page setting currently applied to this site is invalid. Please select a new master page and apply it. Now if I select "Inherit site master page from parent of this site" and "Inherit system master page" and click ok the site will use the new master page and everything is fine.  There is only one modification to the master page that was done so I know the master page isn't invalid.  Does anyone know the answer other than recreating the new master page.

WCF Routing Service BindingConfiguration does not applied

Hi i am having issues working with the routing service All works fine Until one of the functions of the web service returned big amounts of data from the server, The status: I am having: 1. Silverlight application (client) 2. UI server (Contains the routing service) 3. Application Server (Contains the WCF Service which getting data from the database) The silverlight application is currently hosted both on the UI server and Application server. The services of the application server configured with the following: <basicHttpBinding> <binding name="BigServicesBinding" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" receiveTimeout="00:02:00" > <readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxStringContentLength="2147483647" maxNameTableCharCount="2147483647" maxDepth="2147483647" </binding> </basicHttpBinding> I have also set the routing service bindingConfiguration to this binding configuration. When running the silverlight application against the Application server - it works well When running the silverlight application against the UI Server when returnning big amount of data i am getting exception: System.ServiceModel.CommunicationException: The remote server returned an

Masterpage didnt get applied to a particular _Layouts files(application page) for EditUserPref.asp

Master page did nt  get applied to a application page  (_layout file),   but other layout pages have the master page applied. EditUserPref.aspx  ->  Im accessing from search preference - http://i34.tinypic.com/34xi9t5.jpg  

CreateWindowEx(...) P/Invoke Confusions with Window Styles and Extended Window Styles?

I am trying to create a window manually from C# using P/Invoke in order to make a tiny wrapper for some calls into Direct2D for a small application that is written in a functional idiom.  However, I am having a problem with a basic call: IntPtr hwnd = CreateWindowEx(0x16010000u, sWindowName, sClassName, 0x00050000u, cw_default, cw_default, cw_default, cw_default, (IntPtr)0, (IntPtr)0, hInstance, IntPtr.Zero); The first and fourth arguments which I state numerically here are bitmasks for the extended window style and the window style respectively.  I find (from Spy++) that the resulting window on execution has these style values instead: 0x16C10000u and 0x00050100u respectively.  Apparently a WS_CAPTION style is being added to my style bitmask at some point, and (perhaps consequently) WS_EX_WINDOWEDGE is being added to my extended styles.  I do not work with UIs much and have not used the window APIs from Win32 for a very long time, so perhaps I am making a silly mistake; perhaps there is some value in WNDCLASSEX that can somehow force WS_CAPTION to be added?  I am unsure if there is something obvious I am doing wrong either with the API or from the C# side.  Could I be making a marshalling mistake in the P/Invoke itself?  My extern declaration looks like this: [(DllImport("user32.dll")] s

Missing fields when filter applied

Hello all, I hope someone can help as I can't figure it out!I shall try my best to explain. I have a report to show all sales quotes by status code (first group), then by Category code (2nd Group) and then by sales quote (3rd group) for the first 2 groups there is a coulmn to show no. of quotes using a CountDistinct expression. My issue is as follows, when running the report by month (Jan, Feb then Mar etc) and taking the total number of quotes for each month and adding them up manually gives a different total when running the report for alll months together (Jan-Mar). For example: Month      No. of Quotes (this is calculated using CountDistinct so not sure if this is the problem?) Jan:          10 Feb:          11 Mar:          8 Total:        29 When run for Jan-Mar I get a total of 25. Looking at the lines there are quotes missing (when running the report for all (Jan-Mar)) but when run by month the quotes appear?

SQL*Server 2008 SP1 applied but still tries to download and install from Windows Update

I had previously posted this on the windows update forum and was advised here was more appropriate. I have installed SQL*Server Express 2008 on laptop with windows7 and appled the SP1 update. This shows as applied correctly when looking at programs/updates from control panel, update logs. The management console confirms version 10.1.2531 is running. Each time I use windows update  the service pack is listed as needing download / install - the same KB968369 is given as the reference. I have run this a couple of times but the update is shown as outstanding each time. Any ideas how to resolve this? Thanks Colin

applying styles to xml element while reading it from webservices

hi,i have one xml document. i used to read the xml from webservices using c# and display the xml document content in the popup window. i wish to apply style for the xml element in the xml document. codes:  xml document:       <?xml version="1.0" encoding="utf-8" ?> <BubbleHelp> <Module name="ADMIN"> <HelpItem ID="BRANCHID"> <B>Hello</B>World!! ---bold format style is not applying while display it in the popup window </HelpItem> </Module> </BubbleHelp> webservice code used to read the xml document.      helpTopic[0]  = tagnode.InnerText; //text between the node i.e Hello World!!        

How to detect high contrast theme applied or not

I am working in VB.Net 2010, framework 2.0. I want to theme my application and I want to detect that high contrast theme is applied or not. I am using "Microsoft.Win32.SystemEvents.UserPreferenceChanged" events but exactly how to know which theme applied?. In the event of "Microsoft.Win32.SystemEvents.UserPreferenceChanged", controls many times after changing the event and so it is becoming difficult to know which theme is applied. Can anyone please tell me the exact way to know high contrast theme is applied or not???   Thanks in advance.
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