GridView - rant continued

GridView - rant continued

am 25.10.2007 13:05:01 von Guy

Ok so i want to change the column headings - so you
set .HeaderRow.Cells(i).Text to the text required right?
yes that works
but if sorting is enabled it does not cos the button is changed to a text
field.
Why?
What is gained by this?

you have to :-
DirectCast(GridVewName.HeaderRow.Cells(i).Controls(0), LinkButton).Text =
textrequired

And you have to work out that it is a LinkButton cos the debugger says it
is a DataControlFieldLinkButton, which is undocumented and you can not cast
to...

What is gained by making available a control that is undocumented and that
you can not use?

G*D I hate this control

Guy

Re: GridView - rant continued

am 26.10.2007 15:39:32 von cshNOSPAMPLEASE

guy schreef:
> Ok so i want to change the column headings - so you
> set .HeaderRow.Cells(i).Text to the text required right?
> yes that works
> but if sorting is enabled it does not cos the button is changed to a text
> field.
> Why?
> What is gained by this?
>
> you have to :-
> DirectCast(GridVewName.HeaderRow.Cells(i).Controls(0), LinkButton).Text =
> textrequired
>
> And you have to work out that it is a LinkButton cos the debugger says it
> is a DataControlFieldLinkButton, which is undocumented and you can not cast
> to...
>
> What is gained by making available a control that is undocumented and that
> you can not use?
>
> G*D I hate this control
>
> Guy

Why don't you just do it like this:
mydatagridview.columns(i).headertext="headername"


--
Rinze van Huizen
C-Services Holland b.v