Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Download de arquivos

1 view
Skip to first unread message

Wanessa

unread,
Sep 23, 2008, 5:01:01 PM9/23/08
to
Boa tarde pessoal.

Estou fazendo em Delphi.net um sisteminha para efetuar upload e download de
arquivos.

Então eu carrego os dados do arquivo em uma datagrid e teria que atraves do
linkbutton abrir o arquivo.

Eu não consigo capturar a linha e pega o codigo atraves de um label e passa
por parametro.

eis o codigo

procedure TWebForm1.LinkButton_Click(sender: System.Object; e:
System.EventArgs) ;

var

i,teste : Integer;

ex : System.Web.UI.WebControls.DataGridItemCollection;

it : System.Web.UI.WebControls.DataGridItem;

begin

ex := dtg_down.Items;

sDown := '';

teste:= 0;{o problema está aqui não sei como carregar a linha selecionada}

For i := 0 to ex.Count -1 do

Begin

it := ex.Item;

if i = teste then

sDown := (it.FindControl('cod') as &Label).Text

if sDown <> '' then

Download(sdown);

end;

<aspataGrid id="dtg_down" runat="server" width="741px" selectedindex="0"

autogeneratecolumns="False" font-names="Verdana" allowpaging="True">

<FooterStyle font-names="Verdana" font-bold="True" height="20px"
forecolor="Navy"></FooterStyle>

<HeaderStyle font-size="XX-Small" font-names="Verdana" font-bold="True"

horizontalalign="Center" height="20px" borderwidth="2px"

forecolor="Navy" borderstyle="Double" bordercolor="Red"

backcolor="WhiteSmoke"></HeaderStyle>

<PagerStyle nextpagetext="" font-size="XX-Small" font-names="Verdana"
font-bold="True"

prevpagetext="" horizontalalign="Center" backcolor="WhiteSmoke"

pagebuttoncount="20" mode="NumericPages"></PagerStyle>

<AlternatingItemStyle borderstyle="None"
backcolor="WhiteSmoke"></AlternatingItemStyle>

<ItemStyle font-size="XX-Small" font-names="Verdana" horizontalalign="Left"

forecolor="SteelBlue" borderstyle="Outset"></ItemStyle>

<Columns>

<asp:TemplateColumn headertext="Download de Arquivos">

<ItemTemplate>

<asp:LinkButton id="CbCod" runat="server" onclick="LinkButton_Click"

text='<%# DataBinder.Eval(Container, "DataItem.NOME")%>


'></asp:LinkButton>

</ItemTemplate>

</asp:TemplateColumn>

<asp:TemplateColumn visible="False" headertext="cod">

<ItemTemplate>

<asp:Label id="cod" runat="server"

text='<%# DataBinder.Eval(Container, "DataItem.CODIGO") %>

'></asp:Label>

</ItemTemplate>

</asp:TemplateColumn>

</Columns>

</aspataGrid>

Por favor me ajudem ....

Obrigada.

sou2009

unread,
Mar 5, 2009, 2:01:00 AM3/5/09
to

--
sou
0 new messages