Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
treilly via DotNetMonster.com #1
Contents of ButtonColumn and HyperLinkColumn
Hi,
Does anyone know how to get the contents OUT of a ButtonColumn item or a
HyperLinkColumn Item in C#?
For BoundColumns, it's extremely easy - e.items.cells[0].Text.
This does not work with ButtonColumns or HyperLinkColumns.
It should be SO simple, yet I've searched forever on google and have not been
able to find what I'm looking for.
Thanks in advance!
-TR
treilly via DotNetMonster.com Guest
-
HyperLinkColumn Color
I changed a column in my Datagrid into a HyperLinkColumn and it turned the text blue. How do I make it brown again? Here's the line:... -
Listing contents of a directory folder to contents ofdirectory
cfdirectory listing... Here is my problem... I am listing directorys and when each directory is listed I want to list the contents of that... -
buttoncolumn or hyperlinkcolumn
Thanks Scott! I'm a new fan of your site. I started reading the Extensive look at the Datgrid article you wrote there. I also plan on buying your... -
buttonColumn
Hi, Can someone please help? Currently I have in my datagrid a itemtemplate colume with a href that is working. However, instead of using... -
HyperlinkColumn
Does anyone have know if it's possible to include multiple args in the NavigateURLFormatString property? The only examples I've seen are:... -
Elton Wang #2
Re: Contents of ButtonColumn and HyperLinkColumn
It depends where you get it. For example, in Datagrid_ItemCommand event,
e.CommandName might be what you need for CommandButton. In
DataGrid_ItemDataBound event, you need cast
e.Item.Cells[col_index].Controls[0] (or e.item.FindControl("control_Name"))
to specified type first, then get its Text property:
LinkButton linkBtn = (LinkButton)e.Item.Cells[col_index].Controls[0];
String name = linkBtn.Text;
HTH
"treilly via DotNetMonster.com" <u15154@uwe> wrote in message
news:5655767fa073e@uwe...> Hi,
>
> Does anyone know how to get the contents OUT of a ButtonColumn item or a
> HyperLinkColumn Item in C#?
> For BoundColumns, it's extremely easy - e.items.cells[0].Text.
> This does not work with ButtonColumns or HyperLinkColumns.
> It should be SO simple, yet I've searched forever on google and have not
> been
> able to find what I'm looking for.
> Thanks in advance!
>
> -TR
Elton Wang Guest
-
treilly via DotNetMonster.com #3
Re: Contents of ButtonColumn and HyperLinkColumn
That worked! Thank you so much!
--
Message posted via DotNetMonster.com
[url]http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net-datagrid/200510/1[/url]
treilly via DotNetMonster.com Guest



Reply With Quote

