use 'if'

9 posts, 0 answers
  1. Błażej
    Błażej avatar
    11 posts
    Member since:
    Jun 2011

    Posted 15 Jul 2011 Link to this post

    Hi,

    I want to use 'if' in value of textbox item.
     It's possible ?
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 15 Jul 2011 Link to this post

    Hello Błażej,

    The available functions that you can use in Expression are listed in the Functions help article. For your case you can use the IIf(expression, ReturnedIfTrue, ReturnedIfFalse).

    Greetings,
    Steve
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. Błażej
    Błażej avatar
    11 posts
    Member since:
    Jun 2011

    Posted 15 Jul 2011 Link to this post

    can you help me ?
    I've got two int getting from DataBase ...
    if (secondInt == NULL )
    textbox.value = firstInt / SecondInt ;
    else
    textbox.value = firstInt ;

    Please give some example .
  4. Błażej
    Błażej avatar
    11 posts
    Member since:
    Jun 2011

    Posted 15 Jul 2011 Link to this post

    I didn't see your answer ...
    thanks !
  5. Michel
    Michel avatar
    2 posts
    Member since:
    Aug 2012

    Posted 23 Aug 2012 Link to this post

    try:
    =IIF(Fields.secondInt, firstInt / SecondInt, firstInt)
  6. Anil
    Anil avatar
    1 posts
    Member since:
    May 2014

    Posted 09 May 2014 in reply to Michel Link to this post

    Hi,

    I am very much new to Telerik, im using the condition for a textbox value expression

    =Iif(Parameters.UnitType.Value == "some string", some_value1, some_value2)

    And this is giving an error.
    not valid:
    Syntax error: Missing operand before '=' operator

     Kindly let me know where i am going wrong.
  7. Nasko
    Admin
    Nasko avatar
    1049 posts

    Posted 12 May 2014 Link to this post

    Hello Anil,

    The comparison operator for equality is a "=" sign. Try changing the expression to:

    =Iif(Parameters.UnitType.Value = "some string", some_value1, some_value2)

    For more information, please refer to the Expression Operators help article.

    Regards,
    Nasko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  8. Madelein
    Madelein avatar
    2 posts
    Member since:
    Jul 2014

    Posted 29 Jul 2014 Link to this post

    Hello,

    i've got a description field in my report and now i want to highlight the line any of the predefined descriptions comes up in the report.  This is what i've got... please help me as i do not know how further to change my Expression to set the background if the Expression returns true:

    iIF((Fields.PADESC Like "A SA RH SE SH BLD%")  Or ( Fields.PADESC Like ="A SA LH SE SH BLD%") Or ( Fields.PADESC Like ="XYZ%") Or ( Fields.PADESC Like ="ABC%")) *Then change backround to yellow* 
  9. Nasko
    Admin
    Nasko avatar
    1049 posts

    Posted 01 Aug 2014 Link to this post

    Hello Madelein,

    The described scenario can be achieved with the Conditional Formatting functionality. Conditional formatting lets you dynamically style report items based on rules that you define in the Conditional Formatting Rules Dialog. For more information on how to use this functionality, please refer to the Conditional Formatting help article.

    Regards,
    Nasko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top