DataGridColumn design editor

  • Thread starter Giorgio Parmeggiani
  • Start date
G

Giorgio Parmeggiani

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
 
J

Jacob Yang [MSFT]

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.
 
G

Giorgio Parmeggiani

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
 
J

Jacob Yang [MSFT]

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.
 
M

MSFT

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.)
 
G

Giorgio Parmeggiani

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
 
M

MSFT

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.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top