Message 1 of 4
DatagridView error

Not applicable
04-21-2015
08:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This is my first time working with forms, I created a form with Datagrid and it has 3 columns Sheet_Num, Sheet_Discipline, and Sheet_Title_1. I am having an issue with accessing the datagrid from the form in my application programming. When i try accessing from thisForm i have warnings that says "'SheetCreator.Form1.Sheet_Discipline' is inaccessible due to its protection level (CS0122) -". It also is unable to access datagridview1 in the foreach statement. What does that mean? and how do i remove the protection level?
public void SheetCreator() { UIDocument uidoc = this.ActiveUIDocument; Document doc = uidoc.Document; string Sheetnum=""; string SheetDisc=""; string sheetTitle=""; string sheetname=""; using (Form1 thisForm = new Form1()) { thisForm.ShowDialog(); Sheetnum=thisForm.Sheet_Num(); SheetDisc=thisForm.Sheet_Discipline(); sheetTitle=thisForm.Sheet_Title_1(); sheetname= string.Concat(SheetDisc," ",sheetTitle); { foreach (DataGridViewRow row in thisForm.dataGridView1.Rows); Transaction t = new Transaction(doc, "Create Sheets"); t.Start(); ViewSheet sheet = ViewSheet.Create(Sheetnum,sheetname); t.Commit();