D
Danny Tuppeny
Hi all,
I've got a DataList that's bound to a datasource with two columns (well, two
that matter). One is called GigDate, and one is called RescheduledFromDate.
GigDate doesn't allow NULLs, but the RescheduledFromDate does. In general,
only a GigDate will be supplied, but if a Gig is rescheduled, the GigDate is
copied to RescheduledFromDate, and the GigDate then becomes the "new" date.
I'm using a DataList instead of a Grid because it's slightly more flexible
for the design (I'm using several rows to display each record).
What I'd like to display is something like this
---- If a gig has NOT been rescheduled ----
Gig Date: xx/yy/zz
---- / ----
---- If a gig HAS not been rescheduled ----
Gig Date: xx/yy/zz
(rescheduled from xx/yy/zz)
---- / ----
I can see a few ways to do this, but I don't like the ones I've managed to
get working. One is to have a label bound to RescheduledFromDate, with
Visible bound to an expression checking for null. However, this means the
Text property has to be a custom expression too. To keep the label Text
property bound to the field directly, I could have another two labels for
the text, with the Visible properties set to the same as the
RescheduledFromDate field (one containing "(rescheduled from " and the other
just ")").
Neither of these are particularly great, and I can see instances when they'd
work even less well! (eg, if I needed an image to be displayed, as well)
What I'd *like* to do, is something like a PlaceHolder, with Visible bound
to an expression checking if the field is null, and then place literal text,
and a bound label inside.
I've tried using the PlaceHolder control, but I don't see to be able to put
anything inside it in the designer. A panel might work, but I believe this
renders out as a Table or something, and I don't want anything that pollutes
the markup unnecessarily.
I'm sure I'm missing something simple. Any offers?
Thanks!
Danny Tuppeny
I've got a DataList that's bound to a datasource with two columns (well, two
that matter). One is called GigDate, and one is called RescheduledFromDate.
GigDate doesn't allow NULLs, but the RescheduledFromDate does. In general,
only a GigDate will be supplied, but if a Gig is rescheduled, the GigDate is
copied to RescheduledFromDate, and the GigDate then becomes the "new" date.
I'm using a DataList instead of a Grid because it's slightly more flexible
for the design (I'm using several rows to display each record).
What I'd like to display is something like this
---- If a gig has NOT been rescheduled ----
Gig Date: xx/yy/zz
---- / ----
---- If a gig HAS not been rescheduled ----
Gig Date: xx/yy/zz
(rescheduled from xx/yy/zz)
---- / ----
I can see a few ways to do this, but I don't like the ones I've managed to
get working. One is to have a label bound to RescheduledFromDate, with
Visible bound to an expression checking for null. However, this means the
Text property has to be a custom expression too. To keep the label Text
property bound to the field directly, I could have another two labels for
the text, with the Visible properties set to the same as the
RescheduledFromDate field (one containing "(rescheduled from " and the other
just ")").
Neither of these are particularly great, and I can see instances when they'd
work even less well! (eg, if I needed an image to be displayed, as well)
What I'd *like* to do, is something like a PlaceHolder, with Visible bound
to an expression checking if the field is null, and then place literal text,
and a bound label inside.
I've tried using the PlaceHolder control, but I don't see to be able to put
anything inside it in the designer. A panel might work, but I believe this
renders out as a Table or something, and I don't want anything that pollutes
the markup unnecessarily.
I'm sure I'm missing something simple. Any offers?
Thanks!
Danny Tuppeny