473,320 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Populating a Table not a datagrid

Hi All :-)

I need to populate a table I created as a web form. Are there any links to show me how to do this? I CANNOT use a dtagrid for this, the table has to be laid out as follows:

Header Row Header Row
Static data Dynamic (read only) data

<Break>

Header Row Header Row Header Row Header Row
Static Data Dynamic (read only) Dynamic (read only) Calcultiion
This makes it impossible for me to use a datagrid - Unless someone has a link to how to do this in a datagrid - I MUST be able to have one column of static data, two columns of dynamic read only data, and a total column to display the calculation in...I also need a footer to display calculations in the TOTALS Row at the bottom of the page... I have not been able to find any VB samples on how to do this with a datagrid, and am hoping some one has a link to show me how to do this with a ASP.Net Table...any suggestions? TIA - Coleen

---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 20 '05 #1
6 1516
Sure, this can be done with datagrids. However, you'll need two of them
(looks like you have 2 tables here).
Use a BoundColumn for the dynamic data, and a non-bound column for the
static data.
The alternative is to forget the datagrid entirely, and create the HTML
table yourself by running a bunch of Repsponse.Write() statements that set
up the <TABLE><TR>and <TD> elements manually.

-Rob Teixeira [MVP]

<coleenholley> wrote in message
news:OR**************@TK2MSFTNGP10.phx.gbl...
Hi All :-)

I need to populate a table I created as a web form. Are there any links to show me how to do this? I CANNOT use a dtagrid for this, the table has
to be laid out as follows:
Header Row Header Row
Static data Dynamic (read only) data

<Break>

Header Row Header Row Header Row Header Row Static Data Dynamic (read only) Dynamic (read only) Calcultiion

This makes it impossible for me to use a datagrid - Unless someone has a link to how to do this in a datagrid - I MUST be able to have one column of
static data, two columns of dynamic read only data, and a total column to
display the calculation in...I also need a footer to display calculations in
the TOTALS Row at the bottom of the page... I have not been able to find any
VB samples on how to do this with a datagrid, and am hoping some one has a
link to show me how to do this with a ASP.Net Table...any suggestions?
TIA - Coleen
---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest

Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 20 '05 #2
Yes I can do this with two datagrids, but as I stated before, every sample that I have found is listed in C, Not in VB do you have any suggestions where I can find samples in VB to do this? Part of my problem is the type of connection we use...we do not connect to an SQL database, we use DB2 through RPC's written in COBOL. This makes everything more difficult, and trying to make sense of samples written in C is not helping...any suggestions? Thanks for your response :-)

---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 20 '05 #3
Hm, that's odd. Most samples (at least on the Microsoft site) have both C#
and VB examples.
However, you can do most of the work without actually coding - in other
words, playing with the property builders and designers of the datagrid
control itself. So that should take some of the burden off, hopefully.

As for the DB2/COBOL thing - some of the RPC bridges I've seen use drivers
that emulate an ODBC layer. One that I've worked with recently is NEON, and
while the call itself looks nothing like SQL, the return values are
populated in rows and columns conforming to an ODBC result set. If your RPC
mechanism works like that, then you can usually substitute the SQL ADO.NET
provider classes with the ODBC ADO.NET provider classes. So basically,
instead of a SQLConnection, you'll have an ODBCConnection, and so on. The
important thing is that at some point, regardless of which provider you use,
you'll end up with a DataSet, which represents the return values, and the
code should be all the same from there on out.

-Rob Teixeira [MVP]

<coleenholley> wrote in message
news:eL**************@TK2MSFTNGP09.phx.gbl...
Yes I can do this with two datagrids, but as I stated before, every sample that I have found is listed in C, Not in VB do you have any suggestions
where I can find samples in VB to do this? Part of my problem is the type
of connection we use...we do not connect to an SQL database, we use DB2
through RPC's written in COBOL. This makes everything more difficult, and
trying to make sense of samples written in C is not helping...any
suggestions? Thanks for your response :-)
---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest

Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 20 '05 #4
We've actually been able to write a class module to do the connection for us, but we run into wierd problems with Paging and PostBack. I use the If Not Page.IsPostBack Then...statement alot, and it works most of the time. I'm still having trouble getting the samples I've found for custom paging to work correctly for me. I get the numeric <> pages but when I click them, the next page to come up is blank (no datagrid, no labels, nothing?) so I'm working on that along with creating a page with two datagrids with Static data in one column. I know I can use a bound column for this, but what I'm confused on is how to populate the static data- the data in this column will be different for each row; i.e., static column row 1 = Carson City, row 2 = Churchill, row 3 = Clark...each row will have corresponding data in other columns that is dynamic and read-only, that part I understand. Is there a way to actually write the static data into the column? Like in an HTML table I can actually populate the column with exactly the text I want, how do I do that with a datagrid? I appreciate any/all help :-) Thank you
---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 20 '05 #5
After you bind, you can go through the datagrid's Items and Cells
collections to change text, etc. Another alternative is to use template
columns, but that's more cumbersome (at least in my opinion).
Part of your problem with blank grids is the fact that default paging
requires you to refetch the entire set of data. I suspect that your checks
for PostBack are stopping this from happening. You will definitely want to
work with custom paging if you'd rather not get all the data for each page
every time you click to a different page. Remember that the datagrid doesn't
remember ALL the data bound to it, just the rows that appear on the current
page.

-Rob Teixeira [MVP]

