ERLEDIGT
JA
JA
ANTWORTEN
0
0
ZUGRIFFE
637
637
EMPFEHLEN
-
04.02.04 08:32 #1stormystormy Tutorials.de Gastzugang
Hallo
Hoffe es kann mir wer helfen
Ich möchte ein Datagrid das das Paging unterstützt
Weiters sollte aber auch in einer Spalte ein Link sein (wird ein Popup aufgerufen)
Soweit habe ich das ja schon
Aber das Problem wenn ich dann auf den Link klick dann geht das Grid wieder auf Seite1 (sollte aber auf der aktuellen bleiben)
Hoffe dass das zusammen funktioniert (sollte auch noch eine manuelle Sortierung zulassen) aber wie und ob das ist die Frage
Es muss doch irgendwo was mit
e As DataGridCommandEventArgs &
e As DataGridPageChangedEventArgs
zutun haben aber wie bekomm ich das alles auf einmal
Hier der Code
Danke schon mal
Roland
<%@ Import Namespace="System.Data" %>
<HTML>
<script language="VB" runat="server">
Dim startIndex As Integer
Public Test
Function CreateDataSource() As ICollection
Dim dt As DataTable
Dim dr As DataRow
Dim i As Integer
'create a DataTable
dt = New DataTable
dt.Columns.Add(New DataColumn("IntegerValue", GetType(Integer)))
dt.Columns.Add(New DataColumn("StringValue", GetType(String)))
dt.Columns.Add(New DataColumn("DateTimeValue", GetType(String)))
dt.Columns.Add(New DataColumn("BoolValue", GetType(Boolean)))
' "query" should return one page of data, beginning at the start index
For i = startIndex to (startIndex + MyDataGrid.PageSize)
dr = dt.NewRow()
dr(0) = i
dr(1) = "Element " + i.ToString()
dr(2) = DateTime.Now.ToShortDateString
If (i Mod 2 <> 0) Then
dr(3) = True
Else
dr(3) = False
End If
dt.Rows.Add(dr)
Next
'return a DataView to the DataTable
CreateDataSource = New DataView(dt)
End Function
Sub Page_Load(sender As Object, e As EventArgs)
If Not IsPostBack Then
startIndex = 0
MyDataGrid.VirtualItemCount = 200
End If
BindGrid
End Sub
Sub MyDataGrid_Page(sender As Object, e As DataGridPageChangedEventArgs)
startIndex = e.NewPageIndex * MyDataGrid.PageSize
MyDataGrid.CurrentPageIndex = e.NewPageIndex
response.write(e.NewPageIndex)
BindGrid
End Sub
Sub BindGrid()
MyDataGrid.DataSource = CreateDataSource()
MyDataGrid.DataBind
End Sub
Sub Grid_CartCommand(sender As Object, e As DataGridCommandEventArgs)
End Sub
</script>
<body>
<form runat="server" ID="Form1">
<ASP
ataGrid id="MyDataGrid" runat="server" AllowPaging="True" AllowCustomPaging="True" PageSize="10" PagerStyle-Mode="NumericPages" PagerStyle-HorizontalAlign="Right" OnPageIndexChanged="MyDataGrid_Page" BorderColor="black" BorderWidth="1" GridLines="Both" CellPadding="3" CellSpacing="0" Font-Name="Verdana" Font-Size="8pt" HeaderStyle-BackColor="#aaaadd" AlternatingItemStyle-BackColor="#eeeeee" AutoGenerateColumns="false" OnItemCommand="Grid_CartCommand"
>
<Columns>
<asp:ButtonColumn HeaderText="Message" text="View" CommandName="ViewMessage" />
<asp:BoundColumn HeaderText="IntegerValue" DataField="IntegerValue" />
<asp:BoundColumn HeaderText="IStringValue" DataField="IntegerValue" />
<asp:BoundColumn HeaderText="DateTimeValue" DataField="DateTimeValue" />
<asp:BoundColumn HeaderText="BoolValue" DataField="BoolValue" />
</Columns>
</ASP
ataGrid>
</form>
</body>
</HTML>
Ähnliche Themen
-
Flex3 AS3 Problem - DataGrid mit XML als DataProvider
Von redneb im Forum Adobe Flex & AIRAntworten: 1Letzter Beitrag: 21.02.08, 15:43 -
Problem mit dem DataGrid (C#)
Von Bella_Isy im Forum .NET Windows FormsAntworten: 1Letzter Beitrag: 22.11.06, 16:30 -
C# Problem mit DataSet und Datagrid
Von Nukleo im Forum .NET ArchivAntworten: 3Letzter Beitrag: 14.03.05, 09:48 -
Datagrid inhalt an anderes datagrid übergeben!
Von c0si im Forum Visual Basic 6.0Antworten: 0Letzter Beitrag: 01.03.05, 11:14 -
Problem mit Datagrid und Access Tabelle
Von Javaprogrammer im Forum Visual Basic 6.0Antworten: 2Letzter Beitrag: 07.04.04, 17:22





Zitieren
Login





