deriving from BaseDataList to make a custom datagrid that is 100% client side...

F

Fred Hirschfeld

I want to create a custom datagrid control that uses XML data islands to
control the data client side with editing. I am trying to inherit the
minimal for implementing this server control and would like to derive from
BaseDataList. Does anyone know what I need to put in the two abstract
methods (CreateControlHierarchy and PrepareControlHierarchy)?

I know I could resort to the datalist or datagrid and not worry about this
but I would like to make it as clean as possible.

Fred
 
S

Scott Mitchell [MVP]

I want to create a custom datagrid control that uses XML data islands to
control the data client side with editing. I am trying to inherit the
minimal for implementing this server control and would like to derive from
BaseDataList. Does anyone know what I need to put in the two abstract
methods (CreateControlHierarchy and PrepareControlHierarchy)?

Fred, the best approach might be to look at how the DataGrid implements
these methods. Using a disassembler like Reflector
[http://www.aisto.com/roeder/dotnet/] you can view the source code...

To summarize very briefly: CreateControlHierarchy() builds up the
control hierarchy. It creates the controls that makeup the "Items" of
the data Web control. PrepareControlHierarchy() is invoked during the
Render phase, and applies the style information (such as ItemStyle,
AlternatingItemStyle, etc.) to the control hiearchy.

If you haven't already, I STRONGLY recommend getting and reading from
cover to cover the book "Developing Microsoft ASP.NET Server Controls
and Components," by Nikhil Kothari.
[http://www.4GuysFromRolla.com/ASPScripts/Goto.asp?ID=170] It is an
invaluable resource for control developers, and explains the purpose of
these methods as well.

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla.com!
 
F

Fred Hirschfeld

Thanks, I have started looking at this book...

Fred

Scott Mitchell said:
I want to create a custom datagrid control that uses XML data islands to
control the data client side with editing. I am trying to inherit the
minimal for implementing this server control and would like to derive from
BaseDataList. Does anyone know what I need to put in the two abstract
methods (CreateControlHierarchy and PrepareControlHierarchy)?

Fred, the best approach might be to look at how the DataGrid implements
these methods. Using a disassembler like Reflector
[http://www.aisto.com/roeder/dotnet/] you can view the source code...

To summarize very briefly: CreateControlHierarchy() builds up the
control hierarchy. It creates the controls that makeup the "Items" of
the data Web control. PrepareControlHierarchy() is invoked during the
Render phase, and applies the style information (such as ItemStyle,
AlternatingItemStyle, etc.) to the control hiearchy.

If you haven't already, I STRONGLY recommend getting and reading from
cover to cover the book "Developing Microsoft ASP.NET Server Controls
and Components," by Nikhil Kothari.
[http://www.4GuysFromRolla.com/ASPScripts/Goto.asp?ID=170] It is an
invaluable resource for control developers, and explains the purpose of
these methods as well.

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com
http://www.ASPFAQs.com
http://www.ASPMessageboard.com

* When you think ASP, think 4GuysFromRolla.com!
 

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,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top