It looks like the hidden propery deosn't work in the Hierarchical ultraGrid for the child rows.
I create a simple form with one UltraGrid in it and I manually put 2 bands in it and in the page load I put the code below.
private void HiddenColumns_Load(object sender, EventArgs e)
{
//step 1: ultrawingrid structure
ultraGrid1.DisplayLayout.Bands[0].Columns.Add("Primary");
ultraGrid1.DisplayLayout.Bands[0].Columns.Add(
ultraGrid1.DisplayLayout.Bands[0].Columns[
ultraGrid1.DisplayLayout.Bands[1].Columns.Add(
ultraGrid1.DisplayLayout.Bands[1].Columns[
//======================================
DataSet ds = new DataSet();
ds.Tables.Add(
ds.Tables[
ds.Relations.Add(
DataRow rowParent = ds.Tables["Parent"].NewRow();
rowParent[
rowrChild[
ultraGrid1.DataSource = ds;
}
this is the result I was expecting the childhidden to be hidden just like the parenthidden that's hidden in the parent row.
please I am stuck with this problem, I need and explanation.
thanks for all your help in advance.
D
the code was formated automatically when I posted so here is a better version of it.
ultraGrid1.DisplayLayout.Bands[0].Columns.Add("parentcol");
ultraGrid1.DisplayLayout.Bands[0].Columns.Add("parenthidden");
ultraGrid1.DisplayLayout.Bands[0].Columns["parenthidden"].Hidden = true;
ultraGrid1.DisplayLayout.Bands[1].Columns.Add("Foreign");
ultraGrid1.DisplayLayout.Bands[1].Columns.Add("ChildPrimary");
ultraGrid1.DisplayLayout.Bands[1].Columns.Add("childhidden");
ultraGrid1.DisplayLayout.Bands[1].Columns["childhidden"].Hidden= true;
//step 2: Dataset structure
ds.Tables.Add("Parent");
ds.Tables.Add("Child");
ds.Tables["Parent"].Columns.Add("Primary");
ds.Tables["Parent"].Columns.Add("parentcol");
ds.Tables["Parent"].Columns.Add("parenthidden");
ds.Tables["Child"].Columns.Add("Foreign");
ds.Tables["Child"].Columns.Add("ChildPrimary");
ds.Tables["Child"].Columns.Add("childhidden");
ds.Tables["Parent"].PrimaryKey = new DataColumn[] { ds.Tables["Parent"].Columns["Primary"] };
ds.Tables["Child"].PrimaryKey = new DataColumn[] { ds.Tables["Child"].Columns["ChildPrimary"] };
ds.Relations.Add("relation",
ds.Tables["Parent"].Columns["Primary"],
ds.Tables["Child"].Columns["Foreign"]);
//step 3: adding rows to the dataset
rowParent["Primary"] = 1;
rowParent["parentcol"] = "Hello!!!";
rowParent["parenthidden"] = "I am hidden in parent";
ds.Tables["Parent"].Rows.InsertAt(rowParent, 0);
DataRow rowrChild = ds.Tables["Child"].NewRow();
rowrChild["Foreign"] = 1;
rowrChild["ChildPrimary"] = 101;
rowrChild["childhidden"] = "I am hidden in child";
ds.Tables["Child"].Rows.InsertAt(rowrChild, 0);
//step 4: binding the dataset to the grid
Move the lines of code hiding the columns to after the DataBind call and it will work as expected. Another option is to do all of that hiding code in the InitializeLayout event handler of the WinGrid and it will work as expected.