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

DataGrid..GridView...etc...

Ok...I'm gonna regret this...but here goes....(promise I'm not trolling)

After several years of using the provided ASP.NET data display controls
(DataGrids, Repeaters, and now the GridView amoung others), I cannot deny
that there is an ENORMOUS amount of functionality crammed into these controls
- kudos to MS!!!

However, more and more, I have been encountering situations where I need
EXPLICIT control over the rendered HTML in a grid display scenario (custom
client side JS libraries, app/company wide CSS stylings, etc).

In one example, my datasource is an XmlDocument - so naturally, the
XmlDataSource is to the rescue. However, the XmlDocument is 'incomplete' -
it only contains 'keys' (Guids) that require translating into the appropriate
column / field heading / text (the table columns are dynamically definable in
this app, and this lookup information is cached seperately), and it is NOT in
the 'correct' format for simple binding to work (tag attribute model). Ok,
so we hook into the appropriate OnDataItemBound event and modifiy the
rows/columns directly, adding our own controls as we go (way more involved
for Xml binding). Also, we need to wire up some client-side 'nice' events to
allow row-mouseover highlighting, click to select a row and disply in a
details frame (IFRAME - no postback, please), and possibly adjust some
client-side globals for behavior control, and also be sure that the cells do
NOT wrap - all of which is possible.

Problem is, in the end, I end up with slick page(s), some nice helper
classes and powerful abilities that, well, take up WAAAAY more space than me
just redering my grids 'manually', a la classic ASP. I know this is (and has
been) a heated debate since the beginning, but is this a valid option when
the need arises??? It seems to be discounted quickly amoung many, but if
efficiency is key, why (in these situations) would I want to support 2 - 3
times the code???

Flame suit on, advice appreciated...

mike
Nov 19 '05 #1
2 1476
No flame here, Michael,

I'm not sure what you mean by "way more space" to begin with. Do you mean
code that is compiled? If so, your perception is flawed. I can only imagine
the amount of programming code in the source for the DataGrid control.
However, I can imagine that it's quite large.

As for efficiency, what sort of efficiency are we talking about here?

One of the properties of object-oriented programming is that classes take
awhile to write, but when designed well, can be re-used in many ways
(ploymorphism). That is something you just can't do with ASP.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"MichaelY" <Mi******@discussions.microsoft.com> wrote in message
news:6E**********************************@microsof t.com...
Ok...I'm gonna regret this...but here goes....(promise I'm not trolling)

After several years of using the provided ASP.NET data display controls
(DataGrids, Repeaters, and now the GridView amoung others), I cannot deny
that there is an ENORMOUS amount of functionality crammed into these
controls
- kudos to MS!!!

However, more and more, I have been encountering situations where I need
EXPLICIT control over the rendered HTML in a grid display scenario (custom
client side JS libraries, app/company wide CSS stylings, etc).

In one example, my datasource is an XmlDocument - so naturally, the
XmlDataSource is to the rescue. However, the XmlDocument is
'incomplete' -
it only contains 'keys' (Guids) that require translating into the
appropriate
column / field heading / text (the table columns are dynamically definable
in
this app, and this lookup information is cached seperately), and it is NOT
in
the 'correct' format for simple binding to work (tag attribute model).
Ok,
so we hook into the appropriate OnDataItemBound event and modifiy the
rows/columns directly, adding our own controls as we go (way more involved
for Xml binding). Also, we need to wire up some client-side 'nice' events
to
allow row-mouseover highlighting, click to select a row and disply in a
details frame (IFRAME - no postback, please), and possibly adjust some
client-side globals for behavior control, and also be sure that the cells
do
NOT wrap - all of which is possible.

Problem is, in the end, I end up with slick page(s), some nice helper
classes and powerful abilities that, well, take up WAAAAY more space than
me
just redering my grids 'manually', a la classic ASP. I know this is (and
has
been) a heated debate since the beginning, but is this a valid option when
the need arises??? It seems to be discounted quickly amoung many, but if
efficiency is key, why (in these situations) would I want to support 2 - 3
times the code???

Flame suit on, advice appreciated...

mike

Nov 19 '05 #2
Guess I should have clarified...oops!!

By 'space', I meant additional code to hook into other various binding
events, that (as we all painfully remember) was simply contained in-line in
an RS.MoveNext wheel...not that it is more code per se, just a structure that
doesn't (always) lend it self to microscopic customization of every aspect of
the rendered markup - but it is possible.

As for 'efficiency', that was simply a reference work of maintaining the
(possibly) many files that I now have. For example, the grid ASCX and CS
file, perhaps some helper classes (which by habit I separate into individual
files), etc. Since I (currently) don't write controls (I write apps), I
don't package (.dll) every dontrol I write just so I can use it (moot point),
so these files are now part of my app.

