473,396 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with Windows Control Library (DataGrid)...

I believe I have almost successfully created a custom datagrid control. The
new class builds without error. I have added it as reference to the main
Windows Application project. It appears on the Toolbox as expected, but...

When I drag-drop it on a Form, it appears like a component (e.g.
SqlConnection) down in it's own area not drawn on the form.

When I created the Windows Control Library, I never actually added a
DataGrid control to the Designer area, so there don't appear to be any GUI
objects in my custom DataGrid. Could this be my problem?

If so, in addition to dropping a DataGrid control onto the Designer area in
my Control Library, how will this change the code-behind that I've already
written?

Any help is greatly appreciated.

- carl
Nov 16 '05 #1
4 4472
Hi carl
This is not normal . when you create a windows control library , a UI
element is created by default for you . even if you didn't use it at all
there will be something that is dragged to the form area when you use this
control in a normal windows application . So , make sure that your datagrid
in implemented as windows control library , does it inherit
System.Windows.Forms.UserControl?

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #2
"Mohamoss" <mo************@egdsc.microsoft.com> wrote in message news:$b**************@cpmsftngxa10.phx.gbl...
Hi carl
This is not normal . when you create a windows control library , a UI
element is created by default for you . even if you didn't use it at all
there will be something that is dragged to the form area when you use this
control in a normal windows application . So , make sure that your datagrid
in implemented as windows control library , does it inherit
System.Windows.Forms.UserControl?


No. My custom datagrid inherits from System.Windows.Data.DataGrid. Here is the code snippet:

[ToolboxBitmap(typeof(DataGrid))]
public class CymiGrid : System.Windows.Forms.DataGrid

There are no references to UserControl (or UserControl1) anywhere in my code, and the following message is displayed when I switch to designer mode:

"To add components to your class drag them from Server Explorer or Toolbox and use the Properties window to set their properties. To create methods and events for your class, click here to switch to code view."

If I click anywhere on the blank (except for message) designer space, the Properties for my custom datagrid are displayed.

Thanks for any help or advice.

- carl
Nov 16 '05 #3
Hi
Since it inherits System.Windows.Forms.DataGrid and it was implemented as a
windows control library then it should also display the normal datagird (
even if you did no modification on the interface ) . to double check I just
created one myself and it displayed correctly. There must be some other
issue within your solution we just didn't see yet. Does it created
container in the initialize component of the class. Do you see this line of
code in it
components = new System.ComponentModel.Container();

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #4
"Mohamoss" <mo************@egdsc.microsoft.com> wrote in message news:q7**************@cpmsftngxa10.phx.gbl...
Hi
Since it inherits System.Windows.Forms.DataGrid and it was implemented as a
windows control library then it should also display the normal datagird (
even if you did no modification on the interface ) . to double check I just
created one myself and it displayed correctly. There must be some other
issue within your solution we just didn't see yet. Does it created
container in the initialize component of the class. Do you see this line of
code in it
components = new System.ComponentModel.Container();


Ok, I think there may have been some kind of conflict or alteration between Visual Studio .NET 2003 and SharpDevelop. I use VS.NET at home, but I only have access to SharpDevelop at the client's location. So, I just copy the code files back and forth.

Anyway, I have created a new Windows Control Library project in VS.NET, copied the code over to the new project, and added the new build to the Toolbox. Everything now seems to be working as expected.

Thanks for you help.

- carl
Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bruce Pullum | last post by:
I have a datagrid that I am using a DataView with. All works great for the sorting of the columns. However, after I sort the column, and then try and select a data row to edit, the row selected...
2
by: Anita C | last post by:
Hi, How do I associate or map a specific column in a datatable to a particular element present in an xml document - to read into a datatable as well as write from the datatable to the xml element?...
0
by: Trey | last post by:
I have a DataTable with a integer field called SortOrder. This table is loaded with and XML file. I have this table in a DataView and I set the RowFilter to filter some row, then I change the...
1
by: MrNobody | last post by:
What I was hoping to do was have a universal Windows Form which features a DataGrid. This Formcould be accessed from several different points of entry, each one may require a different style...
7
by: Juan Romero | last post by:
Hey guys, please HELP I am going nuts with the datagrid control. I cannot get the damn control to refresh. I am using soap to get information from a web service. I have an XML writer output...
4
by: Jeff User | last post by:
Hi I tryed to solve this problem over in the framework.asp group, but still am having trouble. Hope someone here can help. using .net 1.1, VS 2003 and C# I have an asp.DataGrid control with a...
2
by: momo | last post by:
Hello Guys, I have a bit of a problem, I created a Dll called SecureQueryStringDll.dll and I had the dll put bin folder of my application first and it did not work so I then put it in the bin...
1
by: seanmle | last post by:
I want to build a windows application that has a datagrid filled with data. When a person modifies information on a single cell, it updates the database without the user having to click on a save...
11
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.