.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

WPF Ribbon - Remove from QAT not working

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :WPF
I've managed to get everything working the way I want it with the Microsoft WPF ribbon, but one thing eludes me - I can't remove items from the QAT once they're added. Is this perhaps due to my templating?   I've set the following ItemTemplate for the QAT: <ribbon:RibbonQuickAccessToolBar.ItemTemplate> <DataTemplate> <ribbon:RibbonButton Label="{Binding Path=DataContext.Label}" SmallImageSource="{Binding Path=DataContext.SmallIconPath}" LargeImageSource="{Binding Path=DataContext.LargeIconPath}" ToolTip="{Binding Path=DataContext.ToolTip}" Margin="0,-3,0,0" Command="{Binding Path=DataContext.Command}" /> </DataTemplate> </ribbon:RibbonQuickAccessToolBar.ItemTemplate> I can't seem to get it to display properly without the binding to my DataContext's DataContext. What I am doing is binding the itemssource of my RibbonTab to a viewModel and applying the following templates: <DataTemplate DataType="{x:Type Commands:CommandViewModel}"> <ribbon:RibbonButton Label="{Binding Label}" SmallImageSource="{Binding SmallIconPath}" LargeImageSource="{Binding LargeIconPath}" ToolTip="{Binding ToolTip}"

View Complete Post

More Related Resource Links

Quick Note: Working with the SharePoint 2010 Ribbon User Interface

Learn to extend the Microsoft SharePoint 2010 ribbon by adding a custom button that executes server-side code.

Remove items from a list literally not working as needed

This is why SharePoint drives me insane.  Everything I have been able to find on the web says I *can* programmatically remove list items from a list, all I have to do is a declining loop.  I have even copied verbatium several code examples found in this forum and on the web and every last one of them gives me a "Collection was modified; enumeration operation may not execute." error in the Event log.  This is a C# Windows Form Application we want to use to remove a common announcement from any announcement list in our entire site (top down).  We can *add* it to every announcement list without issue (seperate code).  Can anyone point out to us the error in our code below? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Microsoft.SharePoint; using System.Text; using System.Reflection; using System.IO; using System.Diagnostics; using System.Xml; namespace RemoveAnnouncement { public partial class RAForm : Form { public RAForm() { InitializeComponent(); } private void removeAnnouncment_Click(object sender, EventArgs e) { const string a = "Application"; try { if (tlsURL.Text.ToString() == "http://" || tlsURL.Text.ToString() == &qu

Custom actions and URL tokens when working with the Ribbon

I'm trying to add a new item to the Ribbon using a custom action in a VS SP2010 project. The new action shows up where we want it but the problem we are facing is that tokens like {ItemId} or {SelectedItemId} are not parsed when used in the CommandAction attribute. I would like to use these tokens and construct a URL pointing to an application page we've created. In the same way one can do using UrlAction when adding custom actions to the ECB menu (this is working fine in our project). The custom action below simply prints out different tokens. When run it seems like the tokens {SiteUrl},{SelectedListId} and {SelectedItemId}are parsed but for me both SelectedListId and SelectedItemId are null. Are there any other tokens that can be user or is there a better way to get hold of the item and list for the context? <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction Id="{1f2da003-2069-4d4a-8fc5-1deeb98ecdda}" Location="CommandUI.Ribbon" Sequence="20"> <CommandUIExtension> <CommandUIDefinitions> <CommandUIDefinition Location="Ribbon.ListForm.Display.Manage.Controls._children"> <Button Id="{ca157255-5ef3-4f1c-bcb6-6ff5ff7610fe}" Command="{7887e42e-

Hide/remove ribbon on public website

The new ribbon in SP2010 looks nice from a editors point of view. All webparts seems controlled by the contextual ribbon.Using webparts on a public website, like a discussion board, can the webparts be operated without the ribbon? Eg. creating and editing forum posts and other basic operations.The public website is fully skinned and therefore only the editor should see the ribbon for page and webediting. How is this done in SP2010?

Ribbon for WPF not working well on VS2010

I have instaled Ribbon for WPF on Windows 7 and VS2010 but the ribbonwindow looks like this:     Can you help me?

Microsoft Ribbon for WPF - How to remove white gloss from Tab Panel


