.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

How to invalidate one control based on information in a second control

Posted By:      Posted Date: September 17, 2010    Points: 0   Category :WPF
An expiration date is required for a license unless it is a lifetime license.  I have two controls; a ComboBox for the license type and a DateTimePicker for expiration date.  I have created a class called RequiredExpirationDateValidationRule. The only way to invalidate just the DateTimePicker appears to be to place the RequiredExpirationDateValidationRule in the binding for the SelectedDate property of the DateTimePicker.  However, I can't get the SelectedItem property of the ComboBox to see if I have a lifetime license type selected.  So I have to place the RequiredExpirationDateValidationRule in a BindingGroup that includes both the ComboBox and the DateTimePicker.  But now the DateTimePicker is not invalidated by the RequiredExpirationDateValidationRule when it returns a false ValidationResult. How do I solve this problem?

View Complete Post

More Related Resource Links

Creating a volume control slider/setting one template property based on another

So, what I want to do, is to make a volume control that looks like a right angle triangle with the 90 degree angle on the bottom right, and then when you click on it, the area to the left of the selected point is shown in a different color.  In other words, I've created a slider with the right background, what I can't do, is work out how to show the selected area by filling in the triangle.  I have worked out how to bind the height of my triangle on the left to the value of the control, but right now, the rate of rise is exactly half of what I need it to be.  I need to know how to change the template for the area to the left of the selection ( which is the repeat button ) so that the background is twice the height that it is right now.  No matter what size I make the slider, the area is always 1/2 the size it needs to be, so I am sure if I could get it to double inside my template, it would work fine. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">       <Style x:Key="SliderButtonStyle" TargetType="{x:Type RepeatButton}">         <Setter Property="SnapsToDevicePixels" Value="true"/>         <

Control this objectdatasource programatically from the code behind based on different button clicks

I have a page where you can search and display other data, very simple layout. 1 Gridview and 1 objectdatasource. But i have 4 possible buttons that can populate the gridview.. i would like to control my objectdatasource from the code behind based on the button you click. here is what i have right now.. but if possible, can this source not be hardcoded like this and only built in the code behind? <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="SelectDVRInfo" TypeName="DataAccessCode"> <SelectParameters> <asp:ControlParameter ControlID="ddlDVR" Name="dvrInfo" PropertyName="SelectedValue" Type="String" /> </SelectParameters> </asp:ObjectDataSource> I found this site with a solution to this persons issue, but i cant seem to get mine working this way. http://stackoverflow.com/questions/2404264/overwriting-controlparameters-of-datasources-in-code-behind I have  this as the code behind right now when you press the button.. what other parameter settings am i missing and is this the right order to populate them for the source to acknowledge my values?   ObjectDataSource1.SelectMethod = "SelectDVRInfo"; ObjectDataSource1.SelectParameters["MyParameter"]

Need advice to control Privileges based on User

I'm a WinForm beginner. My main form is frmMain.cs Once user logged, frmMain.cs will display a menu based on User. This menu represent in button. Let's say, if User=System Admin then 3 button appear. if User=Master Agent Administrators then 5 button appear and so on How to control that? Really need advice If there's another way, please let me know

Is there a way in VB.Net to embed a custom user control to a web page based on Word or Excel

Hi Everyone.  I'm looking to create a web page that would be used on a local intranet that would use a custom control based on Word and Excel.  I've used code previously to embed it in a Windows application but wasn't sure if anyone knew of any examples out there on how to embed a custom control into a ASP.Net page.

UPDATED: AJAX FAQ? And: How to Style the AJAX tab control's tabs: complete information

UPDATE April 08, 2009: for the latest version of this post, with up-to-date info on styling the Tab control, see my just updated Blog post -- the info below is somewhat outdated and does not have some additional details I have added to the Blog post.   First of all, I would like to suggest that the AJAX section of the ASP.NET forums have its own FAQ section. I was going to post this in the general ASP.NET FAQ, but it didn't really fit, and there was no AJAX FAQ, so I'm posting it here. Next: I have been looking for details on how to style the Tabs in the AJAX Toolkit's Tab control for over a week now. I have found information that is misleading, incomplete, outdated, and just plain wrong. And nowhere have I come across all the information needed to make it work in one place. So, I am posting this here. I hope that an AJAX FAQ can be created, and this post moved there.   I am including some background information, about the difficulties people are having in finding information on styling the tabs, first; after that I will include the complete instructions for styling the tabs. First: the information on the documentation page for styling the tabs is misleading at best, as well as incomplete. The docs tell you that you can simply add your styles to your project as CSS, and neglect to tell you that you must add a "CssClass" attribu

