I have a following table with my own style sheet, I want to sort on it, without using gridwiew.
you can look at my code below and picture of the menu.
aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
string Knyttning = "SQL CONNECTIO HERE";
SqlConnection dbKnyttning = new SqlConnection(Knyttning);
string sqlKommando = "Select * from ordrer";
SqlCommand resultat = new SqlCommand(sqlKommando, dbKnyttning);
try
{
dbKnyttning.Open();
SqlDataReader rad = resultat.ExecuteReader(Com
mandBehavi
or.CloseCo
nnection);
double totallsumordre = 0;
double totallsumlevert = 0;
while (rad.Read())
{
lblOrdrenr.Text += " " + rad["ordrenummer"] +"<br/>";
lblOrdredato.Text += " " + string.Format("{0:dd/MM/yy
yy}", rad["ordredato"]) + "<br/>";
lblLevdato.Text += " " + string.Format("{0:dd/MM/yy
yy}", rad["leveringsdato"]) + "<br/>";
int sta = (int)rad["status"];
int typ = (int)rad["Type"];
if (sta == 1000)
{
lblStatus.Text += "Standard" + "<br/>";
}
else if (sta == 1002)
{
lblStatus.Text += "" + "Bekreftet" + "<br/>";
}
else if (sta == 1005)
{
lblStatus.Text += "Venteordre" + "<br/>";
}
else if (sta == 1010)
{
lblStatus.Text += "Bekreftet" + "<br/>";
}
else
lblStatus.Text += rad["Status"] + "<br/>";
lblKontaktP.Text += " " + rad["kontaktperson"] + "<br/>";
lblSumOrdre.Text += " " + rad["sumordre"] + "<br/>";
lblSumLevert.Text += " " + rad["sumlevert"] + "<br/>";
if (typ == 100)
{
lblType.Text += " " + "Salgsordre" + "<br/>";
}
else if (typ == 140)
{
lblType.Text += " " + "Prosjektordre" + "<br/>";
}
else if (typ == 150)
{
lblType.Text += " " + "Tilbud" + "<br/>";
}
else
{
lblType.Text += " " + rad["Type"] + "<br/>";
}
double sumordre = Convert.ToDouble(rad["sumo
rdre"]);
double sumlevert = Convert.ToDouble(rad["suml
evert"]);
totallsumordre += sumordre;
totallsumlevert += sumlevert;
}
lbltotalsumordre.Text += " " + totallsumordre;
lbltotalsumlevert.Text += " " + totallsumlevert;
}
catch (Exception feil)
{
Response.Write("Feil i SQL: " + feil.Message.ToString());
}
finally
{
if (dbKnyttning.State != ConnectionState.Closed)
{
dbKnyttning.Close();
}
}
}
aspx file
<table style="width: auto; height: 133px;">
<tr>
<td class="MainTextTitle" style="border-bottom-style
:solid; border-bottom-width:thin; border-bottom-color:#A3B1D
8;"> Ordren</td>
<td class="style99">
</td>
<td class="MainTextTitle" style="border-bottom-style
:solid; border-bottom-width:thin; border-bottom-color:#A3B1D
8">
Ordredato</td>
<td class="style184">
</td>
<td class="MainTextTitle" style="border-bottom-style
:solid; border-bottom-width:thin; border-bottom-color:#A3B1D
8">
Levdato</td>
<td class="style184">
</td>
<td class="MainTextTitle" style="border-bottom-style
:solid; border-bottom-width:thin; border-bottom-color:#A3B1D
8">
Status</td>
<td class="style184">
</td>
<td class="MainTextTitle" style="border-bottom-style
:solid; border-bottom-width:thin; border-bottom-color:#A3B1D
8">
Type </td>
<td class="style184">
</td>
<td class="style188"
style="border-bottom-style
:solid; border-bottom-width:thin; border-bottom-color:#A3B1D
8">
Kontaktperson</td>
<td class="style184"
</td>
<td style="text-align:right; border-bottom-style:solid;
border-bottom-width:thin; border-bottom-color:#A3B1D
8;" class="MainTextTitle" >
Sum ordre</td>
<td class="style189">
</td>
<td style="text-align:right; border-bottom-style:solid;
border-bottom-width:thin; border-bottom-color:#A3B1D
8"
class="style193">
Sum levert</td>
<td class="style152">
</td>
</tr>
<tr>
<td class="OrdrenrMellom">
<asp:Label ID="lblOrdrenr" runat="server" style="font-size: small"></asp:Label>
</td>
<td class="style196">
</td>
<td class="OrdredatoMellomrom"
>
<asp:Label ID="lblOrdredato" runat="server" CssClass="style54"></asp:L
abel>
</td>
<td class="style86">
</td>
<td class="style100">
<asp:Label ID="lblLevdato" runat="server" CssClass="style54"></asp:L
abel>
</td>
<td class="style128">
</td>
<td class="style100">
<asp:Label ID="lblStatus" runat="server" CssClass="style54"></asp:L
abel>
</td>
<td class="style119">
</td>
<td class="style100">
<asp:Label ID="lblType" runat="server" CssClass="style54"></asp:L
abel>
</td>
<td class="style173">
</td>
<div>
<td class="style100">
<asp:Label ID="lblKontaktP" runat="server" CssClass="style54"></asp:L
abel>
</td>
<td style="text-align:right" class="style161">
</td>
</div>
<td style="text-align:right" class="style190">
<asp:Label ID="lblSumOrdre" runat="server" position="right" CssClass="style54"></asp:L
abel>
</td>
<td style="text-align:right" class="style194">
</td>
<td style="text-align:right" class="style192">
<asp:Label ID="lblSumLevert" runat="server" CssClass="style54"></asp:L
abel>
</td>
</tr>
</p>
<table style="height: 23px; width: 987px;">
<tr class="MainText_bunn" onmousedown="this.style.ba
ckgroundCo
lor='#8C9C
A8';style.
color='whi
te" onmouseup="this.style.back
groundColo
r='#8C9CA8
';style.co
lor='white
'" >
<td class="style195" style="background-color: #8C9CA8">
</td>
</tr>
</table>
<asp:Label ID="lbltotalsumordre" runat="server"
style="top: 164px; left: 866px; position: absolute; height: 18px; width: 39px; font-size: small; font-family: Tahoma; font-weight: 700; right: 1303px;"
></asp:Label>
<asp:Label ID="lbltotalsumlevert" runat="server"
style="font-size: small; font-family: Tahoma; font-weight: 700; top: 164px; left: 934px; position: absolute; height: 21px; width: 162px;"></asp:Label>
<p>
</p>
<asp:Panel ID="vismer" runat="server">
</asp:Panel>
<p>
<asp:Label ID="Label1" runat="server" Text="Totalt: "
style="font-size: small; font-weight: 700; top: 164px; left: 708px; position: absolute; height: 21px; width: 63px; font-family: Tahoma; color: #FFFFFF;"></asp:Label>
</p>
<p>
</p>
hope someone can help, this is very important to me.