Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1380
Ultragrid has no contructor defined
posted

Hello,

this method returns error : Ultragrid has no contructor defined .inside else.How to return null row nothing inside else bracket.Thanks

 public UltraGridRow  CurrentQuestionRowGetter(int questionId,UltraGrid grid)
        {
            foreach (UltraGridRow row in grid.Rows)
            {
                if (row.Cells["QUESTION_ID"].Value.ToInt() == questionId)
                {
                    return row;
                }
                else
                {
                    return new  UltraGridRow();
                }
                
            }

        }

Parents
No Data
Reply
  • 53790
    Verified Answer
    posted

    Hello,

     

    Maybe you could try to use return null; instead of return new  UltraGridRow();

     

     

     

     public UltraGridRow CurrentQuestionRowGetter(int questionId, UltraGrid grid)

            {

               foreach (UltraGridRow row in grid.Rows)

                   {

                       if (Convert.ToInt32(row.Cells["QUESTION_ID"].Value) == questionId)

                           {

                             return row;

                }

                      else

                          {

                            return null;

                } 

                }

     return null;

     }

     

    Let me know if you have any questions

     

     

     

     

Children