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

Programmatic GridView

So far all the examples I've seen on the GridView gets its data declaratively
using one of the Data Source controls such as the ObjectDataSource.

Are there any good articles on using the GridView programmatically, getting
data from a business tier, and implementing sorting and paging on that data.
All of that without one of the Data Source controls?

--
-Demetri
May 30 '06 #1
1 1576
I wrote my own grid control that does all of this starting a few years
back. It's all part of an opensource project I am working on. But if I
understand your question, you want to automatically display data based
off of the underlying structure of the table in your DB, or perhaps a
middle logic layer.

I have done this before in an opensource project that me and a few
friends are working on.

Open Source Project home
http://www.codeproject.com/aspnet/RapidWebAppDev.asp

Site that was developed using the project:
http://www.ats-engineers.com
(I am currently working on a demo site at the same domain that will
demo the features that the general public does not have access to)

Again, what you want is possible with my opensource project, and even
if you don't use it, it may get you started in the right direction. The
biggest problem I had with the datagrid (1.0-1.1) and the datagridview
is that things like filtering and column captions, as well as which
columns were even displayed were all very problematic to code from
actual code, rather than ASPX page markups. These ASPX Markups are nice
for one off pages, but not something that you want to use if you want
something to be re-usable. The Multiformity project stores quite a bit
of metadata about the database in its System Tables (all preceded by an
underscore). Things like if a table is editable, readable, even if
fields are editable and readable. It also integrates a view concept (in
an unreleased version that I am still polishing off before publishing
it), as well as saved filters. Plus lots of other snazzy security
features, and builtin custom controls.

I don't know if this answers your question, but I know that I have yet
to come up on a good example of DataGridView that is not 100%
configured through the VS Designer and is pretty much useless for any
kind of re-usability. I for one understand your point, and don't want
to spend my life designing grid pages for 100 + tables in my
database...

Good luck!

AB

May 30 '06 #2

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

Similar topics

3
by: theKirk | last post by:
using Visual Studio 2005 C# ASP.NET I know there has to be a simple way to do this....I want to use C# in a code behind for aspx. Populate a GridView from an xml file Add Fields to the...
6
by: Nalaka | last post by:
Hi, I have a gridView (grid1), which as a templateColumn. In the template column, I have put in a gridView (grid2) and a ObjectDataSource (objectDataSource2). Question is... How to I pass the...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
2
by: Netmonster | last post by:
I am having trouble programmatically setting the SelectedIndexChanged of a GridView. Code as follows. Panel Panel1 = new Panel(); GridView g = new GridView(); ObjectDataSource o = new...
5
by: Dick | last post by:
I have a GridView bound to an ObjectDataSource. I have a Button that calls GridView.DataBind. I want the row that is selected before the DataBind to still be selected afterwards. This happens...
6
by: Blaine Manyluk | last post by:
I have a very unusual request. I need to be able to generate reports and save them as TIF files, with full programmatic control. The application will provide the filenames. Each page of the...
2
by: antonyliu2002 | last post by:
I've been googling for some time, and could not find the solution to this problem. I am testing the paging feature of gridview. I have a very simple web form on which the user can select a few...
6
by: RobertTheProgrammer | last post by:
Hi folks, Here's a weird problem... I have a nested GridView setup (i.e. a GridView within a GridView), and within the nested GridView I have a DropDownList item which has the...
3
by: Peter | last post by:
I have a GridView which is populated by List<ofObjects> Does anyone have example of how to sort the columns of this GridView? I have found examples without DataSourceControl but these use...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.