473,748 Members | 10,539 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

WebCustomContro l 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 WebCustomContro l 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 1601
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.dotne t.framework.asp net

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.goo glegroups.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 WebCustomContro l 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
7929
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 header of the datagrid in the "ItemDataBound" method of the grid. However, once, they are added in the grid, i seem to lose the event handler for the same control. Is there anyone who has tried this before and knows why this is hapenning ??
1
4337
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 (watch the layout, some have child controls):
1
1279
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
1490
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 can't do it. Somebody konw how can I do that? Thanks
5
1282
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 the properties of each MyItem in MyCollection I need set a special ID to each property of MyItem, and for this, I need access to my principal class, but... each item of MyCollection is created at desing time... i can't pass an object as argument...
3
1273
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? System.Web.UI.WebControls.ImageButton can determine the location of the mouse relative to its origin. The 'tooltip' event can determine when the mouse is above the control.
2
6412
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
5687
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 database. So all the even rows would be from database one. All the odd rows would be from database two. Row one and two will have different formats and colors.
1
1436
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) { Session = dropDownListSort1.SelectedValue;
0
8991
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
8831
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
9548
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...
0
9374
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9325
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
8244
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4607
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
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.