control the access of data based on user id

Hi, We have a cube (Insurance related project), users are grouped under a windows user group and they have their individual user id's . Now the question is how to restrict the users to view the data only related to them based on the user id(which is included in windows user-group)...?   if any mdx query is needed tell me that also

Setting .net windows control location based on Screen width

I am developing an windows application in 20 inch moniter. I am positioning the controls in WPF like this

scrollViewer1.Height = Screen.PrimaryScreen.Bounds.Height / 5;

If I run this application in 15 inch monitor whether it will change the position of the control or it will give the look and feel what i expected.

Please clarify?

If it will chnage the positioning,please suggest how to poistion the control to support all screens widths.

information on asp.net control attributes



where is the list or documentation to know what styles can be applied for the asp.net controls like datagrid, detailsview, pagerstyle, etc.

Also where should I get information por setting on the alternate data item style? when I have a details view I would like to have a row with a different color the odd row for example

Thanks :)

Enable/Disable Buttons based on another control property


Say i have a tab control that displays data of various types, eg EditorTabViewModel (eg. code view of WYSIWYG), PreviewTabViewModel (eg. preview of WYSIWYG) both inheriting from TabViewModel . The implementation is similar to the tutorial on MSDN

I want to enable/disable buttons depending on the active tab, whether its an EditorTabViewModel or a PreviewTabViewModel and maybe based even on properties of the ViewModel?. How can I achieve this?

Conditional control based on repeater content


I have a repeater control with a delete button on each row. I also have a link on the same page (not within the repeater) that I only want to be visible when the repeater contains at least one row.

My problem is that, when the delete button on the final row is clicked, this triggers a postback during which the ItemCommand event is called to process the delete click. However this event is processed after the Page Load event in which I would normally render or not render the conditional link. So I don't know at the time I'm rendering the link whether the user has just deleted the last row.

Am I misunderstanding the chain of events or is there a better way of handling this? Could I, for example, determine from the Sender & e arguments available within the Page_Load event, that the postback has been triggered by clicking the delete button in the repeater? The only other way I can see of dealing with this is to force a second postback once the final row of the repeater has been deleted which seems like overkill.

enable a button control on an InfoPath form based on another button control



is it possible to enable a button control based on another button control. so when a user click on a button it enable another button. only if the first button is clicked the second button can be click aswell


ProfilePropertyValue control displays information for other profiles while it is blank for your own


I have a custom page deployed in 2007 SP2 June 2010 CU which uses the following control:

<SPSWC:ProfilePropertyValue ID="ManagerValue" PropertyName="Manager" ApplyFormatting

Update information via txt control


Hi All,

I have big problem.

On the form I have

The GridView is a command "Edit"

But I do not want the information update within a GridView.

If  click on the "Edit", the data can only change update within the GridView.

I wish to correct information in the control txtFirstName, txtLastName, txtAddress when I click "Edit".

Do you have any case?


control to display information about image onmouseover thumbnail



How can we display information about an image onmouseover including large size, description etc.


how to set read only properties to the particular info path form control based on user logged in?

how to set read only properties to the  particular info path form control based on user logged in?

Create user control fields based on bound properties



I am creating a user control that I would like to be able to generate the form entry fields based on what custom data object the form is bound to. Basically, I have a drop-down box that allows the user to pick what type of data object they are working with (user, address, etc.) That choice will bind the user control to the related data object. No big deal there. I am stuck, however, on how to generate the form fields based on the properties of the object. I feel like I have seen examples of this in WPF but am not able to find them now. All form fields will be simple label, textbox combinations in a stackpanel.

I know more detial will probably be required. Let me know what specifically you would like to know. Any help of direction is greatly appreciated.



role based sharepoint asp menu control in sharepoint 2010


i want to add a sharepoint aspmenu control on my master page with SPxmldatasource but i m unable to set permission on menu as per role and user

can any body help me out on this .................

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