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