Hi,
I am trying for a while now to figur out what I have wrong in setting up my 3 level relation. I keep getting an unspecified error if I try to open the 3rd level. Am I missing a little detail?
Karl
I am trying for a while now to figur out what I have wrong in setting up my 3 level relation. I keep getting an unspecified error if I try to open the 3rd level. Am I missing a little detail?
Karl
private
void
RadForm1_Load(
object
sender, EventArgs e)
{
this
.t_TagTableAdapter.Fill(
this
.pAS3DataSet.T_Tag);
this
.t_Lex_BegriffTableAdapter.Fill(
this
.pAS3DataSet.T_Lex_Begriff);
this
.t_G_GendreTableAdapter.Fill(
this
.pAS3DataSet.T_G_Gendre);
this
.MyFilmsTableAdapter.Fill(
this
.pAS3DataSet.MyFilms);
this
.t_GlossarTableAdapter.Fill(
this
.pAS3DataSet.T_Glossar);
GridViewComboBoxColumn myColumn =
new
GridViewComboBoxColumn();
myColumn.Name =
"Gendre"
;
myColumn.HeaderText =
"Gendre"
;
myColumn.DataSource =
this
.tGGendreBindingSource;
myColumn.ValueMember =
"G_GendreID"
;
myColumn.DisplayMember =
"DE"
;
myColumn.FieldName =
"G_GendreID"
;
myColumn.Width = 100;
this
.radGridView1.Columns.Add(myColumn);
GridViewDecimalColumn dColumn =
new
GridViewDecimalColumn();
// 2nd level
// -------------Child --------------
GridViewTemplate FilmTemplate =
new
GridViewTemplate();
this
.radGridView1.Templates.Add(FilmTemplate);
// set columns of filmtemplate
// GridViewDecimalColumn dColumn = new GridViewDecimalColumn();
dColumn =
new
GridViewDecimalColumn(
"FilmID"
);
dColumn.Name =
"FilmID"
;
dColumn.HeaderText =
"FilmID"
;
dColumn.FieldName =
"FilmID"
;
dColumn.IsVisible =
false
;
FilmTemplate.Columns.Add(dColumn);
dColumn =
new
GridViewDecimalColumn(
"GlossarID"
);
dColumn.Name =
"GlossarID"
;
dColumn.HeaderText =
"GlossarID"
;
dColumn.FieldName =
"GlossarID"
;
dColumn.IsVisible =
false
;
FilmTemplate.Columns.Add(dColumn);
dColumn =
new
GridViewDecimalColumn(
"Anzahl"
);
dColumn.Name =
"Anzahl"
;
dColumn.HeaderText =
"Anzahl"
;
dColumn.FieldName =
"Anzahl"
;
myColumn.Width = 100;
FilmTemplate.Columns.Add(dColumn);
GridViewTextBoxColumn tColumn =
new
GridViewTextBoxColumn();
tColumn.HeaderText =
"myFilmName"
;
tColumn.FieldName =
"myFilmName"
;
tColumn.Width = 300;
FilmTemplate.Columns.Add(tColumn);
// FilmTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
// now create relations
GridViewRelation relationGlos_Film =
new
GridViewRelation(radGridView1.MasterTemplate, FilmTemplate);
relationGlos_Film.RelationName =
"T_Glossar_MyFilms"
;
relationGlos_Film.ParentColumnNames.Add(
"GlossarID"
);
relationGlos_Film.ChildColumnNames.Add(
"GlossarID"
);
this
.radGridView1.Relations.Add(relationGlos_Film);
FilmTemplate.DataSource =
this
.tFilmBindingSource;
FilmTemplate.Caption =
"Filme"
;
// -------------Child Glossary--------------
GridViewTemplate LexTemplate =
new
GridViewTemplate();
this
.radGridView1.Templates.Add(LexTemplate);
GridViewDecimalColumn dxColumn =
new
GridViewDecimalColumn();
// set columns of Glosstemplate
dxColumn =
new
GridViewDecimalColumn(
"GlossarID"
);
dxColumn.Name =
"GlossarID"
;
dxColumn.HeaderText =
"GlossarID"
;
dxColumn.FieldName =
"GlossarID"
;
dxColumn.IsVisible =
false
;
LexTemplate.Columns.Add(dxColumn);
dxColumn =
new
GridViewDecimalColumn(
"LexID"
);
dxColumn.Name =
"LexID"
;
dxColumn.HeaderText =
"LexID"
;
dxColumn.FieldName =
"LexID"
;
dxColumn.IsVisible =
false
;
LexTemplate.Columns.Add(dxColumn);
GridViewTextBoxColumn txColumn =
new
GridViewTextBoxColumn();
txColumn.Name =
"myLex"
;
txColumn.HeaderText =
"myLex"
;
txColumn.FieldName =
"myLex"
;
txColumn.Width = 300;
LexTemplate.Columns.Add(txColumn);
// now create relations
GridViewRelation relationGlos_Lex =
new
GridViewRelation(radGridView1.MasterTemplate, LexTemplate);
relationGlos_Lex.RelationName =
"T_Glossar_T_Lex_Begriff"
;
relationGlos_Lex.ParentColumnNames.Add(
"GlossarID"
);
relationGlos_Lex.ChildColumnNames.Add(
"GlossarID"
);
this
.radGridView1.Relations.Add(relationGlos_Lex);
LexTemplate.DataSource =
this
.tLexBegriffBindingSource;
LexTemplate.Caption =
"Lexika"
;
// 3rd level
GridViewTemplate SzenenTemplate =
new
GridViewTemplate();
GridViewRelation relationFilm_Tag =
new
GridViewRelation(FilmTemplate, SzenenTemplate);
relationFilm_Tag.RelationName =
"T_FilmT_Tag"
;
relationFilm_Tag.ParentColumnNames.Add(
"FilmID"
);
relationFilm_Tag.ChildColumnNames.Add(
"FilmID"
);
FilmTemplate.Templates.Add(SzenenTemplate);
this
.radGridView1.Relations.Add(relationFilm_Tag);
//this.radGridView1.MasterTemplate.Templates[0].Templates.Add(SzenenTemplate);
SzenenTemplate.Caption =
"Szenen"
;
dxColumn =
new
GridViewDecimalColumn(
"TagID"
);
dxColumn.Name =
"TagID"
;
dxColumn.HeaderText =
"TagID"
;
dxColumn.FieldName =
"TagID"
;
dxColumn.IsVisible =
true
;
SzenenTemplate.Columns.Add(dxColumn);
dxColumn =
new
GridViewDecimalColumn(
"FilmID"
);
dxColumn.Name =
"FilmID"
;
dxColumn.HeaderText =
"FilmID"
;
dxColumn.FieldName =
"FilmID"
;
dxColumn.IsVisible =
true
;
SzenenTemplate.Columns.Add(dxColumn);
SzenenTemplate.DataSource =
this
.tTagBindingSource;
}