•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 456,504 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,665 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 2440 | Replies: 3
![]() |
Hello-- I have an ordering screen that displays hundreds of items in a datagrid and provides a blank for the user to enter a Quantity. Datagrid "CatalogGrid" is bound to a datasource which is based on the System.Collection.CollectionBase class. If the user has entered a Quantity on a row, the quantity is displayed on the same datagrid row via a datasource which is based on the System.Collections.DictionaryBase class. (See code snippets below.)
My goal is to create a new Order Preview page that shows only ordered items, allowing the user to change the quantity or delete. In that situation, ss there a way to hide rows where the Quantity is blank, while still using this datasource implementation? See mock-up image here: http://www.enardoni.com/download/ord...iew_mockup.gif
Thank you in advance for your consideration!
===
ASP.NET with Visual Basic, using Visual Studio 2003. I'm a relatively new developer who inherited the source code from an expert programmer, so please bear with me!
From the ASPX page:
From the code-behind:
My goal is to create a new Order Preview page that shows only ordered items, allowing the user to change the quantity or delete. In that situation, ss there a way to hide rows where the Quantity is blank, while still using this datasource implementation? See mock-up image here: http://www.enardoni.com/download/ord...iew_mockup.gif
Thank you in advance for your consideration!
===
ASP.NET with Visual Basic, using Visual Studio 2003. I'm a relatively new developer who inherited the source code from an expert programmer, so please bear with me!
From the ASPX page:
<asp:BoundColumn DataField="ItemNumber" HeaderText="Item #">
<HeaderStyle Width="3%"></HeaderStyle>
</asp:BoundColumn>
<asp:TemplateColumn HeaderText="Qty">
<HeaderStyle Width="5%"></HeaderStyle>
<ItemTemplate>
<asp:TextBox id="QuantityTextbox" runat="server" Text='<%# DataGrid_BindQuantity(DataBinder.Eval(Container, "DataItem.ItemId")) %>' </asp:TextBox>
</ItemTemplate>
</asp:TemplateColumn>From the code-behind:
CatalogGrid.DataSource = CatalogItems.PageFill
CatalogGrid.DataBind() Protected Function DataGrid_BindQuantity(ByVal dataItem As Object) As String
Dim value As String = String.Empty
Dim ThisOrder As MyOrderClass = CType(Me.GetSessionValue("Order"), MyOrderClass)
If Not IsNothing(ThisOrder) Then
Dim ItemId As String = dataItem.ToString
If ThisOrder.OrderedItems.Contains(ItemId) Then
value = ThisOrder.OrderedItems(ItemId).Quantity.ToString()
End If
End If
Return value
End Function I would normally use this with a dataview in Windows Applications but the concept should be the same
Dim SQLRow as datarow Dim Index as Integer = 0 For Each SQLRow In DataGrid.Rows If SQLRow(ColumnName).tostring = "" Then DataGrid.Rows(Index).Visible = False else DataGrid.Rows(Index).Visible = True End If Index += 1 Next
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- How can i add textboxes dynamically in an asp page (ASP)
- Datagrid - Help (VB.NET)
- coloring datagrid (VB.NET)
- how to swap rows in a dataGrid (ASP.NET)
- Datagrid - no value at index ### error when scroll and sort (VB.NET)
- Blank Record & Open Form From Datagrid (C#)
- refresh datagrid causes error if oper scrolled off right side of grid (VB.NET)
- Use of DataGrid (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: error on 'ajaxToolkit:ToolkitScriptManager' when upload to a host
- Next Thread: Getting ASP websites online


Linear Mode