all groups > asp.net building controls > october 2003 >
You're in the

asp.net building controls

group:

DataGridColumn design editor


DataGridColumn design editor Giorgio Parmeggiani
10/27/2003 2:15:35 PM
asp.net building controls:
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?

RE: DataGridColumn design editor jiany NO[at]SPAM online.microsoft.com
10/28/2003 7:16:25 AM
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.
RE: DataGridColumn design editor Giorgio Parmeggiani
10/28/2003 2:13:15 PM

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

[quoted text, click to view]
RE: DataGridColumn design editor jiany NO[at]SPAM online.microsoft.com
10/29/2003 2:14:09 PM
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.
RE: DataGridColumn design editor lukezhan NO[at]SPAM online.microsoft.com
10/30/2003 7:07:02 AM
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

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
RE: DataGridColumn design editor Giorgio Parmeggiani
10/30/2003 4:53:44 PM
Hi Luke
Thank for your answer

[quoted text, click to view]

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.
RE: DataGridColumn design editor lukezhan NO[at]SPAM online.microsoft.com
10/31/2003 10:57:00 AM
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

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