This is a migrated thread and some comments may be shown as answers.

Data Form context And layout problems

1 Answer 30 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gokhan
Top achievements
Rank 1
Gokhan asked on 18 Feb 2016, 12:30 PM

Hi,

We are building a sample based on your documentation..

We are getting red on

1-context   (new RadDataForm(context);)

2- layout    (layout.addView(form);)

Project is extending an Activity. And using inside tab

What may cause these problems. Thanks

Here is the code..

 

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.app.Activity;

import com.telerik.widget.dataform.visualization.RadDataForm;

public class MalzemeAlimi extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {

       super.onCreate(savedInstanceState);

setContentView(R.layout.activity_malzeme_alimi);
RadDataForm form = new RadDataForm(context);
form.setEntity(new OurClass());

layout.addView(form);

    
   }


}

1 Answer, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 19 Feb 2016, 08:20 AM
Hi Gokhan,

Thank you for writing.
The context should be an instance of the Context class. Since Activity inherits from Context you can simply create your data form like so: new RadDataForm(this);

Regards,
Victor
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
DataForm
Asked by
Gokhan
Top achievements
Rank 1
Answers by
Victor
Telerik team
Share this question
or