Using the Ribbon, I can set the background property to Black. This doesn't set the entire background to black, but only appears to set part of a gradient to black, leaving the top half of the tab's panel with a gradient fade to white. (or maybe it's a clear to white gradient overlaying the black background).

I'd provide an image but I can't find any tools allowing me to upload one. The XAML to reproduce is quite simple however, just start a new project with a the Ribbon for WPF (downloaded from http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2bfc3187-74aa-4154-a670-76ef8bc2a0b4) and set the Ribbon's background to black:


"Remove URLs From Search Results" is not working.

In "Remove URLs From Search Results", I enter URL 'http:\\servername/sites/<sitename>' and do OK. Per the Microsoft article the crawl rule should be created for the same and site content should be removed immediately from the search results. I can see the crawl rule getting created, but, content is not removed from the search results.

Working with SharePoint document libraries

Document libraries are collections of files that you can share with team members on a Web based on Microsoft Windows SharePoint Services. For example, you can create a library of common documents for a project, and team members can use their Web browsers to find the files, read them, and make comments. Users with Microsoft Office 2003 can check out and edit the files as if they resided on a local or network drive.

By default, your team Web site comes with a built-in document library named Shared Documents, which is listed on the Quick Launch bar as well as on the Documents and Lists page.

Working with DropDownList and ListBox Controls in ASP.NET

"In my application i am using dropdownlist to display all categories from a table. When the user clicks this control I display all records in that category. Category table also contains column called color.

I wanted display some categories in dropdown list different color and others in different color using ASP.NET."-Anonymous

Creating Dialogs and Ribbon Controls for SharePoint 2010

SharePoint 2010 provides new user interface components, such as server ribbons, and the new dialog platform. As a developer, you can create controls for the server ribbon and dialog boxes for the dialog platform.

Server side validation of Fileupload control not working



I've tried this method in my code behind to try and validate that the Fileupload control has a file or not. I get the error message the the event "Server Validate" cannot be found. Can anyone tell why? Thanks.

Public Sub CustomValidator1_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles CustomValidator1.ServerValidate

' Get file name

        Dim uploadAvatar As FileUpload = DirectCast(AdvertisementForm.FindControl("uploadAvatar"), FileUpload)

        Dim UploadFileName As String = uploadAvatar.PostedFile.FileName

        If UploadFileName = "" Then
            ' There is no file selected
            args.IsValid = False
            Dim Extension As String = UploadFileName.Substring(UploadFileName.L

Row command working on all rows not selected one?



I have this code that hides a column in a gridview.  (The column houses another nested gridview).

    Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
        If e.CommandName = "Select" Then
            If GridView1.Columns(0).Visible = False Then
                GridView1.Columns(0).Visible = True
                GridView1.Columns(0).Visible = False
            End If
        End If
    End Sub

The trouble is that if I click the select link on one row that action to hide is carried out on all rows.  How can I set this up so that it only hides the row that is selected?


upload file not working



iam using masterpage and ajax update panel, i have child page called  fileupload.aspx,i try to upload the file

but its not working , can i use updatepanel in child page , pls very urgent

looking forward for answer.

JQuery Treeview plugin is not working with Ajax page load in ie8


Hi there,

I developed a page where i m using jquery treeview plugin to generate tree. It worked fine on FF, IE8 with out ajax.

But when my page loads thro' ajax call in IE8, it is not collapsing or expanding tree.

Any idea?

Thanks in advance.

jquery confirm windows isn't working


Hi, i am using jquery to implement a modal confirm windows but it not working

i have a template field button with ajax confirm using jquery but i have a problem. Apper the confirm windows but when i click on "yes" doesn't execute the delete command. without ajax (using template field button and simple confirm windows javascript) works so well.

Can you give me a hand with this?

thx in advance!

<link href="_assets/css/StyleSheet.css" rel="stylesheet" type="text/css" />
<link href="_assets/css/confirm.css" rel="stylesheet" type="text/css" />
<script src="_assets/js/jquery-1.2.6.min.js" type="text/javascript"></script>
<script src="_assets/js/jquery.simplemodal-1.1.1.js" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function() {
       $(".deleteCustomer").click(function(ev) {
                var msg = $(this).attr("title");
                confirm(msg + "?");

Remove #Region from whole web site


Hi All,

I need to deliver source code to client and my boss need to remove all the comments and #region sections from the whole web site source code.

So is there any functionality available in visual studio 2010 or may be in an other 3rd party tool available to do so, which can remove all the #region from all over the source code ?

Otherwise my developers has to do donkey work.... :(( and I don't wish it. 

Any help or tips/tricks would be appreciated.


Keyboard shortcuts stops working in WebMatrix


I'm often experiencing that keyboard shortcuts stops working in WebMatrix. This is very annoying as CTRL-S, CTRL-C, CTRL-V, etc. stops working, all of which are heavily used when programming. It's obviously hard to explain how to reproduce this, but I was wondering if someone knows a quick-fix?

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