Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6787965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:25:43+00:00 2026-05-26T17:25:43+00:00

I have two GridViews layed out side by side. The first GridView contains variable

  • 0

I have two GridViews layed out side by side.

The first GridView contains variable objects, in this case some EditTexts, depending on the game mode.

The second GridView contains TextViews that label the rows.

Because I use the first GridView for many different things, I have been creating the EditText objects programmatically. However, I am having a hard time getting their size to match up with the EditText row markers.

1) Should I be constructing my EditText objects in xml (and if so, where would I put it, and what properties would I have to set) ?

2) If programmatically creating the EditTexts is ok, how can I resize them through code to line up with the row numbers?

view from the emulator

After loading the GridView’s objects from the layout recommended below, I am given a ClassCastException complaining about LayoutParams:

public View getView(int position, View convertView, ViewGroup parent) {
            EditText textbox;
            View MyView = convertView;
            if (convertView == null) {

                LayoutInflater li = getLayoutInflater();
                MyView = li.inflate(R.layout.edittextfull, null);
                textbox = (EditText) MyView.findViewById(R.id.textbox);

            }
            else 
                textbox = (EditText) convertView;
            return textbox;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:25:44+00:00Added an answer on May 26, 2026 at 5:25 pm

    Here is your row

    <LinearLayout android:layout_width="fill_parent"
                      android:layout_height="wrap_content" >
                    <EditText android:layout_width="wrap_content"
                             android:layout_height="wrap_content"
                             android:layout_gravity="center_vertical"
                             android:layout_weight="1"
                     />
                     <TextView  android:layout_width="wrap_content" 
                            android:layout_height="wrap_content"
                            android:layout_gravity="center_vertical"
                            android:text="row 1"
                     />              
        </LinearLayout>
    

    to use xml is always better . so avoid creating view pragmatically until its the only way .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two GridViews that list out included and exclude data items respectively. By
I having issues exporting a GridView to Excel for some reason. I have two
I have two GridViews. One is Source GridView and another one is Destination GridView.
I have two GridViews, the first works fine as I defined the datasource when
I have two web pages- the first is a GridView and the second is
I am currently designing a master detail gridview. I have two separate objects defined
I have some wpf gridviews(presenting only two here) <igDP:XamDataGrid x:Name=dgSummary GroupByAreaLocation=None ScrollingMode=Immediate HorizontalAlignment=Stretch VerticalAlignment=Stretch
I have two cascading dropdowns and one gridview control. on page load iam binding
I have a gridview that displays items details, I added two template fields one
I have ListView that uses a GridView to display several columns of data. Two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.