To put this into perspective, it has been years since I've written a
MoveNext wheel to draw dropdown lists - DropDownList is just too easy for
this. However, there is only so much to render with a <select> tag....tables
are much different. Perhaps I don't want my grid table rendered with a <div>
surrounding it (maybe I already provided one)....maybe I don't want it
rendered as a table at all (I want DIV's)...maybe I don't want inline styles
- I have a style sheet for this....maybe I want to ID my cells and rows in a
specific manner, etc. While this is all possible with the controls, by the
time you are done, you've re-written all the rendering portions of the
control anyway. And the scenarios for App. A dont' apply to the Apps B, C,
etc., so I can't reuse the code verbatim anyway.

I will NEVER argue that the tenants of OO far outweigh what was (or is)
possible with cASP - it has saved my butt many times over, and provided me
with solutions to problems that were just out of reach using inline,
procedural code. However, sometimes I get the feeling that the only way I
would be taking full advantage of the abilities of the Data controls is if I
were a stand-along control author, selling generic grid components to the
masses.

Please understand that I am not trying to bash these controls - I've used
them (as I've said) many times over with great success. And I am not just
'stuck' on cASP - I don't think I could go back if I had to. What I am
really after is just a better perspective on the uses of these controls, and
ultimately, more knowledge so I can (hopefully) become a better developer.

Thanks for your time,
Mike

"Kevin Spencer" wrote:
No flame here, Michael,

I'm not sure what you mean by "way more space" to begin with. Do you mean
code that is compiled? If so, your perception is flawed. I can only imagine
the amount of programming code in the source for the DataGrid control.
However, I can imagine that it's quite large.

As for efficiency, what sort of efficiency are we talking about here?

One of the properties of object-oriented programming is that classes take
awhile to write, but when designed well, can be re-used in many ways
(ploymorphism). That is something you just can't do with ASP.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.

"MichaelY" <Mi******@discussions.microsoft.com> wrote in message
news:6E**********************************@microsof t.com...
Ok...I'm gonna regret this...but here goes....(promise I'm not trolling)

After several years of using the provided ASP.NET data display controls
(DataGrids, Repeaters, and now the GridView amoung others), I cannot deny
that there is an ENORMOUS amount of functionality crammed into these
controls
- kudos to MS!!!

However, more and more, I have been encountering situations where I need
EXPLICIT control over the rendered HTML in a grid display scenario (custom
client side JS libraries, app/company wide CSS stylings, etc).

In one example, my datasource is an XmlDocument - so naturally, the
XmlDataSource is to the rescue. However, the XmlDocument is
'incomplete' -
it only contains 'keys' (Guids) that require translating into the
appropriate
column / field heading / text (the table columns are dynamically definable
in
this app, and this lookup information is cached seperately), and it is NOT
in
the 'correct' format for simple binding to work (tag attribute model).
Ok,
so we hook into the appropriate OnDataItemBound event and modifiy the
rows/columns directly, adding our own controls as we go (way more involved
for Xml binding). Also, we need to wire up some client-side 'nice' events
to
allow row-mouseover highlighting, click to select a row and disply in a
details frame (IFRAME - no postback, please), and possibly adjust some
client-side globals for behavior control, and also be sure that the cells
do
NOT wrap - all of which is possible.

Problem is, in the end, I end up with slick page(s), some nice helper
classes and powerful abilities that, well, take up WAAAAY more space than
me
just redering my grids 'manually', a la classic ASP. I know this is (and
has
been) a heated debate since the beginning, but is this a valid option when
the need arises??? It seems to be discounted quickly amoung many, but if
efficiency is key, why (in these situations) would I want to support 2 - 3
times the code???

Flame suit on, advice appreciated...

mike


Nov 19 '05 #3

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

Similar topics

3
by: TPhelps | last post by:
I have a sample of an unbound (autogeneratecolumns is true) sortable/pagable datagrid that works. I want to change one of the columns to a hyperlink. The examples I find use a bound column. I...
6
by: Scott McDaniel | last post by:
I'm using Visual Studio 2005 with the .NET 2.0.50727 framework, and we're using the standard Datagrid control bound to a SQL Server. We have two groups of users - "full edit" users, and "view...
3
by: Alex Maghen | last post by:
I'd like there to be a border around each row of my data-grid but NOT between the columns. I've tried setting BorderColor="Black" BorderStyle="Solid" BorderWidth="1px"...
6
by: GaryDean | last post by:
I liked the DataGrid because I was familiar in walking through it to do custom filling and retrieval of data in cases where standard binding wouldn't do the job. I read somewhere that the object...
2
by: Mike Baugh | last post by:
I am using visual studio 2005 to develop a form using c# I have 3 datagrids on one form. I can set the row color based on a certain value in a column. However this color applies to all 3...
7
by: GaryDean | last post by:
I am writing a method in a component that gets passed a 1.1 Datagrid. The datagrid's columns were created at run time meaning it has no columns collection. How can I access Header and Footer...
5
by: rcoco | last post by:
Hi, I'm working on a asp.net project with a datagrid. I want the user to be adding data into Sql database using the datagrid. So I'm using a ListBox to do this and edit update and delete. I placed...
6
by: rcoco | last post by:
Hi, I have a datagrid that is ment to insert data. But when I run the form only the header appears. I would like some advise from you all and solve this problem I'm using visual studio 2003. My...
7
by: =?Utf-8?B?cGF0cmlja2RyZA==?= | last post by:
Hi all! I have a gridview inside a datagrid (nested) for which (gridview) the rowcommand is not raised in order to delete a row from the grid! I also tried OnRowCommand="method", didn't work...
7
by: Mark B | last post by:
Can someone write some VB.Net example code for me that does this: 1) Creates a gridview control with the results of a SQL stored procedure that has 1 parameter (text) 2) Adds an extra column...
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.