This topic is locked

"View as" custom issue

9/27/2021 5:20:54 PM
ASPRunner.NET General questions
M
MikeM author

Hello,

When I try to use the "data" array to customize the display for a field, only the currently selected field returns a value. Per the example in the docs where two different field name calls are used to populate the value variable, I tried to populate the display for column WeekStartDate by concatenating data["WeekStartDate"] + " - " + data["WeekEndDate"]. This only returns '[value of WeekStartDate] -'. Trying to have the WeekStartDate column display just data["WeekEndDate"] or any other data field specified in the query returns empty text. I have been able to work around it by doing some C# datetime calculations to get the end of the week based on the WeekStartDate value and building the custom display string that way but just wondering if this is a bug or if I am missing something.

Thanks,
Mike
Build 37815 x64

Pete K 9/27/2021

Not sure if this is the issue, but I have had problems in the past with using the "+" operator to conatenate fields. Try adding ".ToString()" to each, as in data["WeekStartDate"].ToString() + " - " + data["WeekEndDate"].ToString().

M
MikeM author 9/28/2021

Thanks for the reply, Pete. I do use the .ToString() function when printing out the content. The problem does not seem to be the concatenation.

value = data["WeekStartDate"].ToString() + " - " + data["WeekEndDate"].ToString() // This is the custom display for data["WeekStartDate"]

results in

09/27/2021 -
09/20/2021 -
09/13/2021 -
...

Using just

value = data["WeekEndDate"].ToString() // This is the custom display for data["WeekStartDate"]

results in blank cells.

Pete K 9/28/2021

Sorry, I can't think of anything else. I have used this syntax in the custom area many times myself and can verify that it should work. This probably calls for a support request.