Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

First let me say I am just a novice with .net. Below is code as to how I put fields together in one column. I am not sure this is the best way but it does work.

 

In --> DataGrid1_ItemDataBound...

 

 

For i = 0 To DataGrid1.Items.Count - 1

If myDataSet.Tables(0).Rows.Count > 0 And DataGrid1.Items.Count > 0 Then

''DataGrid1.Items(i).Cells(0).Text = "<img border='0' src='Images\arrow_right.gif' height='16' width='16'>"

DataGrid1.Items(i).Cells(1).Text = "<img border='0' src='" & myDataSet.Tables(0).Rows(i).Item("Smiley") & "' height='16' width='16'>"

' Works

strdatajoin = "<a href='Details2.aspx?Name="

strTildeQuote = myDataSet.Tables(0).Rows(i).Item("Name")

strTildeQuote = strTildeQuote.Replace("'", "~")

strdatajoin = strdatajoin & strTildeQuote

strdatajoin = strdatajoin & "&Category="

strdatajoin = strdatajoin & myDataSet.Tables(0).Rows(i).Item("Category")

strdatajoin = strdatajoin & "'><font color='#008B8B' weight='bolder''>"

strdatajoin = strdatajoin & " >> " & myDataSet.Tables(0).Rows(i).Item("Name")

strdatajoin = strdatajoin & "</font></a>"

strdatajoin = strdatajoin & strbreakline

strdatajoin = strdatajoin & "<font color='#363636'>"

strdatajoin = strdatajoin & myDataSet.Tables(0).Rows(i).Item("Text") & "</font>"

DataGrid1.Items(i).Cells(4).Text = strdatajoin

End If

Next i

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...