Consider the following code. List files = new List (); .... while (reader.Read()) { var a = new MyFiles { FileName = reader["Filename"].ToString(), FileLocation = reader["Filelocation"].ToString(), FullPath = FileLocation + @"\" + FileName // Error at this line }; files.Add(a); } The above is a snippet from my method which uses SqlDataReader to fetch data from the database. Everything works fine expect when I try to assign value to FullPath property I get the following error message: An object reference is required for the non-static field, method, or property 'MyFiles.FileLocation' An object reference is required for the non-static field, method, or property 'MyFiles.FileName' I know I can make those properties static or create an instance and access them via e.g. var b = new MyFiles(); b.FileLocation .. But my question is why can't I use FileLocation and FileName as I am in t...
Is there a way to have a fullscreen row with elements on Android? I tried to do it with table, GridView and linear, but I'm struggling with it since quite a time now and couldn't find a post that helped me. I just made a small picture of what I'd like to do: http://i.imgur.com/W0oTyaC.png In short point: Label and Button should just be as big as their content and fit to the biggest label in the column The button should stick on the right side The label should stick on the left side The textbox should just fill the leftover space between label/button, but in the case of bigger content, it shouldn't "kick out" the button on the right... My last try was the GridView, which looks a kind of acceptable, but not really. EDIT: The ConstraintLayout did a quite good job for my purpose - thanks for good hint ...