multiple hyperlinks in a single cell in gridview

Hi, Is it possible to have multiple hyperlinks in a single cell of a gridview.

my asp.net application is similar to a customer orders scenario. 1 customer can have multiple orders. These multiple orders are saved as varchar fields in a column of the SQL Database.
(reason: these orders are from another 3rd party application)

My gridview can display the orders OK if its just 1 order. Ie in Hyperlink format.
But when I SQL column has multiple values seperated by comma, My gridview is unable to seperate the hyperlinks.

 How do i separate the coma separated values from SQL Server into multiple hyperlinks displayed in one cell of the gridview.

Eg. Sql database column has value like "12345, 6789, 2468"
Grid should display links as (in one cell)
http://xxx/id=12345, http://xxx/id=6789, http://xxx/id=2468

I am using asp.net , c#, sql 2008.
LVL 13
WizillingAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alfred A.Commented:
Hi,

Use GridView Templates (e.g. Item Template) and then design the structure of your hyperlinks in the template (e.g. hyperlinks in tables or divs)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
drypzCommented:
Hi! You can format your links in your databound event of your gridview row. Something like this
    protected void GridView1_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)
    {
        //Assuming that your link is in column 0
        DataRowView row = (DataRowView)e.Row.DataItem;

        string[] links = row[0].ToString().Split(new char[]{','});

        foreach (string s in links)
        {
            if (!string.IsNullOrEmpty(s))
            {
                e.Row.Cells[0].Text += "<a href='http://xxx/id='" + s + "'>" + s + "," + "</a>";
            }
        }
    }

Open in new window

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.