Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > update control in table

Reply
Thread Tools

update control in table

 
 
miguel.ossa
Guest
Posts: n/a
 
      01-26-2004
Hi to all!

I've created a table with n x n elements, in the way:

imagen = Array.CreateInstance( typeof(HtmlInputImage), nFilas,
nColumnas);
Panel1.Height = nColumnas * 15 + 2;
for (int j=0; j<nFilas; j++)
{
HtmlTableRow r = new HtmlTableRow();
r.BgColor="Gainsboro";
r.Height = "15";
for (int i=0; i<nColumnas; i++)
{
HtmlTableCell c = new HtmlTableCell();
HtmlInputImage image = new HtmlInputImage();
image.Src = "images/tapada.jpg";
image.ServerClick += new
ImageClickEventHandler(Imagen_ServerClick);
imagen.SetValue(image, j, i);
c.Controls.Add((HtmlInputImage)imagen.GetValue(j, i));
c.Height = "15";
r.Cells.Add(c);
}
Table2.Rows.Add(r);
}

The name of the image has to change if the user clicks on it. If the
images changes, I don't need anymore the event handling. I want to
change the image and deassing the handler.

for (int i=0; i<nFilas; i++)
{
// TODO: recreación de las imágenes según estado de cada casilla
for (int j=0; j<nColumnas; j++)
{
if (tablero.casilla(i,j) != tablero_old.casilla(i,j))
{
HtmlInputImage image = new HtmlInputImage();
image = (HtmlInputImage)Table2.Rows[i].Cells[j].Controls[0];
if (tablero.casilla(i,j) ==
TableroBuscaminas.EstadoCasilla.Vacia)
{
image.Src = "images/destapada.jpg";
image.ServerClick -= new
ImageClickEventHandler(Imagen_ServerClick);
}
}
}
}

Doing like above, I change the image, but I need also to update it
again in the table.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update unable to find TableMapping['Table'] or DataTable 'Table' in c# sqlserver Nishanth Software 0 11-09-2009 09:58 AM
html table control vs web table control Geary ASP .Net 2 07-12-2007 12:12 AM
please help with optimisation of this code - update of given table according to another table Farraige Python 4 11-08-2006 07:58 PM
Table/table rows/table data tag question? Rio HTML 4 11-05-2004 08:11 AM
Could not load type VTFixup Table from assembly Invalid token in v-table fix-up table. David Williams ASP .Net 2 08-12-2003 07:55 AM



Advertisments