have a GridView to show data within a table format. The columns are bound. How would I make a particular column value a hyperlink?
Is there a way, instead of making the asp:BoundField, I could use asp:Hyperlink; however, how would I populate?
Here's the code that I'm using to create table:
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Height="40px" Width="722px">
<Columns>
<asp:BoundField DataField="Shift" HeaderText="Shift" SortExpression="Shift">
<HeaderStyle BackColor="#E0E0E0" />
<ItemStyle BackColor="White" BorderColor="Transparent" Width="150px" />
</asp:BoundField>
</Columns>
</asp:GridView>
Here's the code that is generating the SqlDataSource.
Private Sub GenerateGridQueryString()
strGridString = "SELECT tblShift.Shift, tblUnit.Unit_description, tblPriority.Priority_description, "
strGridString &= "tblLog.Log_Note, tblLog.tag_number, tblOperator.NTID, tblPriority.Priority FROM tblLog "
strGridString &= "INNER JOIN tblShift ON tblLog.ShiftID = tblShift.ShiftID INNER JOIN tblPriority ON "
strGridString &= " tblLog.priority_id = tblPriority.priority_id INNER JOIN tblUnit ON tblLog.unit_id = tblUnit.unit_id"
strGridString &= " INNER JOIN tblOperator ON tblShift.OperatorID = tblOperator.OperatorID"
strGridString &= " WHERE (tblShift.Shift = '" & strShiftID & "')"
SqlDataSource1.SelectCommand = strGridString
End Sub