This is a migrated thread and some comments may be shown as answers.

date time format

1 Answer 133 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 28 Jan 2013, 11:42 PM
I'm trying to display the value of a datetime in a testbox, and I want to vary the format based on a grouping parameter, so I use a binding like this to the format:

=Iif(Parameters.DateGroupFlag.Value = 1, "{0:Y}", Iif(Parameters.DateGroupFlag.Value = 2, "{0:d}", Iif(Parameters.DateGroupFlag.Value = 3, "{0:Y}", Iif(Parameters.DateGroupFlag.Value = 4, "{Y}", Iif(Parameters.DateGroupFlag.Value = 5, "{0:t}", Iif(Parameters.DateGroupFlag.Value = 6, "{0:t}", Iif(Parameters.DateGroupFlag.Value = 7, "{0:Y}", "{0:Y}")))))))

and this basically works, but I don't see how I can handle two special cases.
One is to display the year(eg "2013") only, and the other is to display the day only("Thursday").
Any ideas welcome

1 Answer, 1 is accepted

Sort by
0
Joe
Top achievements
Rank 1
answered on 30 Jan 2013, 08:28 AM
the answer is code something like this:

private void textBox3_ItemDataBound(object sender, EventArgs e)
        {
                Telerik.Reporting.Processing.TextBox testBox = (Telerik.Reporting.Processing.TextBox)sender;
                testBox.Value = ((DateTime)testBox.Value).DayOfWeek.ToString();
        }
Tags
General Discussions
Asked by
Joe
Top achievements
Rank 1
Answers by
Joe
Top achievements
Rank 1
Share this question
or