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

WebCustomControl or DataGrid

Hello All,

As a VB6/C/C++ (and some Java) developer, I've been toying with c# for
the last couple of weeks. I'm currently trying to create a grid of 3x3
with each cell containing numbers from 1 to 9. The idea is that if you
push one of the numbers, it gets 'blown up' to the full size of the
control, hiding all the other ones. It should also be possible to
enable/disable some cells in the grid through calling a method.

I've actually managed to do all this in a "Web User Control". I used 9
textboxes because I found it to be impossible (?) to use the datagrid
control without an automated datasource. Furthermore I suspected that a
datagrid wouldn't give me the option of disabling/enabling cells at
will.

I'm sad to say I was very disappointed with the build-up speed of my
website using these controls (I have to use a 9x9 grid of them) and
worst of all they didn't work at all in Firefox!

I would appreciate it very much if anyone can point me in the right
direction here about what's the best thing to do, should I:

1) Get rid of the textboxes and use some sort of grid-control to
improve build-up speed
2) Use a WebCustomControl and generate some HTML myself (for build-up
speed and Firefox compatibility)
3) Create a datasource and link it to the DataGrid
4) ???

In case 2) I would be totally lost about how to store the values
selected.

I'm not expecting 'free code', just some pointers showing me 'the right
way of doing things'. After all, this is meant as a personal study
project :)

--
TIA, Dave

Nov 17 '05 #1
2 1571
Okay, by the second paragraph I figured out that you're talking about
ASP.Net. Honestly, you'll get better answers on ASP.Net in the ASP.Net
newsgroup:

microsoft.dotnet.framework.aspnet

The reason for this is that ASP.Net is all about HTML and web sites. It is,
in fact, one of the more difficult .Net technologies to master, as it
involves understanding HTML, XML, HTTP and associated stateless issues, IIS,
JavaScript, SOAP, and a number of other web-related technologies.

Just HTML alone is problematic, as you've discovered. Every flavor of web
browser handles HTML differently, and the rules for HTML are complex, to put
it mildly. If you rely on Visual Studio.Net 2003 to write your code for you
straight out of the box, be prepared for it to work best (and possibly only)
in IE.

But, as I happen to be fairly skilled in the ASP.Net department, I'll handle
your question.

Your requirements as stated are relatively simple (although I suspect
there's more to it):

You want a "grid" of 9 cells, 3X3, with numbers 1 - 9. when a cell is
clicked, you want it to expand to the full table size, and "hide" the other
members of the table. And you want to be able to disable cells.

So, knowing HTML, ti sounded an awful lot like a table to me. Of course,
there's no "onclick" event on a table cell, but there is on a button. So,
you use a Table WebServer Control, which gives you the ability to manipulate
the cells and rows of the table in your CodeBehind. You put Button
WebControls into the table, and use their styles to make them fill the
entire cell, and look how you want them to. I would recommend using an
external Style Sheet for this aspect. In fact, you shouldn't need to set the
size of the table, rows, or cells at all, as the buttons will cause the
table to expand.

Now you have control over which buttons are enabled disabled, and you can
show or hide buttons at will. If you don't set any sizes for the table, and
us zero-width borders, cellspacing and cellpadding, hiding all of the
buttons in a row or column will effectively make that column disappear. Use
the click event of the buttons to manage this.

I'll leave the rest up to you to figure out.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

<ne**@pro-it.be> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hello All,

As a VB6/C/C++ (and some Java) developer, I've been toying with c# for
the last couple of weeks. I'm currently trying to create a grid of 3x3
with each cell containing numbers from 1 to 9. The idea is that if you
push one of the numbers, it gets 'blown up' to the full size of the
control, hiding all the other ones. It should also be possible to
enable/disable some cells in the grid through calling a method.

I've actually managed to do all this in a "Web User Control". I used 9
textboxes because I found it to be impossible (?) to use the datagrid
control without an automated datasource. Furthermore I suspected that a
datagrid wouldn't give me the option of disabling/enabling cells at
will.

I'm sad to say I was very disappointed with the build-up speed of my
website using these controls (I have to use a 9x9 grid of them) and
worst of all they didn't work at all in Firefox!

I would appreciate it very much if anyone can point me in the right
direction here about what's the best thing to do, should I:

1) Get rid of the textboxes and use some sort of grid-control to
improve build-up speed
2) Use a WebCustomControl and generate some HTML myself (for build-up
speed and Firefox compatibility)
3) Create a datasource and link it to the DataGrid
4) ???

In case 2) I would be totally lost about how to store the values
selected.

I'm not expecting 'free code', just some pointers showing me 'the right
way of doing things'. After all, this is meant as a personal study
project :)

--
TIA, Dave

Nov 17 '05 #2
Hello Kevin,
Okay, by the second paragraph I figured out that you're talking about
ASP.Net. Honestly, you'll get better answers on ASP.Net in the ASP.Net
newsgroup:
Thanks for pointing this out to me, it's a bit confusing since the code
behind the control is done in c# but the control itself is being used
on an ASP.Net page :)
But, as I happen to be fairly skilled in the ASP.Net department, I'll handle
your question.
Which I'm gratefull for!
I'll leave the rest up to you to figure out.


Thanks, this is exactly what I needed!

--
Thanks again, Dave

Nov 17 '05 #3

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

Similar topics

8
by: Ashish Shridharan | last post by:
Hi All I have been trying to add a control to the header cell of a datagrid on my ASP.NET page. These controls are defined in the HTML as ASP.NET web controls. They are being added into the...
1
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
1
by: Lars Netzel | last post by:
How do I set default values to the "default" properties, like Width, height, Visible, Backcolor... in a WebCustomControl that I'm developing? Best Regards/ Lars
1
by: Cristian | last post by:
Hi, I'm building a WebCustomControl, the principal class which inherits from WebControl has the property ViewState, and I want to access to the ViewState from other classes in my project, but I...
5
by: Arnold | last post by:
Hi, Im building a WebCustomControl. In my principal class (Inherits from WebControl), have a property of type MyCollection (Inherits from CollectionBase), which is a MyItem collection. To mantain...
3
by: Qwert | last post by:
Hello, if you have a WebCustomControl ( inherits from System.Web.UI.WebControls.WebControl ), how do you create an event that responses to the movement of the cursor above the control? ...
2
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
7
by: Dave | last post by:
Are there any add-on products or samples available that can do the following in an vb.net datagrid I want to compare 2 rows in a datagrid - one row from one database and another row for another...
1
by: Alexander Widera | last post by:
Hello, i have a webcustomcontrol (:CompositeControl) which is in an asp.net page which causes a postpack-event (ChangeSort). protected void ChangeSort(Object sender, EventArgs e) { ...
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?
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
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,...
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,...
0
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...

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.