http://i.stack.imgur.com/6bM6O.png[
^]
Please check the image above and please help me solve my issue. If you guys need code i can definitely provide by editing my question that i have asked here.
Code Below of Html
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="InputPage.aspx.vb" Inherits="GBATExcel.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
<style>
.fixedColWidth td
{
width: 150px;
}
</style>
<asp:Panel runat="server" Width="3000"/>
<asp:Table ID="tblLists" runat="server" CssClass="fixedColWidth" CellPadding="0" CellSpacing="0">
<asp:TableRow ID="trLists" runat="server"></asp:TableRow>
</asp:Table>
<asp:GridView ID="GridView1" runat="server" CssClass="fixedColWidth" CellPadding="0" CellSpacing="0" ForeColor="#333333" Height="273px">
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<EditRowStyle BackColor="#999999" />
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333"/>
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#E9E7E2" />
<SortedAscendingHeaderStyle BackColor="#506C8C" />
<SortedDescendingCellStyle BackColor="#FFFDF8" />
<SortedDescendingHeaderStyle BackColor="#6F8DAE" />
</asp:GridView>
<br />
<div>
<asp:Button ID="InputPageSubmitButton" runat="server" Text="Submit" Width="149px" />
</div>
</form>
</body>
</html>
Code below of asp.net vb code
Public Class WebForm1
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
loadExcel()
End Sub
Private Sub Page_PreRender(sender As Object, e As System.EventArgs) Handles Me.PreRender
trLists.Cells.Clear()
For i As Integer = 0 To GridView1.Rows(0).Cells.Count - 1
Dim dd1 As New DropDownList()
dd1.ID = "dd1" + i.ToString()
dd1.Width = Unit.Pixel(105.2)
dd1.Items.Add("Borough")
dd1.Items.Add("Borough")
dd1.Items.Add("Borough")
dd1.Items.Add("Borough")
dd1.Items.Add("Borough")
dd1.Items.Add("Borough")
Dim cell As New TableCell()
cell.Controls.Add(dd1)
trLists.Cells.Add(cell)
Next
End Sub
Public Function loadExcel()
Dim MyConnection As System.Data.OleDb.OleDbConnection
Dim DtSet As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
Dim filePath = "C:\excelfiles\Book11.xlsx"
MyConnection = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & filePath & ";Extended Properties='Excel 12.0 Xml;HDR=YES;';")
MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", MyConnection)
DtSet = New System.Data.DataSet
MyCommand.Fill(DtSet)
GridView1.DataSource = DtSet.Tables(0)
GridView1.DataBind()
MyConnection.Close()
Return Nothing
End Function
Protected Sub InputPageSubmitButton_Click(sender As Object, e As EventArgs) Handles InputPageSubmitButton.Click
Response.Redirect("OutputSelectPage.aspx", True)
End Sub
Protected Sub GridView1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles GridView1.SelectedIndexChanged
End Sub
End Class
What I have tried:
StackOverflow. I basically tried researching a lot on my own but need help because this is necessary to be done soon .