Ive been banging my head against the wall for the last few hours, I just cant seem to view the HTML markup from a SQL Cell in a GridView.
When I set the AutoGenerateColumns=False it's easy because I can set the boundfield property in the DataGird ASP.Net markup. However, I can't seem to do anything with the gridview if the AutoGenerate is turned on.
Here is my vb code:
Dim sqlcmd As String = "Select [Bugs:], [QC#:] FROM " & """" & datasource & """" & Extra
Using con As New System.Data.SqlClient.SqlConnection(connexstring)
con.Open()
Dim da = New SqlDataAdapter(sqlcmd, con)
Dim ds = New DataSet()
da.Fill(ds)
Gridview1.DataSource = ds
da.Dispose()
ds.Dispose()
con.Close()
End Using
GenTables(gen)
Dbind()
I have html markup in the both columns that I need to show up.
Here is my Gridview:
<asp:GridView ID="GridView1" runat="server"
EmptyDataText="There are no data records to display."
BackColor="White" BorderColor="#999999" BorderWidth="1px"
CellPadding="3" ForeColor="Black" GridLines="Vertical" BorderStyle="Solid"
Visible="False" AutoGenerateEditButton="True">
<AlternatingRowStyle BackColor="#CCCCCC" />
<Columns>
</Columns>
<FooterStyle BackColor="#CCCCCC" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black"
HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#000099" ForeColor="White" Font-Bold="True" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#808080" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#383838" />
</asp:GridView>
Does anyone have any idea how to allow the gridview cell to show html after the columns have already been generated?
Thanks, Zach