Re: Hyper link in Datagrid

Tech-Archive recommends: Fix windows errors by optimizing your registry



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>


.



Relevant Pages

  • RE: How to assign a column of URLs to Hyperlink Column of a DataGr
    ... You need bind datagrid with data source: ... HyperLink link = CType.Controls, HyperLink) ... "david" wrote: ... > URLs which is a column of a dataset, and I have a column of hyperlink column, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Query string and Parameter Passing Problem
    ... If you want to pass ID rather than Description as query ... string to hyperline, ... HyperLink link = e.Item.Cells ...
    (microsoft.public.dotnet.framework.aspnet.datagridcontrol)
  • Re: import hyperlinks into access
    ... I had a friend try to import my original Excel file into ... I tried first just importing to a new table and then changing ... >> and then I created table with a hyperlink column and imported into it ...
    (microsoft.public.access.externaldata)
  • Importing Access File with Hyperlink
    ... I have an excel file to determine parts needed and costs for the many ... I have an Access Database table load into a sheet ... I have just added a hyperlink column to my inventory database so that the ...
    (microsoft.public.excel.misc)
  • RE: Extract URL from Link Cell / Convert imported text links to hyperl
    ... Part 1 addressed how to extract the hyperlink URL from label cells in Col B ... Sub Links() ... For Each xCell In Selection ...
    (microsoft.public.excel.misc)