.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

Problems with Binding Icon in dynamic MenuItem

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

I'm don't understand when I use hardcoded
<MenuItem.Icon><Image Source="images\image.png"/></MenuItem.Icon>
all works fine, but when I use binding it doesn't work :( !!!

<XmlDataProvider x:Key="data">
Items xmlns=""

View Complete Post

More Related Resource Links

Dynamic WPF: Create Flexible UIs With Flow Documents And Data Binding


Flow documents offer enormous flexibility in arranging text layout and pagination, but they don't support data binding, so you can't dynamically change content. Here we build a component to solve that problem.

Vincent Van Den Berghe

MSDN Magazine April 2009

Dynamic Binding of a Public Property in a User Control

Hi, I am not sure how to pass a variable from an .aspx page to an .ascx page.  I have a Control that puts rotating banners on a page.  The control has several public properties.  However, only one of those properties changes on the page level.  All the other properties are the same for every page site-wide.  So, instead of setting all the properties on every page in my sites (many sites), I want to set it up so I only have to setup the sitewide properties once and only the page level properties on each page.   I want to create a control with a property of AdKeyword="somename" and pass it to another control that will grab that page-level property and add it to all the other site-wide properties.  I guess what I need could be called a Dynamic Control Property.   My .aspx page has:<%@ Register TagPrefix="uc1" TagName="Banner1" Src="banner1.ascx" %> <asp:Content ID="Leaderboard" runat="server" ContentPlaceHolderID="Leaderboard"> <uc1:Banner1 AdKeyword="L2Chamber" runat="server" OverrideHeight="90" /> </asp:Content> My banner1.ascx page has:<%@ Control Language="VB" ClassName="UserControl297" %> <%@ register tagprefix="uc1&

silverlight + WCF Service + Dynamic proxy(custom binding) + basic authentication on iis

hi all, I am having an issue with how to get windows identity in silverlight project. Below is my scenario: the silverlight application need to get data from server via WCF service, i used the way that built dynamic proxy at runtime and aslo used custombinding in this case. Now my application need to deploy on iis and chosen "basic authentication" as a authentication mode. Thus i have chosen authentication mode in WCF was " <security authenticationMode="UserNameOverTransport">". At the client side where kind of project is silverlight that i need have to dynamic proxy with custombinding. My question is: In basic authentication how can i get windows identity to set to chanelfactory.Credentials: _channelFactory = new ChannelFactory<TWebService>(this._binding, new EndpointAddress(_endpointAddress));            _channelFactory.Credentials.UserName = new UserNamePasswordClientCredential();            _channelFactory.Credentials.UserName.UserName = "username";            _channelFactory.Credentials.UserName.Password = "password"; actually, i do not want to use Windows a

Problems writing a dynamic L2E query

I'm trying to re-work a L2E query to be more dynamic, but I'm not having much luck. Basically, I have two parameters (and many more to come, just laying the foundation), and the parameters are both optional from a user-endpoint.Originally I wrote this static expression:int personnelId = 1234; int divisionId = 1234; var results = (from a in ctx.Attendees from d in a.Divisions join p in ctx.Personnel on a.PersonnelID equals p.PersonnelID where a.PersonnelID == personnelId && d.DivisionID == divisionId select new Attendee { firstName = a.FirstName, lastName = a.LastName });Attendee is a POCO. After I wrote this, I realized that if personnelId or divisionId weren't passed in (or if just one were passed in) I'd want a different result set. I'm conceptualizing the idea like this (doesn't compile, but you get the drift):var results = (from a in ctx.Attendees select new Attendee { firstName = p.FirstName, lastName = p.LastName }); if (personnelId != null) { results = (from a in results join p in ctx.Personnel on a.PersonnelID equals p.PersonnelID where a.PersonnelID == personnelId select a); } if (divisionId != null) { results = (from a in results from d in a.Divisions where d.DivisionID == divisionId select a); } results = results.ToList();Doesn't work well though, because my

Dynamic Textbox List Control - problems refreshing


Ive been stuck on this one for a month:

So I have a custom control that has a list of textboxes, and a button that will dynamically add a new textbox to the list.

 So I have an addTextbox() function, that will do something like

TextbBox t = new TextBox()

 then I add it to the page.  So adding a new textbox works fine, but I have values that I want to put into each textbox and upon each page load, the values get replaced.  What I need to do is get the textboxes from the viewstate so I can use their values for other textboxes, but since they are created anonymously, im not sure how I can do that.  I tried to get the unique name and put all of them into an arraylist, then upon the next page load, load the names from the list, but the unique name isnt unique.  Thanks

Dynamic ItemTemplate binding?



I defined an ItemTemplate for an object type.

    <DataTemplate x:Key="listViewItemTemplate" DataType="{x:Type model:ParameterWithValue}">
        <Grid DockPanel.Dock="Top" IsEnabled="{Binding Enabled, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}">
When one or more of my objects change their Enabled properties, the layout is not updated... why this?

Binding MenuItem.IsChecked to RichTextBox.SpellCheck.IsEnabled


I have the following deceleration of a rich text box:


    SpellCheck.IsEnabled = "False"
    ContextMenu="{StaticResource rtfBoxContextMenu}">    


And the context menu is defined as follows:



Dynamic data binding in rdl reports


I was wondering if rdl reports displayed on ReportViewer could be dynamically data-binded.

If I want to generate a rdl report of a certain month by choosing the months of a year included in a dropdownlist, instead of generating 12 reports and uploading them to Report Server, is there a more dynamic way to display a rdl report on ReportViewer?(e.g. using parameters) I'm displaying the reports on the webpage, so I hope this is something I can do programmatically.

