Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / October 2003

Tip: Looking for answers? Try searching our database.

DataGridColumn design editor

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Giorgio Parmeggiani - 27 Oct 2003 23:15 GMT
Hi    
   
I have created a datagrid custom inherited by the standard
datagrid.    
   
Inside the datagrid I have defined a new type of column
that inherits from DataGridColumn    
   
Is possible somehow to modify (even inheriting) in the
designer of VS.NET the standard editor of the
datagridcolumns adding the new type of column that I have
created with the relative properties?

Giorgio
Jacob Yang [MSFT] - 28 Oct 2003 08:16 GMT
Hi Giorgio,

Thank you for using Microsoft MSDN managed newsgroup.

Based on my research and experience, I don't think what you want is
possible.

Please refer to the following URL.

http://www.metabuilders.com/Faq.aspx
"...
I can't add custom columns to my toolbox.
..
The only way to add the column is to edit the html portion of the page. In
tools like vstudio, you will also have to add a reference to the dll.
.."

I hope it helps.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ?C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Giorgio Parmeggiani - 28 Oct 2003 23:13 GMT
Hi Jacob    
Thanks for the answer, I have understood that I cannot use
the standard editor of the DataGridColumns.    
I could perhaps revolve my problem if I was able somehow
to execute some code when the designer is closed.    
My idea is to use a new property of the DataGrid custom, a
collection of objects BoundColumnFilter (my DataGridColumn
custom) for then to transfer its content to the standard
collection "Columns" when the designer is closed.
   
My problem is that I don't find an event that is called at
the closing of the designer (es. type UnLoad)    
Some suggestion? If I make an override on Dispose can i
modify the collection column?

Giorgio

>-----Original Message-----
>Please refer to the following URL.
[quoted text clipped - 6 lines]
>tools like vstudio, you will also have to add a reference to the dll.
>..."
Jacob Yang [MSFT] - 29 Oct 2003 15:14 GMT
Hi Giorgio,

Thank you for your update.

I am glad to know that my answer is useful to you. For your new question, I
need more time to research. I will update you as soon as possible.

Have a nice day.

Jacob Yang
Microsoft Online Partner Support
Get Secure! ?C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
MSFT - 30 Oct 2003 08:07 GMT
Hi Giorgio,

I think you put these code in the DataGrid's Load event. The result will be
correct at runtime. The custom DataGrid column can only be added from code,
not from Designer.

Hope this help,

Luke
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Giorgio Parmeggiani - 31 Oct 2003 01:53 GMT
Hi Luke
Thank for your answer

>correct at runtime. The custom DataGrid column can only be added from code,
>not from Designer.

Defining a DataGrid property of the type:    
   
[    
PersistenceMode(PersistenceMode.InnerDefaultProperty),    
DesignerSerializationVisibility
(DesignerSerializationVisibility.Content),    
]    
public virtual BoundColumnFilterCollection
ColumnsFilter    
{    
    get    
    {    
        return _columns;    
    }    
    set    
    {    
        _columns = value;    
    }    
}    
   
I succeed without problems in adding columns custom
through the designer!    
   
Then with a method of the designer I move the customs
Column to the standard collection "Column", again I
succeed in seeing and to modify the columns custom in the
designer but    
obviously I don't see the new ownerships that I have added
to the columns custom.    
   
My problem is to perform only once this transfer at the
closing of the designer.

Thankyou again.
Giorgio
MSFT - 31 Oct 2003 11:57 GMT
Hi Giorgo,

I may misunderstand your description. I mean you can't add a column to
datagrid in designer like dragging a control from toolbox. For a custom
column, it is better to add it to datagrid's column collection in code at
runtime.  For example, you can move the custom in PreRender event. If you
just want perform this at design time, you may take a look the those
interfaces in .NET framework:

IDesignerHost Interface
   
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemComponentModel
DesignIDesignerHostClassTopic.asp

    IContainer  Interface
   
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemComponentModel
IContainerClassTopic.asp

    IRootDesigner  Interface
   
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemComponentModel
DesignIRootDesignerClassTopic.asp

    IDesigner  Interface
   
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemComponentModel
DesignIDesignerClassTopic.asp

Luke
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.