> But then, when you decide to use the DataGrid as a child control of a[color=blue]
> web custom composite control, you suddenly find yourself working with
> one arm only. Lots of the features and properties are only available
> read-only (GET) when you want to create and adjust the instance
> programmatically.
>
> For example, all the style information for
> header/footer/item/alternating item etc. are GET properties for a
> reason that still escapes my reasoning. The only way to get a limited
> access to SOME of those are by using the ItemBound or ItemCreated
> event. The great disadvantage of that approach is that it is then
> applied to each item rather than just once during initialization.[/color]
Well working with any control inside a CompositeControl is always done programmatically.
But I don't understand what you mean that you can't set style properties?
Perhaps the HeaderStyle property itself is readonly, but you're getting back
a reference upon which you can set the properties:
DataGrid g = new DataGrid();
g.HeaderStyle.BackColor = Color.Red;
Or are there other aspects that you're having trouble with?
[color=blue]
> Has there been any noticeable change in DG 2.0? I had 2.0 on my laptop
> but it screwed up the whole Windows installation so I had to reformat
> the disk.[/color]
Yes and No. The DataGrid is such a beast (30K+ LOC) that they started from
scratch and created a GridView control. It has all the same functionality
(Pageing, Sorting, Templates, etc) but it fits into the declarative data
binding model. This is what makes Data Binding (and thus the GridView) novel
in 2.0. This does make using the GridView a bit easier for things such as
Paging and Sorting as it can automatically do those things for you, whereas
with the DataGrid you had to write all of that code manually.
-Brock
DevelopMentor
http://staff.develop.com/ballen