usercontrols

C# UserControl Validation

Hi, I have a UserControl with a Tab Control containing three tabs. Within the tabs are multiple controls - Datetimepickers, textboxes, comboboxes. There is also a Save button which when clicked, calls this.ValidateChildren(ValidationConstraints.Enabled) Now, I click save and a geniune validation error occurs. I correct the error and ...

correct use of tag prefix and tag name??

It looks like both TagPrefix and TagName are both required. I'm wondering what the correct usage of each element would be? The code I've got below doesn't look right, as I repeat the name of the control twice... <%@ Register TagPrefix="ucCustomerSearch" TagName="ucCustomerSearch" Src="~/UserControls/IndividualSearch.ascx"%> <%@ Register...

ASP.NET - Web Application, UserControls and NullReferenceExceptions

I have a web application, which works fine if I include my user controls with <%@ Register TagPrefix="mine" TagName="MyUC1" Src="~/UserControls/MyUc1.ascx" %> <%@ Register TagPrefix="mine" TagName="MyUC2" Src="~/UserControls/MyUc2.ascx" %> But I need to use the namespace due to needing to integrate with Umbraco. When I replace the reg...

C# UserControl Custom Properties

i am creating a usercontrol which provides all of the common validations for a range of textbox styles: alpha, number, decimal, SSN, etc. so, when a developer using this control selects the alpha style, they can also select another property which defines a string of special characters that could also be allowed during validation. but ...

Why does my DataGrid flat refuse to reload itself from ViewState on Postback?

I have a DataGrid control that refuses to reload itself from View State on Postback. I've traced this all the way back to the Load event on the control. It just flat refuses to reload from ViewState. It just doesn't do it. The control is situated like this: Webform --> Dynamically loaded User Control (via "LoadControl") ----> Static...

Pass data between 2 dynamically loaded User control

Hi, I have a scenario where I dynamically load 2 user controls in a webform, and need them to interact together. Here's the code : default.aspx.cs ControlA cA = (ControlA)LoadControl("~/controlA.ascx"); ControlB cB = (ControlB)LoadControl("~/controlB.ascx"); Page.Controls.Add(cA); Page.Controls.Add(cB); Now the thing is, controlB nee...

ModalPopupExtender inside a usercontrol, ID conflicts

Hello! I have a bit of a problem. I'm creating a popup usercontrol controled entierly on the client side. Inside my control i have a ModalPopupExtender. The problem is that when i create two or more instances of this usercontrol the ModalPopupExtenders ID is not unique per instance, i infact get many ModalPopupExtenders with the same ID...

Call any webservice from the same $.ajax() call

Hi! Im creating a usercontrol which is controled client side, it has an javascript-file attatched to it. This control has a button and upon click a popup appears, this popup shows a list of my domain entities. My entities are fetched using a call to a webservice. Im trying to get this popup usercontrol to work on all my entities, there...

ReorderListView in WPF

I love the controls from the Bag-Of-Tricks. I am interested in modifying the ReorderListBox control to get a ReorderListView control. However, simply changing the base class from ListBox to ListView is not working. When I try to add a ReorderListView to XAML like this: <lib:ReorderListView Grid.Row="1"> <ReorderListView.View...

Silverlight - how to render image from non-visible data bound user control?

Hello! I have such situation - I'd like to build timeline control. So I have UserControl and ItemsControl on it (every row represents some person). The ItemsControl contains another ItemsControl as ItemsControl.ItemTemplate - it shows e.g. events for the person arranged by event's date. So it looks as some kind of grid with dates as a...

Sizing issues while adding a .Net UserControl to a TabPage

I have a complex Windows Forms GUI program that has a lot of automated control generation and manipulation. One thing that I need to be able to do is add a custom UserControl to a newly instatiated TabPage. However, when my code does this I get automatic resizing events that cause the formatting to get ugly. Without detailing all of the ...

WPF - Which one is better? Style or User Control?

I wanted to know which one amongst Style and UserControl would be better to use in WPF? For example: I have created an image button in two different ways. One uses Style and ContentTemplate property is set. It uses one other class with dependency properties. The other way is I have created a UserControl which has a button and its cont...

How to communicate between ASP.net custom controls

I'm using two custom controls. One gathers the criteria for a search, and the other displays a list. These two controls need to remain seperate for the time being. What is the best method of transfering data from the search control, to the list control? I'm thinking of ViewState, Session or wrapping both within a UpdatePanel and using ...

ToolTip for a User Control Issue

I have a control inherited from usercontrol, I have implemented it such a way that it acts as XY Plane and displays curves. When user clicks and holds the mouse down for 1 sec i trigger SetToolTip to display tooltip indicationg (x,y) coordinates. Tooltip remains even on drag updating x,y positions System.Windows.Forms.ToolTip myToolT...

Silverlight preview XAML file exception

I have upgraded my Silverlight project from 2 to 3 and uses VS 2008. When I open the XAML-file preview in VS 2008 an exception occured: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at MS.Internal.XcpImports.RenderTargetBitmapRenderNative(IntPtr nativePtr, IntPtr element, Int3...

Why is my user control not instanciated on a postback?

Hi, I'd like to set the trigger of an UpdatePanel to a user control outside the UpdatePanel on the same page . The user control is added at design time, not at runtime. If I statically declare the trigger, I get an error "A control with ID 'xx' cannot be found for the trigger in UpdatePanel". I tried to add the trigger at runtime in Pag...

Wpf usercontrol with parameterised constructor

Hi, We are using Microsoft Unity and dependency injection and so we have parametrised constructor for the usercontrol. How to inject this dependency into usercontrol using XAML? I have added the usercontrol in XAML as below. xmlns:usrRefundArrivalProcessor="Ttl.Refunds.Wpf.Dashboad.Application.Usercontrols;assembly=Ttl.Refunds.Wpf.Da...

WPF - Setting usercontrol width using triggers and mouseenter event

I have a wrap panel full of usercontrols. When I hover the mouse over a usercontrol I want it to expand to show more details. Some stripped down sample code: <UserControl x:Class="WPFTestBed.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" ...

Form not updating usercontrol

From the post "Growing user control not updating"... Using C#, .Net 2.0 in a Windows environment. UserControl1 - draws cells to a bitmap buffer dependent upon NumberOfCells property UserControl2 - panel contains UserControl1 which displays vertical scroll when necessary; also contains NumberOfCells which sets UserControl1's NumberOfCel...

Adding Custom Properties

Hi All I have created a user control, and now I want to add custom properties to it so they will appear in the Properties toolbar in Vis. Studio. How can this be done? My custom property will be: "Animation Type" with options "Fade | Blink | Scroll | Blend" thank you ...