I done some research on this but still couldn't find a clue. Thanks in advance! 

Listview selecteditem binding to textbox causing problems




I have listview and i have binded the listview selected item to a grid's datacontext. The grid contains a text box whose text property is bound to one of the columns in the listview. I have Add, Edit and Delete buttons to manipulate data in the listview.


Whenever i change the selected item in the listview the text in the textbox is changing. Since by default the binding is two way if i edit the data in the textbox it is reflectedi in the listview. But upon clicking on the cancel button the textbox value is not reverted back to old value. The list view itemsource is bound to an object of the class BindingListCollectionView

Code in button click event where BindingDetails is object of calss BindingListCollectionView. But this code does not rollback the changes in the textbox.


btnCancel_Click(object sender, EventArgs E)
  if(IsEdit == true)


I tried the following things.

Trying to get the Text depe

What is dynamic binding in C#



good evenning all,

can anybody tell me what is dynamic or late binding in C#(oops) with practical example.

Thanks to all.

MVC Binding to dynamic checkbox group



I'm not sure of how the view binds to dynamic checkbox group...I'm having problems posting values back to controller. 


public class CheckboxInfo
    #region Private Fields

    private string _text;
    private string _value;
    private bool _ischecked;

    #region Public Properties

    public CheckboxInfo()
    public CheckboxInfo(string text, string value, bool ischecked) 
        _text = text;
        _value = value;
        _ischecked = ischecked;

    public string Text
        get { return _text; }
        set { _text = value; }
    public string Value
        get { return _value; }
        set { _value = value; }

    public bool IsChecked
        get { return _ischecked; }
        set { _ischecked = value; }



using System;
using System.Collections.Generic;
using MVCWebAppStage2.NorthwindServices;
using System.Web.Mvc;

public class CustomerViewData

    private List<CheckboxInfo> _countryCheckboxes = new List<CheckboxInfo>();
    private IEnumerable<Customer> _customerList = new List<Customer>();

    public List<CheckboxInfo> CountryCheckboxes
        get { return _countryCheck

Adding a Command in a Dynamic MenuItem

Hello, and thank you for taking a look at this question.

I am developing my own Most Recent Used sub-menu. I have developed my main File Menu items (Open, Close, Save etc) in my XAML and included a binding for these to my commands which are defined in my ViewModel. These all work fine.

I have decided to save the file path and date into an XML file for simplicity. I can read this in and in my ViewModel I have a ListCollectionView property which exposes the XML elements. Still fine!

In my XAML I can bind my Recent Items sub-menu to the Filename item in my ListCollectionView without a problem, but I cannot seem to figure out how to bind each sub-menu item to a Command which will determine which file to open.

My XAML so far is as follows:

            x:Name="MainMenu" Background="#FFFFFFFF" BorderBrush="#FF000000" Margin="0,0,0,2.723" Grid.ColumnSpan="2" d:LayoutOverrides="Height, GridBox">
            <MenuItem Header="_File">
                <MenuItem Header="_Open" InputGestureText="Ctrl+O" Command="{Binding Path=OpenCommand}"/>
                <MenuItem Header="_New" InputGestureText="Ctrl+N" Command="{Binding Path=NewCommand}"/>
                <MenuItem Header="_Close" InputGestureText="Ctrl+Q" Command="{Binding Path=CloseCommand}"/>
                <MenuItem Heade

gridview binding problems


am new to this forum....

hi i have 3 tables

customerlogin (cus_id)



inputs are customerlogin cust_id and product prod_id

i want to get the output lik this..

if customerlogin cus_id=custprice cust_id and p.prod_id=customerprice prod_id means

output is lik customerprice table priceamt


product table pricceamt

here in my from am giving only one productid and multiple customerid

my store procedure is given below:

if exists(select cp.cust_id,p.PID from CustomerLogin c,Customerprice cp,Productable p
where cp.cust_id=@cust_id And cp.PID=@PID)
--select cp.Productprice from Customerprice cp where cp.cust_id=c.cust_id
select distinct cp.Productprice,'auto' as Pricetype,c.cust_name,c.usercus_name
from Customerprice cp inner join CustomerLogin c
on cp.cust_id=c.cust_id
if exists(select cp.cust_id,p.PID from CustomerLogin c,Customerprice cp,Productable p where cp.cust_id!=@cust_id And cp.PID!=@PID)
select distinct p.Productprice,'manual' as Pricetype,c.cust_name,c.usercus_name
from Productable p,CustomerLogin c
where p.PID=@PID

am getting

Dynamic binding in Mind Map


Hi Team,


I would like to pass parameter to database from SharePoint site in turn from the query result I need to generate mind manger dynamically and bind to SharePoint site.


Is the above case is possible?


Any idea for the above scenario if so kindly help me in doing so….


Binding WPF Controls to an Entity Data Model

In this interview, programming writer, McLean Schofield, demonstrates how to bind WPF controls to an entity data model, using Visual Studio 2010 Beta 1. You can also learn more in the topic: Walkthrough: Binding WPF Controls to an Entity Data Model.

Adding Dynamic Rows in ASP.NET GridView Control with TextBoxes and with Delete functionality

In my previous examples, I have demonstrated on how to add dynamic rows in GridView control with TextBoxes and how to save the values into the database. Now, seems that most of the developers are asking if how to add a delete functionality with it. So in this example, I'm going to show on how to delete a certain row in the dynamic GridView with TextBoxes.

Binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Here is the code for binding the multiple drop down boxes in GridView using JQuery in ASP.NET
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