.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

Biding, Misunderstanding

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

Hello, I have very stange problem that I can't understand. 

I have window with ItemsControl and couple DataTemplates for it.

Here is short version of problematic datatemplate:


<DataTemplate x:Key="URIFieldTemplate">

UriValue="{Binding Path=ObjectAsStringValue, Mode=TwoWay}"

Cause biniding exception: 

System.Windows.Data Error: 40 : BindingExpression path error: 'ObjectAsStringValue' property not found on 'object' 'UriEditField' (Name=')'. BindingExpression:Path=ObjectAsStringValue; DataItem='UriEditField' (Name='); target element is 'UriEditField' (Name='); target property is 'UriValue' (type 'String')

But for some reason at the same time code like:
 <Label Content="{Binding Path=ObjectAsStringValue, Mode=TwoWay}"></Label>
Works and more over workaround like:
<Label Content= 

View Complete Post

More Related Resource Links

System.Uri constructor. Bug or my misunderstanding?

Hello. I use this Uri constructor: Uri (Uri, String). Base uri refers to: https://admin.fedoraproject.org/updates/F13/security?_csrf_token=bfd822860e8c532850b9ba817aebecbefdd490be and ?updates_tgp_no=2&_csrf_token=e075a5525532054a2e0f58c4674f875a6779b37a&updates_tgp_limit=25 stands for the relative address. What should be the target uri? I believe it is : https://admin.fedoraproject.org/updates/F13/security?updates_tgp_no=2&_csrf_token=e075a5525532054a2e0f58c4674f875a6779b37a&updates_tgp_limit=25 but I get https://admin.fedoraproject.org/updates/F13/?updates_tgp_no=2&_csrf_token=e075a5525532054a2e0f58c4674f875a6779b37a&updates_tgp_limit=25 so 'security' is omitted. Can anybody tell me why it's so?

Details View Biding Custom Object with Enum properties fields

Hello, I'm trying to bind custom object to details view. The problem is that enum property fields are not show.Is there any way to show enum property fields in details view ?I put some example code below (I do not specify any rows mappings, they are generated dynamically because different kind of objects are bound to details view):// My object public class OrderItem { public ItemKindEnum unitemizedItemKind { get { return (ItemKindEnum)this.unitemizedItemKindID; } } ... } // Details view configuration <asp:DetailsView ID="dvOperationDetails" runat="server" DefaultMode="ReadOnly" ... />

Hi.how to insert first row in biding from db combobox?

Hi. I have combobox which biding data from data base with ado.net. I wont to set a first row with value "Selected" how I can do tish? there is my code.   DataSet ds1 = new DataSet();                 SqlConnection con = new SqlConnection("Data Source=DYS;Initial Catalog=DMS;Integrated Security=True");                 SqlCommand cmd1 = new SqlCommand("SELECT CUSTOM_ALIAS, C_DESCRIPT FROM [MHGROUP].CUSTOM3", con);                 SqlDataAdapter sqlDa1 = new SqlDataAdapter();                 sqlDa1.SelectCommand = cmd1;                 sqlDa1.Fill(ds1);                 DivisonName.ItemsSource = ds1.Tables[0].DefaultView;                 DivisionCode.ItemsSource = ds1.Tables[0].DefaultView;                 DivisionCode.SelectedIndex = -1; Xal

Why some reason I get in biding combo box previous selected value.


  Why some reason I get in biding combo box previous selected value. :

I chose Value 1000 I get blank combo after I return and choose 1001 I get all Values equals to 1000/1,1000/2 if I choose again new value 1002 I get 1001/1,1001/2 There is happen because I use selected index?

I want to emphasize that I use in the code selected index -1 maybe this causes to the problems?

private void Window_Loaded(object sender,

Misunderstanding of Arrays, IEnumerable, IQueryable and Accessing their Values


I have a database and Web Application that I would like to write some logic for.  I would like to:

1) Get an Assessment from the database table Assessment, based upon the AssessmentID ( GetAssessmentByAssessmentID() )
2) Access the "values" returned from that Assessment, to do some calculations 

I don't really understand the Array, IEnumerable, IQueryable interfaces well enough to know what SHOULD be the conventions and methods I should use, and I also cannot access the values that I want to.

For Example:

        protected void Page_Load(object sender, EventArgs e)
            AssessmentsBLL _assessments = new AssessmentsBLL();
            Array userPerformance = _assessments.GetAssessmentByAssessmentID(2).ToArray();

            GridView1.DataSource = userPerformance;

            lblTest.Text += userPerformance.GetValue(0).ToString() + "<br />";

        public IEnumerable<Assessment> GetAssessmentByAssessmentID(int _assessmentID) //Should I Return an IEnumerable<Assessment> here?
            IEnumerable<Assessment> _assessment = _context.Assessments
                .Where((c) => c.AssessmentID == _assessmentID);
            return _assessment;


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