public void CreateGridProductieMonitor(List<string> Kolommen)
{
radGridViewProductie.DataSource = schrapViewBindingSource;
foreach (string Kol in Kolommen)
{
if (!string.IsNullOrEmpty(Kol.Trim()))
{
GridViewTextBoxColumn textBoxColumn = new GridViewTextBoxColumn();
textBoxColumn.UniqueName = Kol;
textBoxColumn.HeaderText = Kol;
textBoxColumn.FieldName = Kol;
radGridViewProductie.MasterGridViewTemplate.Columns.Add(textBoxColumn);
}
}
}
The datasource of the grid is a generic list. The fieldname is 100% correct.
Only the first column shows data. The other columns are empty. When i change the order of the columns the result is the same. The first column added shows data.
I tried adding the columns before and after binding to the datasource.
Greetings Tim
| this.radRibbonBar1.RibbonBarElement.QuickAccessToolBar.OverflowButtonElement.DropDownMenu.Items.Add(new RadMenuItem("testing")); |
| For Each itemFileTypes In collFileTypes |
| If itemFileTypes.IsInUse Then |
| Dim newGroupElement As New RadPanelBarGroupElement |
| newGroupElement.EnableHostControlMode = True |
| newGroupElement.Caption = itemFileTypes.Descr |
| Dim lst As New RadListBox |
| lst.Name = itemFileTypes.Descr |
| lst.Dock = DockStyle.Fill |
| lst.Text = itemFileTypes.Type |
| newGroupElement.ContentPanel.Controls.Add(lst) |
| radPanelBar.Items.Add(newGroupElement) |
| End If |
| Next |
| radPanelBar.Dock = DockStyle.Left |
| radPanelBar.ThemeName = "ControlDefault" |
| ' Set focus to Log panel |
| radPanelBar.Items("Log").Focus() ' This throws exception |
| ' For each panel find the listbox and assign its DataSource etc |
| ' add a listbox event handler for SelectedValueChanged. |
| Try |
| Dim pnl As RadPanelBarGroupElement |
| For Each pnl In radPanelBar.Items |
| Dim lst As RadListBox |
| 'newGroupElement.ContentPanel.Controls.Add(lst) |
| ' This is where I come unstuck! |
| lst = pnl.Items(0) or pnl.ContentPanel.Controls(0) ??? |
| With lst |
| .ValueMember = "id" |
| .DisplayMember = "FileDescription" |
| .DataSource = GetFileNamesByType(CType(lst.Text, Integer)) |
| '.EmptyRows = True |
| AddHandler lst.SelectedValueChanged, AddressOf ListBoxSelectedValueChanged |
| End With |
| Next |
| 'newGroupElement.ContentPanel.Controls.Add(lst) |
I have an unbound gridview and the data behind is update constantly. What is considered to be the best method to update data in the gridview? Which will have least impact on performance?