473,320 Members | 1,828 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.

Split a Datagrid

I'm trying to split a datagrid after 30 rows and I dont want to use it
for paging purposes so please dont suggest the PageSize="30" option.
:)
--------------------------------------------------------------------------
This is one of my first thoughts but of course it doesnt work or else
I wouldnt be here asking for help. Thanks
--------------------------------------------------------------------------
Im using a SQL call

sqlString = "SELECT * FROM Table"
Dim sqlDataAdapter As New SqlClient.SqlDataAdapter(sqlString,
sqlConnection)
Dim Ds As New DataSet()
sqlDataAdapter.Fill(Ds, "table")

With Ds.Tables(0).Rows
If .Count > 30 Then
Dim numPages = .Count / 30
For i = 1 To -(Int(-numPages))
With Datagrid1
.DataSource = Ds
.DataMember = "table"
.DataBind()
End With
Response.Write("<br>")
Next
Else
With Datagrid1
.DataSource = Ds
.DataMember = "table"
.DataBind()
End With
End if
End With
--------------------------------------------------------------------------
Im look for the following affect

Datagrid1
----------------------------------------------
| Header | Header | Header | Header | Header |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------

Datagrid1
----------------------------------------------
| Header | Header | Header | Header | Header |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------

Thanks
Dave
Nov 18 '05 #1
2 1373
look at the row to determine the number of grids, and either build a dataset
(copy the desired rows to a new dataset) or create a dataset view of the
desired rows and bind these to the grids. for sometime this simple i'd
probably use a repeater though.

-- bruce (sqlwork.com)
"David" <dt*****@program4.com> wrote in message
news:39**************************@posting.google.c om...
| I'm trying to split a datagrid after 30 rows and I dont want to use it
| for paging purposes so please dont suggest the PageSize="30" option.
| :)
| --------------------------------------------------------------------------
| This is one of my first thoughts but of course it doesnt work or else
| I wouldnt be here asking for help. Thanks
| --------------------------------------------------------------------------
| Im using a SQL call
|
| sqlString = "SELECT * FROM Table"
| Dim sqlDataAdapter As New SqlClient.SqlDataAdapter(sqlString,
| sqlConnection)
| Dim Ds As New DataSet()
| sqlDataAdapter.Fill(Ds, "table")
|
| With Ds.Tables(0).Rows
| If .Count > 30 Then
| Dim numPages = .Count / 30
| For i = 1 To -(Int(-numPages))
| With Datagrid1
| .DataSource = Ds
| .DataMember = "table"
| .DataBind()
| End With
| Response.Write("<br>")
| Next
| Else
| With Datagrid1
| .DataSource = Ds
| .DataMember = "table"
| .DataBind()
| End With
| End if
| End With
| --------------------------------------------------------------------------
| Im look for the following affect
|
| Datagrid1
| ----------------------------------------------
| | Header | Header | Header | Header | Header |
| ----------------------------------------------
| | 234 | 234232 | 56 | 2342 | 2345 |
| ----------------------------------------------
| | 234 | 234232 | 56 | 2342 | 2345 |
| ----------------------------------------------
| | 234 | 234232 | 56 | 2342 | 2345 |
| ----------------------------------------------
| | 234 | 234232 | 56 | 2342 | 2345 |
| ----------------------------------------------
| | 234 | 234232 | 56 | 2342 | 2345 |
| ----------------------------------------------
|
| Datagrid1
| ----------------------------------------------
| | Header | Header | Header | Header | Header |
| ----------------------------------------------
| | 234 | 234232 | 56 | 2342 | 2345 |
| ----------------------------------------------
| | 234 | 234232 | 56 | 2342 | 2345 |
| ----------------------------------------------
| | 234 | 234232 | 56 | 2342 | 2345 |
| ----------------------------------------------
| | 234 | 234232 | 56 | 2342 | 2345 |
| ----------------------------------------------
| | 234 | 234232 | 56 | 2342 | 2345 |
| ----------------------------------------------
|
| Thanks
| Dave
Nov 18 '05 #2
Here is an article showing how to do subheadings:

http://aspnet.4guysfromrolla.com/dem...ubHeaders.aspx
--
Joe Fallon

"David" <dt*****@program4.com> wrote in message
news:39**************************@posting.google.c om...
I'm trying to split a datagrid after 30 rows and I dont want to use it
for paging purposes so please dont suggest the PageSize="30" option.
:)
--------------------------------------------------------------------------
This is one of my first thoughts but of course it doesnt work or else
I wouldnt be here asking for help. Thanks
--------------------------------------------------------------------------
Im using a SQL call

sqlString = "SELECT * FROM Table"
Dim sqlDataAdapter As New SqlClient.SqlDataAdapter(sqlString,
sqlConnection)
Dim Ds As New DataSet()
sqlDataAdapter.Fill(Ds, "table")

With Ds.Tables(0).Rows
If .Count > 30 Then
Dim numPages = .Count / 30
For i = 1 To -(Int(-numPages))
With Datagrid1
.DataSource = Ds
.DataMember = "table"
.DataBind()
End With
Response.Write("<br>")
Next
Else
With Datagrid1
.DataSource = Ds
.DataMember = "table"
.DataBind()
End With
End if
End With
--------------------------------------------------------------------------
Im look for the following affect

Datagrid1
----------------------------------------------
| Header | Header | Header | Header | Header |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------

Datagrid1
----------------------------------------------
| Header | Header | Header | Header | Header |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------
| 234 | 234232 | 56 | 2342 | 2345 |
----------------------------------------------

Thanks
Dave

Nov 18 '05 #3

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

Similar topics

5
by: Stu Cazzo | last post by:
I have the following: String myStringArray; String myString = "98 99 100"; I want to split up myString and put it into myStringArray. If I use this: myStringArray = myString.split(" "); it...
9
by: Will McGugan | last post by:
Hi, I'm curious about the behaviour of the str.split() when applied to empty strings. "".split() returns an empty list, however.. "".split("*") returns a list containing one empty string. ...
4
by: Itzik | last post by:
can i split this string string str = "aa a - bb-b - ccc" with this delimiter string del = " - " i want recieve 3 items : "aa a" , "bb-b" , "ccc"
3
by: aarthy kumar | last post by:
Hi, I have a problem in the display of the ASP screen actually i am retrieving and displaying the data from a database when the view button is hit.The contents for display is so long so i want...
14
by: Ron | last post by:
Hello, I am trying to parse a string on the newline char. I guess vbCrLf is a string constant. How can I parse my string - data - on the newline char? .... data += ASCII.GetString(buffer, 0,...
3
by: Ben | last post by:
Hi I am creating a dynamic function to return a two dimensional array from a delimeted string. The delimited string is like: field1...field2...field3... field1...field2...field3......
2
by: damian | last post by:
I want to split a large csv file into smaller files. How can i go about this?.. thank you !
5
by: Dave | last post by:
Is there a way to divide a datagrid into "newspaper" style columns so that column 1 would have rows 1-10, column two would have rows 11-20 etc? Thanks, Dave.
0
by: prakashamnkl | last post by:
i want to split the data grid coloumns into a sub header. And one more thing I want to insert the trackbar into the datagrid cells . Anybody have answers for my question plz reply me.
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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: 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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.