Fixen des Table Problems: Lösung war :
ALLE Rows und Cells innerhalb der ForEach-Schleife neu zzu erstellen sowie den ViewState-Mode der Tabelle auf False zu seten damit diese bei jedem Postback nicht neu geladen iwrd.
This commit is contained in:
@@ -151,7 +151,7 @@
|
||||
<!-- <input class="form-control mb-4" id="tableSearch" type="text"
|
||||
placeholder="Einen Begriff eingeben oder den Anfang davon ...">-->
|
||||
<div id="conovertab" style="overflow-x:auto;"margin-left="-2px">
|
||||
<asp:Table id="normaltable" runat="server" Width="100%">
|
||||
<asp:Table id="normaltable" runat="server" Width="100%" EnableViewState="false" >
|
||||
<asp:TableHeaderRow ID="tbl_Header_row" runat="server">
|
||||
<asp:TableHeaderCell ID="tbl_HeaderCellIndexNr" runat="server">Index-Nr</asp:TableHeaderCell>
|
||||
<asp:TableHeaderCell ID="tbl_HeaderCell_ART" runat="server">ART</asp:TableHeaderCell>
|
||||
|
||||
@@ -5,6 +5,18 @@ Imports System.Web.UI.HtmlControls
|
||||
Partial Class Kundenbereich_Default
|
||||
Inherits System.Web.UI.Page
|
||||
|
||||
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
|
||||
tbl_Header_row.TableSection = TableRowSection.TableHeader
|
||||
|
||||
DataBind()
|
||||
|
||||
If (Page.IsPostBack And normaltable.EnableViewState = False) Then
|
||||
|
||||
normaltable.EnableViewState = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Protected Sub LogOutBtn1_Click(sender As Object, e As EventArgs)
|
||||
|
||||
@@ -30,17 +42,7 @@ Partial Class Kundenbereich_Default
|
||||
'MsgBox(Session.Item("PW").ToString)
|
||||
Kdnrtext = Session.Item("CustomerID").ToString
|
||||
|
||||
Dim tbl_CellIndex = New TableCell
|
||||
Dim tbl_CellArt = New TableCell
|
||||
Dim tbl_CellKundenNr = New TableCell
|
||||
Dim tbl_CellStatus = New TableCell
|
||||
Dim tbl_Cellvon = New TableCell
|
||||
Dim tbl_Cellbis = New TableCell
|
||||
Dim tbl_CellAbsender = New TableCell
|
||||
Dim tbl_CellEmpfaenger = New TableCell
|
||||
Dim tbl_CellLKWs = New TableCell
|
||||
Dim tbl_CellKundAuftNr = New TableCell
|
||||
Dim tbl_CellInfo = New TableCell
|
||||
|
||||
|
||||
dt = Nothing
|
||||
|
||||
@@ -81,7 +83,7 @@ Partial Class Kundenbereich_Default
|
||||
End If
|
||||
End If
|
||||
|
||||
If dt IsNot Nothing Then
|
||||
If dt IsNot Nothing Then
|
||||
Dim i As Integer = 0
|
||||
|
||||
|
||||
@@ -89,31 +91,42 @@ Partial Class Kundenbereich_Default
|
||||
|
||||
'Table start.
|
||||
'sb.Append("<table cellpadding='5' cellspacing='0' style='border: 1px solid #ccc;font-size: 9pt;font-family:Arial'>")
|
||||
'Adding HeaderRow.
|
||||
'sb.Append("<tr>")
|
||||
'For Each column As DataColumn In dt.Columns
|
||||
' sb.Append(("<th style='background-color: #B8DBFD;border: 1px solid #ccc'>" _
|
||||
' + (column.ColumnName + "</th>")))
|
||||
'Next
|
||||
'sb.Append("</tr>")
|
||||
'Adding DataRow.
|
||||
'For Each row As DataRow In dt.Rows
|
||||
'sb.Append("<tr>")
|
||||
'For Each column As DataColumn In dt.Columns
|
||||
' sb.Append(("<td style='width:100px;border: 1px solid #ccc'>" _
|
||||
' + (row(column.ColumnName).ToString + "</td>")))
|
||||
' Next
|
||||
' sb.Append("</tr>")
|
||||
'Next
|
||||
'Table end.
|
||||
'sb.Append("</table>")
|
||||
' ltTable.Text = sb.ToString
|
||||
'Adding HeaderRow.
|
||||
'sb.Append("<tr>")
|
||||
'For Each column As DataColumn In dt.Columns
|
||||
' sb.Append(("<th style='background-color: #B8DBFD;border: 1px solid #ccc'>" _
|
||||
' + (column.ColumnName + "</th>")))
|
||||
'Next
|
||||
'sb.Append("</tr>")
|
||||
'Adding DataRow.
|
||||
'For Each row As DataRow In dt.Rows
|
||||
'sb.Append("<tr>")
|
||||
'For Each column As DataColumn In dt.Columns
|
||||
' sb.Append(("<td style='width:100px;border: 1px solid #ccc'>" _
|
||||
' + (row(column.ColumnName).ToString + "</td>")))
|
||||
' Next
|
||||
' sb.Append("</tr>")
|
||||
'Next
|
||||
'Table end.
|
||||
'sb.Append("</table>")
|
||||
' ltTable.Text = sb.ToString
|
||||
|
||||
|
||||
Dim Cell = New TableCell
|
||||
'tr = New HtmlTableRow()
|
||||
Dim tr = New TableRow
|
||||
For Each d In dt.Rows
|
||||
|
||||
Dim Cell = New TableCell
|
||||
Dim tbl_CellIndex = New TableCell
|
||||
Dim tbl_CellArt = New TableCell
|
||||
Dim tbl_CellKundenNr = New TableCell
|
||||
Dim tbl_CellStatus = New TableCell
|
||||
Dim tbl_Cellvon = New TableCell
|
||||
Dim tbl_Cellbis = New TableCell
|
||||
Dim tbl_CellAbsender = New TableCell
|
||||
Dim tbl_CellEmpfaenger = New TableCell
|
||||
Dim tbl_CellLKWs = New TableCell
|
||||
Dim tbl_CellKundAuftNr = New TableCell
|
||||
Dim tbl_CellInfo = New TableCell
|
||||
'tr = New HtmlTableRow()
|
||||
Dim tr = New TableRow
|
||||
tbl_CellIndex.Text = i
|
||||
tr.Cells.Add(tbl_CellIndex)
|
||||
tbl_CellArt.Text = ""
|
||||
@@ -155,9 +168,11 @@ Partial Class Kundenbereich_Default
|
||||
|
||||
i += 1
|
||||
Next
|
||||
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub rbt_Freig_Click(sender As Object, e As EventArgs)
|
||||
MsgBox("Es funzt!")
|
||||
' datepicker1.Visible = True
|
||||
@@ -187,9 +202,7 @@ Partial Class Kundenbereich_Default
|
||||
|
||||
End Sub
|
||||
|
||||
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
|
||||
tbl_Header_row.TableSection = TableRowSection.TableHeader
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user