Re: Hyper link in Datagrid
- From: "TC" <cousins1066@xxxxxxxxxxx>
- Date: Tue, 19 Jul 2005 10:36:47 +0000 (UTC)
You want to intercept the data is it comes into the datagrid_itemdatabound
event. here you can interrogate the values in the cells (1 row at a time)
and take the appropriate action.
TC
"Meheraj shaik via .NET 247" <anonymous@xxxxxxxxxxxxx> wrote in message
news:%23t5Cuu1YFHA.1404@xxxxxxxxxxxxxxxxxxxxxxx
hi friends,
I've dynamically created hyperlink and other columns in a grid.i want to
change hyperlink's text property dynamically.i've two tables products &
specials.data from product table is diaplayed in grid,if that tables id is
existing in specials then hyperlink's text is editspecial and if it's new
then text is newspecial.when link is clicked it diaplays specials page.
my problem instead of one hyperlink a new hyperlink column is created for
each row in grid.if 4 rows then 4 hyperlink columns.
I'm giving u code also:
HyperLink edit=new HyperLink();
for(int i=0;i<ds.tables[0].count;i++) //products
{
int prodid=convert.toint32(ds.tables[0].rows[i]["id"].text);
string qry="select specialsid from specials where id=prodid;
sqldataAdapter sda=new sqldataadapter(qry,con);
sqldataAdapter.fill(ds);
if(ds.tables[0].rows.count > 0)
{
edit.text="editspecial";
}
else
{
edit.text="New Special";
}
edit.datanavigateurl="id";
edit.datanavlgateurlformatstring="specials.aspx"?id{0};
dg.addcolumns((Datacolumn)edit);
}
//other columns are created below
dg.databind();
please give me the solution ,thank you
From: Meheraj shaik
-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>w4KoqagwQ0C41f9bOgkZQw==</Id>
.
- Prev by Date: Re: Using Crystal Report
- Next by Date: How to solve COMException
- Previous by thread: Re: Using Crystal Report
- Next by thread: How to solve COMException
- Index(es):
Relevant Pages
|