J
J
Hi,
I've created a datagrid which has 4 columns, a 'checkbox' column, ID, Name
and and image.
My HTML looks like...
<asp
ataGrid id="DataGrid1" runat="server" AllowSorting="True"
AutoGenerateColumns="False" PageSize="3">
<Columns>
<asp:BoundColumn></asp:BoundColumn>
<asp:BoundColumn DataField="distID" SortExpression="distID"
HeaderText="DistID"></asp:BoundColumn>
<asp:BoundColumn DataField="distName" SortExpression="distName"
HeaderText="DistName"></asp:BoundColumn>
<asp:BoundColumn DataField="distributorLevel"
SortExpression="distributorLevel" HeaderText="Level"></asp:BoundColumn>
</Columns>
<PagerStyle Mode="NumericPages"></PagerStyle>
</asp
ataGrid>
My VB.ASP code looks like...
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemDataBound
If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType =
ListItemType.Item Then
Dim distributionLevelImage As New HtmlImage()
Dim chooseName As New CheckBox()
chooseName.AutoPostBack = True
chooseName.EnableViewState = True
distributionLevelImage.Src = "images/distributionLevelImages/Level" +
e.Item.Cells(3).Text + ".Gif"
e.Item.Cells(3).Controls.Add(distributionLevelImage)
e.Item.Cells(0).Controls.Add(chooseName)
End If
End Sub
What I'm trying to achive is to allow the user to choose a selection, using
the check boxes, but when they sort, or change page, those items that they
have previously selected are lost!
Does anyone have any pointers, websites etc, for me to understand how to do
what I want.
TIA
I've created a datagrid which has 4 columns, a 'checkbox' column, ID, Name
and and image.
My HTML looks like...
<asp
AutoGenerateColumns="False" PageSize="3">
<Columns>
<asp:BoundColumn></asp:BoundColumn>
<asp:BoundColumn DataField="distID" SortExpression="distID"
HeaderText="DistID"></asp:BoundColumn>
<asp:BoundColumn DataField="distName" SortExpression="distName"
HeaderText="DistName"></asp:BoundColumn>
<asp:BoundColumn DataField="distributorLevel"
SortExpression="distributorLevel" HeaderText="Level"></asp:BoundColumn>
</Columns>
<PagerStyle Mode="NumericPages"></PagerStyle>
</asp
My VB.ASP code looks like...
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemDataBound
If e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType =
ListItemType.Item Then
Dim distributionLevelImage As New HtmlImage()
Dim chooseName As New CheckBox()
chooseName.AutoPostBack = True
chooseName.EnableViewState = True
distributionLevelImage.Src = "images/distributionLevelImages/Level" +
e.Item.Cells(3).Text + ".Gif"
e.Item.Cells(3).Controls.Add(distributionLevelImage)
e.Item.Cells(0).Controls.Add(chooseName)
End If
End Sub
What I'm trying to achive is to allow the user to choose a selection, using
the check boxes, but when they sort, or change page, those items that they
have previously selected are lost!
Does anyone have any pointers, websites etc, for me to understand how to do
what I want.
TIA