Hi,
It is possible that if you use ListItem for items that store in arrays, the
below is a sample code that works fine. Only to do is setting that the
gridview has a hyperlinkfield and set DataNavigateUrlFields to "Text" and
set DataTextFields set to "Text".
If you want to use visible link name is different than the target then you
can use ListItem's "Value" property and set them in Arrays then change the
DataTextFields set to "Value".
If you use ArrayList:
ArrayList myListItem = new ArrayList();
myListItem.Add(new ListItem("http://www.yahoo.com"));
myListItem.Add(new ListItem("http://www.microsoft.com"));
GridView1.DataSource = myListItem;
GridView1.DataBind();
If you use ListItem Array:
ListItem[] myListItem = new ListItem[2];
myListItem[0]=new ListItem("www.yahoo.com");
myListItem[1]=new ListItem("www.microsoft.com");
GridView1.DataSource = myListItem;
GridView1.DataBind();
Have a nice work,
Aytaç ÖZAY
Software Developer
<ia********@yahoo.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
Hi,
Does anyone have an ASP 2.0 code sample that shows how to bind a
one-dimensional array to a GridView, such that the rows are shown as
hyperlinks?
Thanks
Ian