A TemplateColumn is used in cases where authors need complete control over
the contents of a Datagrid column. The TemplateColumn is declared with an
<ItemTemplate> element, which in turn is used to define the content that
will be rendered for each item in the column. The ItemTemplate can include
any valid HTML, including s.
To add a template column
1.. Set the DataGrid control's AutoGenerateColumns property to false.
<asp:datagrid id="myGrid" runat="server"
autogeneratecolumns=false
...
2.. Within the DataGrid declaration, declare a <Columns> element.
3.. Within the Columns element, define the <asp:TemplateColumn> control,
along with the required <ItemTemplate> element.
4.. Within the ItemTemplate, define the HTML or server control you intend
to display.
5.. Optionally set the TemplateColumn control's other properties
<columns>
<asp:templatecolumn>
<itemtemplate>
<img width=60 align="top"
src="/aspxtreme/shared/images/title-{0}.gif">
</itemtemplate>
</asp:templatecolumn>
...
</columns>HTH
Regards
Ashish M Bhonkiya
"mike parr" <mp********@yahoo.co.uk> wrote in message
news:Oo**************@TK2MSFTNGP12.phx.gbl... In a datagrid is it possible to use an imagebutton in for my
ButtonColumn rather than the standard button provided? And if so, does
anybody have a code example?
Cheers,
Mike
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!