473,856 Members | 1,560 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.AutoGe nerateColumns = true;

gridView.DataSo urce = [a List<of simple objects exposing three dummy string properties];
gridView.DataBi nd();

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.DataBi nd(bool TellMeIfSomethi ngGoesWrong)), 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 1751
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.AutoGe nerateColumns = true;

gridView.DataSo urce = [a List<of simple objects exposing three dummy string properties];
gridView.DataBi nd();

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.DataBi nd(bool TellMeIfSomethi ngGoesWrong)), 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
2777
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. The problem is the article is in VisualBasic. I already get the collection to be recognized as a Data Source by the IDE. It populated the DataGrid correctly from the fields on the items object of the collection, but I can't get the DataGrid to...
4
2988
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 order". The application is built and the next step is to create the custom JAWS (Freedom Scientific)screen reader script to read the application. The application uses the accessibility properties for controls provided by C#. JAWS reads properties...
17
2736
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 know nothing about ASP. He can build the design of the pages in HTML with tables, labels, textboxes etc. But then I would need to change them to ASP.net objects and write the code to make the page work (normally I do this as I go - can't do this...
7
3026
by: Shimon Sim | last post by:
I have a custom composite control I have following property
0
1402
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 some experience with this... I've been building custom web controls in C# with VS2005. Currently I'm looking into adding design-time functionality and have reached a point where I need to generate code in the page the custom control is on. ...
3
7812
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 control can set the event handler from this tab. However, I can't see my custom StateChanged event over there and I don't know what is the reason. Setting BrowsableAttribute to the public event property doesn't solve the problem. Any other ideas? ...
0
1236
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 node. Now, on a page, drag out any built in control, such as a label. Style/Skin it. The control will take the style of the theme at both runtime and in the designer. Cool! Now, create a custom server control (inherits from WebControl)....
4
2703
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 exposed properties of the constituent controls (e.g., they control how many constitutent controls are displayed). I am at a loss as to how to go about doing this. I have a custom designer for the control, but I don't see any functionality in the...
4
2478
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 suspect some permissions problem. I'm running VS.NET 2008 in Vista. Symptoms and observations: * ASP.NET's native ImageMap and Image controls work just fine and provide a design-time preview of images that are referenced via the ImageUrl property *...
0
9921
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9765
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11065
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10795
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10390
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7934
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7098
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4581
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.