Monday, March 26, 2012

Setting RowSpan during run time in aspx file

I need necessarily set RowSpan(ColSpan) property of cell in aspx file(not in
cs file).
But below statement does not work :(.
Any idea ?

<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300" border="1"
runat="server">
<TR>
<TD RowSpan="<%# 3 %>">a</TD>
<TD>a</TD>
<TD>a</TD>
</TR>
<TR>
<TD>a</TD>
<TD>a</TD>
</TR>
<TR>
<TD>a</TD>
<TD>a</TD>
</TR>
</TABLE
Thanks in advance

Gawel
----------
Pierwszy yk z pucharu nauk przyrodniczych czyni ateist, ale na dnie
pucharu czeka Bg.
Werner HeisenbergTry doing something like this:

<td id=tdRow runat=server>a</td
then in your codebehind, you can set any of the properties of that TD.

"Gawel" <gawelek@.SPAMIKgazeta.pl> wrote in message
news:uqiXmKmTEHA.3368@.TK2MSFTNGP11.phx.gbl...
> I need necessarily set RowSpan(ColSpan) property of cell in aspx file(not
in
> cs file).
> But below statement does not work :(.
> Any idea ?
> <TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300" border="1"
> runat="server">
> <TR>
> <TD RowSpan="<%# 3 %>">a</TD>
> <TD>a</TD>
> <TD>a</TD>
> </TR>
> <TR>
> <TD>a</TD>
> <TD>a</TD>
> </TR>
> <TR>
> <TD>a</TD>
> <TD>a</TD>
> </TR>
> </TABLE>
>
> Thanks in advance
>
> Gawel
> ----------
> Pierwszy yk z pucharu nauk przyrodniczych czyni ateist, ale na dnie
> pucharu czeka Bg.
> Werner Heisenberg
> Try doing something like this:
> <td id=tdRow runat=server>a</td>
> then in your codebehind, you can set any of the properties of that TD.

Unfortunately, I can NOT use codebehind(cs) files. :(

Gawel

> > I need necessarily set RowSpan(ColSpan) property of cell in aspx
file(not
> in
> > cs file).
> > But below statement does not work :(.
> > Any idea ?
> > <TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300"
border="1"
> > runat="server">
> > <TR>
> > <TD RowSpan="<%# 3 %>">a</TD>
> > <TD>a</TD>
> > <TD>a</TD>
> > </TR>
> > <TR>
> > <TD>a</TD>
> > <TD>a</TD>
> > </TR>
> > <TR>
> > <TD>a</TD>
> > <TD>a</TD>
> > </TR>
> > </TABLE>
> > Thanks in advance
> > Gawel
> > ----------
> > Pierwszy yk z pucharu nauk przyrodniczych czyni ateist, ale na dnie
> > pucharu czeka Bg.
> > Werner Heisenberg
Try doing something like this:

<td id=tdRow runat=server>a</td
then in your codebehind, you can set any of the properties of that TD.

"Gawel" <gawelek@.SPAMIKgazeta.pl> wrote in message
news:uqiXmKmTEHA.3368@.TK2MSFTNGP11.phx.gbl...
> I need necessarily set RowSpan(ColSpan) property of cell in aspx file(not
in
> cs file).
> But below statement does not work :(.
> Any idea ?
> <TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300" border="1"
> runat="server">
> <TR>
> <TD RowSpan="<%# 3 %>">a</TD>
> <TD>a</TD>
> <TD>a</TD>
> </TR>
> <TR>
> <TD>a</TD>
> <TD>a</TD>
> </TR>
> <TR>
> <TD>a</TD>
> <TD>a</TD>
> </TR>
> </TABLE>
>
> Thanks in advance
>
> Gawel
> ----------
> Pierwszy yk z pucharu nauk przyrodniczych czyni ateist, ale na dnie
> pucharu czeka Bg.
> Werner Heisenberg
> Try doing something like this:
> <td id=tdRow runat=server>a</td>
> then in your codebehind, you can set any of the properties of that TD.

Unfortunately, I can NOT use codebehind(cs) files. :(

Gawel

> > I need necessarily set RowSpan(ColSpan) property of cell in aspx
file(not
> in
> > cs file).
> > But below statement does not work :(.
> > Any idea ?
> > <TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300"
border="1"
> > runat="server">
> > <TR>
> > <TD RowSpan="<%# 3 %>">a</TD>
> > <TD>a</TD>
> > <TD>a</TD>
> > </TR>
> > <TR>
> > <TD>a</TD>
> > <TD>a</TD>
> > </TR>
> > <TR>
> > <TD>a</TD>
> > <TD>a</TD>
> > </TR>
> > </TABLE>
> > Thanks in advance
> > Gawel
> > ----------
> > Pierwszy yk z pucharu nauk przyrodniczych czyni ateist, ale na dnie
> > pucharu czeka Bg.
> > Werner Heisenberg
try:

<TD RowSpan="<%=varOrFunctionCall %>">a</TD
"Gawel" <gawelek@.SPAMIKgazeta.pl> wrote in message
news:uqiXmKmTEHA.3368@.TK2MSFTNGP11.phx.gbl...
> I need necessarily set RowSpan(ColSpan) property of cell in aspx file(not
in
> cs file).
> But below statement does not work :(.
> Any idea ?
> <TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300" border="1"
> runat="server">
> <TR>
> <TD RowSpan="<%# 3 %>">a</TD>
> <TD>a</TD>
> <TD>a</TD>
> </TR>
> <TR>
> <TD>a</TD>
> <TD>a</TD>
> </TR>
> <TR>
> <TD>a</TD>
> <TD>a</TD>
> </TR>
> </TABLE>
>
> Thanks in advance
>
> Gawel
> ----------
> Pierwszy yk z pucharu nauk przyrodniczych czyni ateist, ale na dnie
> pucharu czeka Bg.
> Werner Heisenberg
> try:
> <TD RowSpan="<%=varOrFunctionCall %>">a</TD
Unfortunaltely it does not work :(.
For:
<TD RowSpan="<%=3 %>">a</TD>
I got run time error:
<%=3%> is not a valid value for Int32.

Gawel

> > I need necessarily set RowSpan(ColSpan) property of cell in aspx
file(not
> in
> > cs file).
> > But below statement does not work :(.
> > Any idea ?
> > <TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300"
border="1"
> > runat="server">
> > <TR>
> > <TD RowSpan="<%# 3 %>">a</TD>
> > <TD>a</TD>
> > <TD>a</TD>
> > </TR>
> > <TR>
> > <TD>a</TD>
> > <TD>a</TD>
> > </TR>
> > <TR>
> > <TD>a</TD>
> > <TD>a</TD>
> > </TR>
> > </TABLE>
> > Thanks in advance
> > Gawel
> > ----------
> > Pierwszy yk z pucharu nauk przyrodniczych czyni ateist, ale na dnie
> > pucharu czeka Bg.
> > Werner Heisenberg
I found the solution.
Below statemant works great but one MUST invoke any DataBind() method. It
can
be even this embedded in Page class.

TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300"
runat="server">
<TR>
<TD RowSpan="<%# 3 %>">a</TD>
<TD>a</TD>
<TD>a</TD>
</TR>
<TR>
<TD>a</TD>
<TD>a</TD>
</TR>
<TR>
<TD>a</TD>
<TD>a</TD>
</TR>
</TABLE
Gawel

0 comments:

Post a Comment