473,387 Members | 2,436 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,387 software developers and data experts.

Poor Design Time Support for DataBinding in Custom Controls

Has anyone else noticed that the design-time support for databinding in custom controls in ASPNET2 sucks? At least for GridViews? So
far I've spent going on two days trying to get the following simple statements to actually generate something at design-time:

gridView = new GridView();
gridView.AutoGenerateColumns = true;

gridView.DataSource = [a List<of simple objects exposing three dummy string properties];
gridView.DataBind();

I have tried everything I could think of, or read about in four books on custom control design and what must amount to a couple of
hundred pages of google results. This includes changing when in the control life-cycle the binding code gets executed, trying
different kinds of datasources (including simple arrays of the dummy data objects, custom DataTables built on-the-fly), manually
generating the columns, subclassing GridView and writing custom designers to interact with the GridView more closely at design-time,
and about a thousand other things I won't bother to list. I think by this point I could load my testbed website in a separate
running-under-the-debugger instance of VS2005 in my sleep.

Nothing works. No rows are created. No exceptions are generated. Just deafening silence.

This is unacceptable. When I issue a simple (from the developer perspective) command like that, >>something<< has to happen. Either
the bind takes place, or an exception gets raised about why the bind didn't take place. That could be optional (something like
gridView.DataBind(bool TellMeIfSomethingGoesWrong)), but >>something needs to happen<<.

I presume the approach for doing databinding at design-time must be radically, fundamentally different from how you do it at
run-time. I have never had a problem getting GridViews to bind at run-time, whether implicitly through DataSourceIDs, or explicitly
through the set DataSource/DataBind() construct.

But if it is radically different it needs to be documented! So far as I can tell, it is not. Which, for any 'Softies out there,
makes me a very unhappy customer.

The favor of a quick reply from Microsoft is greatly anticipated.

- Mark
Feb 17 '07 #1
1 1726
Howdy,

For me it's obvious they didn't want full code compatibility at design time.
To make everything work, entire application would have to be compiled which
would be very slow. Your example it's very simple, but imagine what would
happen in real life scenarios, where application is complex, data retrival is
time consuming. Would it be confortable to work in such enviroment? :)

Best regards
--
Milosz
"Mark Olbert" wrote:
Has anyone else noticed that the design-time support for databinding in custom controls in ASPNET2 sucks? At least for GridViews? So
far I've spent going on two days trying to get the following simple statements to actually generate something at design-time:

gridView = new GridView();
gridView.AutoGenerateColumns = true;

gridView.DataSource = [a List<of simple objects exposing three dummy string properties];
gridView.DataBind();

I have tried everything I could think of, or read about in four books on custom control design and what must amount to a couple of
hundred pages of google results. This includes changing when in the control life-cycle the binding code gets executed, trying
different kinds of datasources (including simple arrays of the dummy data objects, custom DataTables built on-the-fly), manually
generating the columns, subclassing GridView and writing custom designers to interact with the GridView more closely at design-time,
and about a thousand other things I won't bother to list. I think by this point I could load my testbed website in a separate
running-under-the-debugger instance of VS2005 in my sleep.

Nothing works. No rows are created. No exceptions are generated. Just deafening silence.

This is unacceptable. When I issue a simple (from the developer perspective) command like that, >>something<< has to happen. Either
the bind takes place, or an exception gets raised about why the bind didn't take place. That could be optional (something like
gridView.DataBind(bool TellMeIfSomethingGoesWrong)), but >>something needs to happen<<.

I presume the approach for doing databinding at design-time must be radically, fundamentally different from how you do it at
run-time. I have never had a problem getting GridViews to bind at run-time, whether implicitly through DataSourceIDs, or explicitly
through the set DataSource/DataBind() construct.

But if it is radically different it needs to be documented! So far as I can tell, it is not. Which, for any 'Softies out there,
makes me a very unhappy customer.

The favor of a quick reply from Microsoft is greatly anticipated.

- Mark
Feb 17 '07 #2

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

Similar topics

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....
4
by: waltborders | last post by:
Hi, Because the blind are unable to use a mouse, keyboard navigation is key. A major difficulty is that not all windows forms controls are keyboard 'tab-able' or 'arrow-able' or have "tab...
17
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
0
by: onyxring | last post by:
I'm reposting this, because I had a bit of difficulty last time and think that it might have fallen through the cracks. If I'm posting to the wrong groups, please let me know. Surely someone has...
3
by: George Jordanov Ivanov | last post by:
Folks, I am implementing a WebUserControl, which will have its own custom event StateChanged. Now, I want to add this event to the Events tab in the control properties, so that the users of my...
0
by: Brant Estes | last post by:
So try this. Create a new ASP.NET 2.0 website. Add a theme. Add a skin to the theme. In your web.config, add the <pages theme="MyTheme" styleSheetTheme="MyTheme" /tag under your system.web...
4
by: Mark Olbert | last post by:
I've written a composite custom control which I would like to have update its design-time display when one of several properties changes at design time. These custom properties are not simply the...
4
by: Ken Fine | last post by:
I've been living with a frustrating issue with VS.NET for some months now and I need to figure out what the problem is. Hopefully someone has run into the same issue and can suggest a fix. I...
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:
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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...

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.