Hello,
Below I have a very simple page I am pulling 4 fields which list in DataGrid. What I need to do is turn the Status into a list Box so that can select what the status should be.
is this possible? any examples I could be pointed to? most of what I found is just adding an edit, or delete button.
Below I have a very simple page I am pulling 4 fields which list in DataGrid. What I need to do is turn the Status into a list Box so that can select what the status should be.
is this possible? any examples I could be pointed to? most of what I found is just adding an edit, or delete button.
Code:
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Data" %>
<HTML>
<script language="VB" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Dim MyConnection As SqlConnection = New SqlConnection("server=bksql04;database=invdb;uid=sa;pwd=System")
Dim MyCommand As SqlCommand = New SqlCommand("SELECT DISTINCT sid AS MachineID, Name, Serial_Number, Status FROM machine_status WHERE (Status IS NULL)", MyConnection)
MyConnection.Open()
Dim dr As SqlDataReader = MyCommand.ExecuteReader()
MyDataGrid.DataSource = dr
MyDataGrid.DataBind()
MyConnection.Close()
End Sub
</script>
<body>
<h3><font face="Verdana">unassigned machines</font></h3>
<ASP:DataGrid id="MyDataGrid" runat="server" Width="700px" BackColor="#CCCCFF"
BorderColor="Black"
CellPadding="3"
Font-Name="Verdana" Font-Size="8pt"
HeaderStyle-BackColor="#aaaadd"
EnableViewState="False"
Font-Names="Verdana">
</ASP:DataGrid>
</body>
</HTML>