1 year ago

#348714

test-img

Kacper M.

Devexpress - how to add columns to multilevel gridView

I'm trying to make two-level grid control. It has some package with its elements. I want to add one more column to gridView3 and hide three columns. I'm sending data to this gridView in code (dataset - 2 tables with one relation).

I've tried to send data to this gridcontrol and then operate on gridviews

gridControl2.DataSource = value.Tables[0];
gridView3.PopulateColumns(value.Tables[1]);
gridView3.Columns["RpkeId"].Visible = false;
gridView3.Columns["SourceLueId"].Visible = false;
gridView3.Columns["NewLueId"].Visible = false;

and then I'm trying to add column:

var test = new List<int> { 1, 12, 123, 1234 };
RepositoryItemComboBox riComboBox = new RepositoryItemComboBox();
riComboBox.Items.AddRange(test);
gridControl2.RepositoryItems.Add(riComboBox);

GridColumn columnGIDNumer = new GridColumn();
columnGIDNumer.FieldName = "asdfasdfa"; 
columnGIDNumer.ColumnEdit = riComboBox;
columnGIDNumer.OptionsColumn.AllowEdit = true;
gridView3.Columns.Add(columnGIDNumer);

None of these seem to work: doesn't work

Is there any event I need to invoke or something? It seems that it'd work in normal, one-level gridcontrol.

Thanks in advance!

c#

winforms

devexpress

devexpress-windows-ui

devexpress-gridcontrol

0 Answers

Your Answer

Accepted video resources