Search Results

Search found 12126 results on 486 pages for 'property hiding'.

Page 126/486 | < Previous Page | 122 123 124 125 126 127 128 129 130 131 132 133  | Next Page >

  • ASP.NET MVC Binding issue

    - by user295541
    Hi, I have an object with a property called "name". This object has a sub object that has a property called "name" as well. Transaction.name Transaction.TransactionItem TransactionItem.name I bind Transaction object to a partial control as usual: Html.TextBox("name", Model.name)% Model is a Transaction object. And I bind TransactionItems: < if (Model.mtTransactionItem != null) { foreach (var item in Model.mtTransactionItem) { % <%= Ajax.ActionLink(item.name, "ShowItem", new { id = item.id }, new AjaxOptions { UpdateTargetId = "dialog-form" })% And when I update the one of the transaction items through an ajax call I pass the entire transaction object to the partial view. When I debug I check the Model.name property, and it has a proper value. But on the page shows the name of TransactionItem value instead of the name of Transaction value. What do I do wrong? I have checked this problem in MVC 1.0 and MVC 2.0 framework.

    Read the article

  • [XAML] datatrigger

    - by Bert
    Hi, I have a UserControl in XAML with a couple of buttons.... When the "VideoEnable" property in my C# code change to true i want to change the color of a button. The following code compiles but crashes and I cant find a right solution <UserControl.Triggers> <DataTrigger Binding="{Binding VideoEnable}" Value="true"> <Setter Property="Button.Background" Value="Green" TargetName="VideoButton" /> <Setter Property="Grid.Background" Value="Blue" TargetName="videoGrid" /> </DataTrigger> </UserControl.Triggers>

    Read the article

  • iPhone SDK. How to assign NSString to UILabel text ?

    - by Del
    If I have a class/object like this #import <Foundation/Foundation.h> @interface anObject : NSObject { NSString *aProp; } @property NSString aProp; @end and in the cellForRowAtIndexPath method i want to assign one of the string values from its properties to a uilabel of a tableviewcell, how do i do it? I've tried this but it doesn't work [[cell topLabel] setText:(NSString *)anObject.aProp]; Putting a breakpoint on the above line and inspecting it, the debugger says "variable is not a CFString Casting the property to a CFString doesnt work Modifying the class and declaring the property as a CFStringRef doesnt work either

    Read the article

  • How do I set an Array in one class with another array in another class in Objective-C

    - by Stef
    Hi Guys, I've populated and array with data like this in one class... PowerClass .h NSMutableArray pickerArray; @property (nonatomic, retain) NSMutableArray pickerArray; - PowerClass .m @synthesize pickerArray; @implementation NSMutableArray *array = [[NSArray alloc] initWithObjects:@"stef", @"steve", @"baddamans", @"jonny", nil]; pickerArray = [NSMutableArray arrayWithArray:array]; And I'm trying to set the Array in another class WeekClass .h PowerClass *powerClass; NSMutableArray *pickerData; @property (nonatomic, retain) NSMutableArray pickerData; @property (nonatomic, retain) PowerClass *powerClass; WeekClass .m @implementation pickerData = [NSMutableArray arrayWithArray:powerClass.pickerArray]; I have no errors or warnings. It just crashes. The NSLog says that the powerClass.PickerArray is Null... I don't know why this is... Please help point me in the right direction... Thanx guys Stef :-)

    Read the article

  • Resolve formatted table value in wix custom action

    - by Michael Stoll
    Hi, I've created certificate wix extension (extension of IisExtension). This includes a custom table, which is consumed by a custom action. A column is defined as follows: <columnDefinition name="Account" type="string" length="72" primaryKey="yes" modularize="property" category="formatted" description="..." /> This column contains values like "[Property]". When the custom action reads this column like this: hr = WcaGetRecordString(hRecCertificate, vcpqAccount, &pwzTemp); it get's the string "[Property]". But I need "PropertyValue". How can this string be resolved? Regards Michael

    Read the article

  • Reflecting derived classes in C#

    - by rook
    Let's assume there's a class with a virtual property (let's call it 'P'). It's overridden in a deriving class. Now I want to use something like this: obj.GetType().GetProperty("P") to get info about the overriding property. This search is ambigous, because there are two "P" properties (base and override). So I typed: obj.GetType().GetProperty("P", BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance) It returns the overriding "P" only, but what if I can't guess in compile time if there's an override at all? The latter call would return null. The case is even more complicated, if the hierarchy of inheritance is bigger. In other words, I want to get the 'top-most' override available, otherwise - the base property. What is the cleanest way to achieve the aim? Only one I know at the moment is to go through all properties and check name and declaring type.

    Read the article

  • How to Track F5/Refresh in ASP.Net

    - by Everest
    I am using VS 2005, C# 2, ASP.Net 2.0 I am unable to find out how to track that user pressed F5/Ctrl+F5/ Open a new Window(Ctrl + N) in ASP.Net. I know that there is a Page.IsPostBack property, which tells that a page is loaded in response to an action taken by user. I am just curious to know, that why isn't there a property as IsRefresh or Page.IsRefresh in ASP.Net, which will return true, whenever user takes any of the above actions. Is there a way to know this? Actually my problem is that i have a DLL using which all of my aspx pages are inherited, I have to insert some values in a table whenever the page is opened for the first time that's it, if user just opens the page or do not take any action, an entry should be inserted into the database, but as far as I have tried, I controlled it anyhow using the Page.IsPostBack property, but I got stuck in the refresh case, as it is inserting records unconditionally.

    Read the article

  • WPF DataGrid: How to get Converter

    - by Nike
    I create DataGrid Columns with Binding (where i is a Int value): dataGrid.Columns.Add(new DataGridTextColumn { Header = i.ToString(), Binding = CreateBinding(i), }); private Binding CreateBinding(int num) { Binding bind = new Binding(string.Format("[{0}]", num)); bind.Converter = new CellValueConverter(); return bind; } In the CreateBinding method I have an access to bind.Converter property. I need to call Converter.Convert() method in some handler, but there is no Converter property when I try to access it: (dataGrid.Columns[clm] as DataGridTextColumn).Binding."no Converter property!" How can I get my CellValueConverter which was created for particular Column?

    Read the article

  • What is a good pattern for binding a collection of objects coming from WCF, in Silverlight?

    - by Krishna
    Hi there, I've got a question about a Silverlight WCF Databinding pattern: There are many examples about how to bind data using {Binding} expressions in XAML, how to make async calls to a WCF service, set the DataContext property of a element in the UI, how to use ObservableCollections and INotifyPropertyChanged, INotifyCollectionChanged and so on. Background: I'm using the MVVM pattern, and have a Silverlight ItemsControl, whose ItemsSource is set to an ObservableCollection property on my ViewModel object. My view is of course the XAML which has the {Binding}. Say the model object is called 'Metric'. My ViewModel periodically makes calls to a WCF service that returns ObservableCollection. MetricInfo is the data transfer object (DTO). My question is two-fold: Is there any way to avoid copying each property of MetricInfo to the model class - Metric? When the WCF calls completes, is there any way to make sure I sync the items which are in both my local ObservableCollection and the result of the WCF call - without having to first clear out all the items in the local collection and then add all the ones from the WCF call result? thanks, Krishna

    Read the article

  • NULL handling with subselect in Hibernate Criteria API

    - by Jens Schauder
    I'm constructing a Hibernate Criterion, using a subselect as follows DetachedCriteria subselect = DetachedCriteria.forClass(NhmCode.class, "sub"); // the subselect selecting the maximum 'validFrom' subselect.add(Restrictions.le("validFrom", new Date())); // it should be in the past (null needs handling here) subselect.add(Property.forName("sub.lifeCycle").eqProperty("this.id")); // join to owning entity subselect.setProjection(Projections.max("validFrom")); // we are only interested in the maximum validFrom Conjunction resultCriterion = Restrictions.conjunction(); resultCriterion.add(Restrictions.ilike(property, value)); // I have other Restrictions as well resultCriterion.add(Property.forName("validFrom").eq(subselect)); // this fails when validFrom and the subselect return NULL return resultCriterion; It works ok so far, but the restriction on the last line before the return statement is false when validFrom and subselect result in NULL. What I need is a version which handles this case as true. Possibly by applying a NVL or coalesce or similar. How do I do this?

    Read the article

  • MVVM - RaisePropertyChanged turning code into a mess

    - by vidalsasoon
    New to MVVM so please excuse my ignorance. I THINK i'm using it right but I find my ViewModel has too many of these: RaisePropertyChanged("SomeProperty") Every time I set a property I have to raise that damned property changed. I miss the days where I could just go: public int SomeInteger { get; private set;} These days I have to stick the "RaisePropertyChanged" in everywhere or my UI does not reflect the changes :( Am I doing it wrong or are other people getting annoyed with the excessive number of magic strings and old school property setters? Should I be using dependency properties instead? (I doubt that would help the code bloat anyway) Despite these problems I still think MVVM is the way to go so I guess that's something.

    Read the article

  • Filter elements in PropertyGrid

    - by serhio
    In System.Windows.Forms there are a PropertyGrid that displays properties of an attached object. Let's say MyTextBox : TextBox. Now, I would like to display on it some MyTextBox properties, say only Size, Location and my custom property Date. More that than, I would like to be able to change the real property names, say "Dimension", "Location" and "Starting Date". I saw two projects on this subject : first and second, but first does not work well(for browsable properties), and the second seems to add an event for each property changes, this is not acceptable.

    Read the article

  • How do I set an array in one class with another array in another class

    - by Stef
    I've populated and array with data like this in one class... PowerClass.h NSMutableArray pickerArray; @property (nonatomic, retain) NSMutableArray pickerArray; - PowerClass.m @synthesize pickerArray; @implementation NSMutableArray *array = [[NSArray alloc] initWithObjects:@"stef", @"steve", @"baddamans", @"jonny", nil]; pickerArray = [NSMutableArray arrayWithArray:array]; And I'm trying to set the Array in another class WeekClass.h PowerClass *powerClass; NSMutableArray *pickerData; @property (nonatomic, retain) NSMutableArray pickerData; @property (nonatomic, retain) PowerClass *powerClass; WeekClass.m @implementation pickerData = [NSMutableArray arrayWithArray:powerClass.pickerArray]; I have no errors or warnings. It just crashes. The NSLog says that the powerClass.pickerArray is NULL. Please help point me in the right direction.

    Read the article

  • Liquid templates - accessing members by name

    - by egarcia
    I'm using Jekyll to create a new blog. It uses Liquid underneath. Jekyll defines certain "variables": site, content, page, post and paginator. These "variables" have several "members". For instance, post.date will return the date of a post, while post.url will return its url. My question is: can I access a variable's member using another variable as the member name? See the following example: {% if my_condition %} {% assign name = 'date' %} {% else %} {% assign name = 'url' %} {% endif %} I have a variable called name which is either 'date' or 'url'. How can I make the liquid equivalent of post[name] in ruby? The only way I've found is using a for loop to iterate over all the pairs (key-value) of post. Beware! It is quite horrible: {% for property in post %} {% if property[0] == name %} {{ property[1] }} {% endif %} {% endfor %} Argh! I hope there is a better way. Thanks.

    Read the article

  • struts 2 bean is not created

    - by Dewfy
    Hello colleagues! At first some precondition to my question, I'm using struts2 + tiles2 + toplink. NO spring at all. The simplest scenario - is to display list of entities on the page. To optimize resolving JPA's EntityManager I would like to create helper (JPAResourceBean) that implements lazy load of entity manager. For this purposes I'm going to use struts2's bean declaration: <bean name="myfactory" class="my.model.JPAResourceBean" scope="session" optional="false"/> Why bean is not instantiated neither in session? (I'm using s:property just for debug) ... <s:property value="#session.myfactory" default="buka.1"/> ... nor in plain bean list: ... <s:property value="#myfactory" default="buka.2"/> ... May be the second part of question is - how to resolve this bean from java code?

    Read the article

  • Shorthand for nested null checking C#

    - by Myster
    As far as I know there is not a significantly more elegant way to write the following.... string src; if((ParentContent!= null) &&(ParentContent.Image("thumbnail") != null) &&(ParentContent.Image("thumbnail").Property("src") != null)) src = ParentContent.Image("thumbnail").Property("src").Value Do you think there should be a C# language feature to make this shorter? And if so, what should it look like? for example, something like extending the ?? operator string src = ParentContent??.Image("thumbnail")??.Property("width")??.Value; Apologies for the rather contrived example, and my over-simplified solution.

    Read the article

  • newbie question: how to show a drop down menu with this function

    - by Mellon
    My model object (e.g. MyObject) has one property (e.g. color), the "color" property holds a string value which comes from a list of string (e.g. colors=['red','yellow', 'black']). now, I have one instance of myObject get from database and show on the view page in a row, I need to show the 'color' property of myObject in a drop down menu with the current value as the default selected. How to implement this in Rails 3 in my view page. (Later, when user select from the dropdown menu, the object will be updated in DB based on user's selection) Please explain with instance "myObject" and list "colors=[...]"

    Read the article

  • database design question

    - by Leonardo
    Hi all, I am building a database as a simple exercise, it could be hosted on any database server, so I am trying to keep things as much standard as possible. Basically what I would like to do is a 'code' table that get referenced by other entities. I explain: xcode id code r role p property code r admin r staff p title .... then I would like to have some view like: role (select * from code where xcode='r') r admin r staff property (select * from code where xcode='p') p title then, suppose we have an entity myentity id - 1 role - admin (foreign key to role) title - title (foreign key to property) Obviously I cannot create foreign key to a view, but this is to tell the idea I have in mind. How can I reflect such behaviour using whenever possible, standard sql syntax, then as a second option, database additional features like trigger ecc... ? Because if I tell that role and title in myentity are foreign key to 'code', instead of the views, nothing would stop me to insert a role in title field. thanks Leonardo

    Read the article

  • Javascript function push problem

    - by Stefan
    Hello i've following JS function. responseData:function(resp){ this.jsondata = eval('(' + resp + ')'); this.propList = []; for (var i = 0;i<this.jsondata.length;i++) { for (obj in this.jsondata[i]) { alert(obj); //shows the property name of obj this.propList.push({ obj : this.jsondata[i][obj] //insert only simple obj string }); } } return this.propList; } I want to insert in my propList the property name and the value, but instead inserting the property name this function inserts simple 'obj' as a string. What i'm doing wrong? greetings Stefan

    Read the article

  • How should moq's VerifySet be called in VB.net

    - by Bender
    I am trying to test that a property has been set but when I write this as a unit test: moqFeed.VerifySet(Function(m) m.RowAdded = "Row Added") moq complains that "Expression is not a property setter invocation" My complete code is Imports Gallio.Framework Imports MbUnit.Framework Imports Moq <TestFixture()> Public Class GUI_FeedPresenter_Test Private moqFeed As Moq.Mock(Of IFeedView) <SetUp()> Sub Setup() moqFeed = New Mock(Of IFeedView) End Sub <Test()> Public Sub New_Presenter() Dim pres = New FeedPresenter(moqFeed.Object) moqFeed.VerifySet(Function(m) m.RowAdded = "Row Added") End Sub End Class Public Interface IFeedView Property RowAdded() As String End Interface Public Class FeedPresenter Private _FeedView As IFeedView Public Sub New(ByVal feedView As IFeedView) _FeedView = feedView _FeedView.RowAdded = "Row Added" End Sub End Class I can't find any examples of moq in VB, I would be grateful for any examples.

    Read the article

  • How to do pointer work with accessor methods in Objective-C

    - by Jasconius
    Basic problem statement: I have a very good reason for doing some pointer fanciness in an app where I need to pass a decimal by reference. So I have a class which stores many a decimal, so let's say is has a property as such: @property (nonatomic) double myDecimalValue; I want to pass it by reference to some other class. [someOtherObject sendMyDecimalByReference:&myDecimalValue]; But, a problem emerges! The way that actually has to be written (because it's a property) is [someOtherObject sendMyDecimalByReference:&decimalOrigin.myDecimalValue]; This fails to compile in objective-c I get around it by writing the following - (double *) myDecimalValueRef; [someOtherObject sendMyDecimalByReference:[decimalOrigin myDecimalValue]]; Except I have dozens of these decimals and I don't want to write that stupid wrapper function for every value. Is there a shorthand way to do this in Objective-C using just the Getter functions? Let's just assume I have a great reason for not using NSNumber. Thanks!

    Read the article

  • How to stop a WPF binding from ignoring the PropertyChanged event that it caused?

    - by Jacob Stanley
    I have a TextBox bound to a ViewModel's Text property with the following setup: Xaml <TextBox Text="{Binding Text}"/> C# public class ViewModel : INotifyPropertyChanged { public string Text { get { return m_Text; } set { if (String.Equals(m_Text, value)) { return; } m_Text = value.ToLower(); RaisePropertyChanged("Text"); } } // Snip } When I type some stuff in to the TextBox it successfully sets the Text property on the ViewModel. The problem is that WPF ignores the property changed event that is raised by it's own update. This results in the user not seeing the text they typed converted to lowercase. How can I change this behaviour so that the TextBox updates with lowercase text? Note: this is just an example I have used to illustrate the problem of WPF ignoring events. I'm not really interested in converting strings to lowercase or any issues with String.Equals(string, string).

    Read the article

  • Upload documents using email and mapping properties of documents

    - by stranger001
    Hi, We have a requirement to upload documents to a specific SharePoint document library when a document is sent via email to a specific email address. I think SharePoint has this feature available. What I would like to know more importantly is mapping the information in the body of the email to the custom properties of the document. For example, if a custom field (property) is added to the document in SharePoint say - "Year". I provide the value of this property within the body of the email and attach the document in email. Is it possible that the provided value in the body of the email for the property is updated in SharePoint when the document is uploaded to SharePoint through email? We are using SharePoint 2007. Appreciate any information on this. Thanks

    Read the article

  • Is there an equivalence to CDOSYS AutoGenerateTextBody in .NET

    - by AnthonyWJones
    I'm porting some VBScript code which generates emails using the standard CDOSYS Message object. The Message oject has a property AutoGenerateTextBody which when true will cause it to automatically create the TextBody property value when you assign HTML to the HTMLBody property. Hence creating the typical text/plain and text/html alternatives in the message body. However .NET appears to be missing this function. The MailMessage object does have the ability to create alternative views but there doesn't appear to be a way to easily create the text body content from the HTML content. I'm not necessarily looking for an auto-magic option but I do need a solution to taking what is an HTML string and converting it to a reasonable plain text representation. Just dropping all the HTML markup doesn't cut it. Is there a tool buried somewhere in the existing .NET framework that can do this?

    Read the article

  • Returning unique values of a multi-dimensional array with CodeIgniter PHP

    - by Michael Bradley
    Hi - I'm developing a property rentals website. The search results page will contain a list of property results. It is my intention to redefine the results, say by town, country, property type etc. So let's say for example the user searches 'France'. All of the relative properties will be returned and displayed in a list. However, I also need to reuse this array, to display only unique town names from the search results array. e.g. Montpellier, Lyon, Rennes, Nice etc. The idea is when use user click on 'Nice', only the 'Nice' properties would return. I would also like to display how many properties are in that town. The closest example as to what I want to achieve. http://www.miaandmaggie.com/dog-collars-leashes.html Any ideas how I can use my search array to display the unique towns of the search? Many thanks! M

    Read the article

< Previous Page | 122 123 124 125 126 127 128 129 130 131 132 133  | Next Page >