<coleenholley> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
We've actually been able to write a class module to do the connection for us, but we run into wierd problems with Paging and PostBack. I use the If
Not Page.IsPostBack Then...statement alot, and it works most of the time.
I'm still having trouble getting the samples I've found for custom paging to
work correctly for me. I get the numeric <> pages but when I click them,
the next page to come up is blank (no datagrid, no labels, nothing?) so I'm
working on that along with creating a page with two datagrids with Static
data in one column. I know I can use a bound column for this, but what I'm
confused on is how to populate the static data- the data in this column will
be different for each row; i.e., static column row 1 = Carson City, row 2 =
Churchill, row 3 = Clark...each row will have corresponding data in other
columns that is dynamic and read-only, that part I understand. Is there a
way to actually write the static data into the column? Like in an HTML
table I can actually populate the column with exactly the text I want, how
do I do that with a datagrid? I appreciate any/all help :-) Thank you!

---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest

Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 20 '05 #6
I know this is a lot of code, but here is what I have;

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
uf_get_supplier_list()
End If
End Sub

Private Sub uf_get_supplier_list()
'This function gets the Withdrawal listing if available.
'Define the local variables.
Dim li_no_row As Integer = 0

Try
'Instantiate an RPC to get an Withdrawal Listing.
lo_AZRM001A_SEL = New MotorFuel.AZRM001A_SEL()
lo_misc_func = New MotorFuel.misc_func()
Catch
'Destroy the objects.
lo_AZRM001A_SEL = Nothing
lo_misc_func = Nothing
End Try

'Check for CICS call.
If lo_AZRM001A_SEL.uf_cicscall() Then
'If CICS call is true then move forward.
'Check for the dci error code.
If lo_AZRM001A_SEL.get_dci_error_code = "0000" Then
'Convert the string value to the interget value.
If lo_misc_func.IsNumeric(lo_AZRM001A_SEL.get_dci_row _count) = True Then
li_no_row = Integer.Parse(lo_AZRM001A_SEL.get_dci_row_count)
Else
li_no_row = 0
End If

'Set the data to the Data Grid if the li_no_row is not equal "0".
If li_no_row <> 0 Then
If Page.IsPostBack = False Then
'dtg_sel_sup.DataSource = lo_AZRM001A_SEL.get_ddl_sel_sup
dt_mc = lo_AZRM001A_SEL.get_ddl_sel_sup
dtg_load_data()
End If
Else
End If

'Destroy the objects.
lo_AZRM001A_SEL = Nothing
lo_misc_func = Nothing
End If
Else
'Destroy the objects.
lo_AZRM001A_SEL = Nothing
lo_misc_func = Nothing

End If

End Sub
Private Sub btn_sel_sup_ok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_sel_sup_ok.Click
Response.Redirect("../Common/mc_rpt_period.aspx")
End Sub

Sub dtg_load_data()
dtg_sel_sup.DataSource = dt_mc
dtg_sel_sup.DataKeyField = "BusinessID"
dtg_sel_sup.DataMember = "BusinessName"
dtg_sel_sup.DataMember = "Account"
dtg_sel_sup.DataBind()

'Destroy the objects.
lo_AZRM001A_SEL = Nothing
lo_misc_func = Nothing
End Sub

Sub dtg_sel_sup_Page(ByVal sender As Object, ByVal e As DataGridPageChangedEventArgs)

dtg_sel_sup.CurrentPageIndex = e.NewPageIndex

End Sub

I'm not sure if it is the lack of a Not page.isPostBack that is causing me the problem in my dataload sub or not...any suggestions? Thanks very much for your help :-)
---
Posted using Wimdows.net NntpNews Component - Posted from .NET's Largest Community Website: http://www.dotnetjunkies.com/newsgroups/
Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Adel | last post by:
Hello guys Does any one know about how to inforce sorting on a specific coloumn in a datagrid before populating it ? Thanks in advance
2
by: Ricardo Luceac | last post by:
HI all.. I have a huge table that I want to display in a datagrid, the problem is that if I make a dataset, the entire table must go to the dataset to the data begin to display, and it takes...
6
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset...
4
by: Paul | last post by:
I sometimes get a timeout error when populating my datagrid, the code is WizardConnection.Open() UpdateCommand.CommandText = "EXECUTE sp_assign_user '" & PhysOffice.SelectedValue & "', '" &...
4
by: Bob Hollness | last post by:
Hi all. I hope this is the right group I am trying to populate a datagrid on an ASP.NET page from a MySQL table using the .NET connector (ByteFX). But for the life of me, I just cannot work it...
3
by: gg77 | last post by:
Hi, I don't have much knowledge of the table control. I am basically trying to use a table thats populated with data rows from a dataSet but currently things aren't working for me. below is...
5
by: | last post by:
Trying to learn about manipulating collections of objects, and populating these objects dynamically from datasources. Could someone post a code sample that shows the following: Instantiating a...
7
by: coleenholley | last post by:
Hi all :-) I have a couple of web pages created using ASP.Net and VB code-behind. We use a connection call through an RPC to COBOL, NOT an SQL connection, so my connection to get the data is done...
1
by: Mike P | last post by:
I am populating a drop down column in a datagrid on page load. Here is my code : <asp:TemplateColumn> <ItemTemplate> <asp:DropDownList ID="ddlUserName" Font-Name="Verdana" Font-Size="8pt"...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.