473,382 Members | 1,583 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,382 software developers and data experts.

Custom Datagrid

Hi all,
I have datagrid problem. Im creating datagrid with the
code which allow the column header is set manually. This
is the code:

Public Sub BrowseTable(ByVal sqlStr As String, ByVal
field1 As ArrayList, field2 as arraylist)

Dim newCol As New BoundColumn
Dim aCount, colWidth As Integer

For aCount = 0 To field.Count - 1
newCol = New BoundColumn()
newCol.HeaderText = field1(aCount)
newCol.DataField = field2(aCount)
DGDTable.Columns.Add(newCol)

Next

DGDTable.PageSize = 5
DGDTable.PagerStyle.Mode = PagerMode.NumericPages
DGDTable.DataSource = dataset1
DGDTable.DataBind()

End Sub

DGDTable is datagrid.
When I calling this function its work normally but the
problem is when I click to the page 2 and so on the table
is blank. Since I have 100 data it suppose show me the
next page right, but its not.

It is because of my coding is wrong or I need to set
something. Thanks

Nov 19 '05 #1
1 945
Hi Red,

Where do you run BrowseTable() and what is your code in
PageChanged event?

Elton Wang
el********@hotmail.com

-----Original Message-----
Hi all,
I have datagrid problem. Im creating datagrid with the
code which allow the column header is set manually. This
is the code:

Public Sub BrowseTable(ByVal sqlStr As String, ByVal
field1 As ArrayList, field2 as arraylist)

Dim newCol As New BoundColumn
Dim aCount, colWidth As Integer

For aCount = 0 To field.Count - 1
newCol = New BoundColumn()
newCol.HeaderText = field1(aCount)
newCol.DataField = field2(aCount)
DGDTable.Columns.Add(newCol)

Next

DGDTable.PageSize = 5
DGDTable.PagerStyle.Mode = PagerMode.NumericPages
DGDTable.DataSource = dataset1
DGDTable.DataBind()

End Sub

DGDTable is datagrid.
When I calling this function its work normally but the
problem is when I click to the page 2 and so on the table
is blank. Since I have 100 data it suppose show me the
next page right, but its not.

It is because of my coding is wrong or I need to set
something. Thanks

.

Nov 19 '05 #2

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

Similar topics

0
by: Julien | last post by:
Hi, I created a custom server control, compiled as a DLL (it's a composite server control). In my apsx page, I use something like : <MyAssembly:MyObject properties> <asp:datagrid />...
0
by: Stephen | last post by:
This is a real brain-teaser and i'd really appreciate it if someone can try and understand what im trying to do and give me a few pointers or ideas to help me work out my problem. Im basically...
2
by: SammyBar | last post by:
Hi, I'm trying to bind a custom collection class to a data grid, following the guidelines from the article http://msdn.microsoft.com/msdnmag/issues/05/08/CollectionsandDataBinding/default.aspx....
1
by: The_Rave | last post by:
Hi everyone, I'm trying to add my own template columns to the property builder of ..NET. E.g. a checkbox column, or an image column. But I can't find the sources of the wizard, or a way to add...
1
by: Vagabond Software | last post by:
I am creating a custom datagrid based, in part, from someone else's code. The author declared a derived datagrid class in a windows form, then declared a derived ColumnStyle class, in the same form,...
0
by: Lenny | last post by:
Hello, I have an html table template which I want to turn into ASP.NET custom control. I want to utilize the best features of OOP. I want to be able to create columns headings dynamically, add...
2
by: Jay Walker | last post by:
I created a custom DataGridColumn based on Marcie Robillard's MSDN Article: Creating Custom Columns for the ASP.NET Datagrid...
7
by: Girish | last post by:
OK.. phew. Playing with data grids for the past few days has been fun and a huge learning experience.. My problem. I have a requirement to display a gird with a gird. Within the embedded grid,...
1
by: Sam Samnah | last post by:
Hi Everyone. It has been a long time since my last post. Nevertheless, I have built a custom server control that allows a user to edit text, bolding, italics strike though table insertion and...
1
by: rn5a | last post by:
I have created a custom server control which is actually a Button clicking which prompts a user with a JavaScript confirm message asking him whether he would like to proceed or not. If he clicks...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.