usercontrols

How do i change the column width of a DataGrid

i'm creating a user control in C# .net compact framework 3.5. And i'm using a DataGrid Control with a DataTable as the DataGrid's DataSource. i need to make some of the grid columns wider. for some reason i can't... i just couldn't find the method or property that controls the column width... any ideas? thanks in advance... ...

CodeDomSerializer Serializes a new Instance of the user class when changing Designer Laguage.

Hi, I have a usercontrol “DataDesigner” that is more or less like an DataSet Designer. In this Control I define the Database Structure in my own classes. Ever Form has a FormDescriptor, each FormDescriptor can have multiple TableDescriptor and each TableDescriptor can have multiple FieldDescriptor. All of this classes have a lot of ...

Designer does not generate code for a property of a subcontrol. Why?

I created SubCtrl inheriting UserControl. It has no code. I created then Ctrl, which also inherits UserControl. It has a SubCtrl in it and its only code means to expose it publicly so it appears in the property list of Ctrl: public subctrl.SubCtrl SUBCTRL { get { return this.subCtrl1; } } Then I created a simple Form project which...

How to trace that all child controls (were) shown

I'm developing a standard wizard control. That control can contain several panels. Depending on the step, a panel number (step) shows. My difficult thing is that each panel contains several child controls (and controls can contain child controls etc). I need to trace a moment when all child controls of a panel (were) shown. How ? Do Sh...

Registering custom controls fails

I am attempting to register my user controls within the webconfig file because I am receiving the Element does not exist error, but I am receiving the following error when I try to register them in webconfig: Invalid or missing attributes found in the tagPrefix entry. For user control, you must also specify 'tagName' and 'src'. For cust...

Binding to a collection of user controls in XAML

I've a collection of UserControls which I want to show in a stack panel. I've no control over how and what those user controls contain. I just know that they are some sort of user controls (could be a button, a textblock or any UIElement.) Here is a small example public class Car : IHasView { public UserControl MyView { get return ...

ASP.NET Get UserControl VirtualPath programmatically

Hi. I need to get a UserControl VirtualPath programmatically. How can I do it? For example, MyControl.ascx placed in Controls folder, so the result should be "~/Controls/MyControl.ascx". Is it possible? Thank you. ...

Hide control within a WPF User Control Library

Hi, I've a project made from the "WPF User Control Library" Template in Visual Studio. This project contains one main usercontrol plus additional Windows/Usercontrols. How can I "hide" these additional Windows/Usercontrols, so that the user can only import the main usercontrol from the assembly (I wanted to put a screen-shot to illustr...

Designer-editing DataSource property of a DataGridView within a UserControl

I have a custom UserControl that contains several child controls, amongst which is a DataGridView. I don't want to EnableDesignMode for any of the child controls, but instead have exposed and serialized their properties as needed. I'm stuck on DataGridView's DataSource property. Do I need to make a custom UITypeEditor and use reflection...

Why do I need to call Dispatcher.BeginInvoke to SetFocus?

I have a WPF UserControl that contains a StackPanel that is made visible as a result of a state change. When the StackPanel becomes visible, I want to set the keyboard focus to a particular child TextBox. I have found (after a lot of trial and error) that the call to TextBox.Focus() will fail to set focus (and returns false) unless I w...

Create a designer-aware UserControl collection to be used runtime

I have a Panel I want to fill with some UserControl(s) at runtime. These controls are complex and may be interdependent, so I'd like them: to be editable with Visual Studio designer; to be in the same context (= defined in the same class); Both of the requirements are a must-have. Considering UserControl is itself an indexed collect...

ASP.NET How to access a deeply nested user control on the parent page

I have a login control and at is nested 2 deep in a header control i.e Page --> Header Control --> Login Control. I cannot get a reference to the control on the page using FindControl. I want to be able to set the visible property of the control like if (_loginControl != null) _loginControl.Visible = false; I ended up u...

Why can a control draw outside its bounding box?

Here's an example image of what I mean: example The gray rectangle is the bounding box of a control that draws the blue lines and dots in it's OnRender(...) method. The red ovals mark places where it happens. Why is that possible? How can it be avoided? ...

Spring graph component for ASP.NET MVC

Hi, I'm looking for a recommended spring graph to be used with ASP.NET MVC Flex spring graph example: http://mark-shepherd.com/SpringGraph/MoleculeViewer/bin/MoleculeViewer.html Thanks, E ...

In WPF how do I bind a Content Property of the UserControl to the internal control.

I Have a user Control which Contains a ScrollPanel. And I want to bind the userControl's content property to the ScrollPanel. So my xaml would look like: <CustomControl> <StackPanel/> </CustomControl> and in my UserControl my ScrollPanel child is set to StackPanel. ...

How to integrate google search in user control?

Hi anybody having idea about integrating google search code in .net user control (i.e i want to add google search code in ascx page). Is it possible? Actually it is working fine with integrating with aspx page. But i want this to integrate in ascx page. Thanks in advance ...

Copying the whole layout with controls from one aspx page to another page - Moving Controls dynamically - ASP.Net

Hello all Here is my issue. I've a page main.aspx. This page has a button 'Settings'. When it is clicked, I load another aspx page settigns.aspx in a popup. Now in the settings.aspx i allow the users to add controls dynamically. For example the user can create 5 textboxes. When he saves it there, I need to get that controls to main.asp...

Hide user control present in master page

I have an user control in master page with id 'ucTopUser' and a button 'btnSub'.I need to hide the both control from my current aspx page.How can I do this? ...

User Control loaded Programatically with a DataPager doesn't Page

I have an asp.net user control with a listview and a DataPager that work as expected if it's loaded statically from an aspx page the usua way. <%@ Register Src="~/Controls/TricksSummaryOneSubTypeUC.ascx" TagName="sub" TagPrefix="uc1" %> ... <uc1:sub ID="skdlj" runat="server" TypeId="7" SubTypeId="706" /> But If load it dynamically in ...

How do I know when the current system scrollbar width changed?

I need to move controls around when the scrollbar's size change (System.Windows.Forms.SystemInformation.VerticalScrollBarWidth). I'm creating a control with custom scrollbars that go over the normal ones. This implies creating a new UserControl (not inheriting a built-in control) and playing around with panels so as to hide the normal s...