The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I''m trying to dynamically change the value of the ComboBox list on one cell in the GDBG.
I''m using following code to do that:
private void AssignmentGrid_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
{
GridCurrentCell currentCell = this.AssignmentGrid.CurrentCell;
GridComboBoxCellRenderer cr = currentCell.Renderer as GridComboBoxCellRenderer;
GridBoundColumn gridBoundColumn = this.AssignmentGrid.GridBoundColumns["FieldWorkerID"];
int colIndex = this.AssignmentGrid.GridBoundColumns.IndexOf(gridBoundColumn) + 1;
if(cr != null && currentCell.ColIndex == colIndex)
{
cr.ListBoxPart.DataSource = UserIdList;
}
else
{
gridBoundColumn = AssignmentGrid.GridBoundColumns["LoadGroup"];
colIndex = AssignmentGrid.GridBoundColumns.IndexOf(gridBoundColumn) + 1;
if(cr != null && currentCell.ColIndex == colIndex)
{
cr.ListBoxPart.DataSource = loadGroups;
AssignmentGrid.GridBoundColumns["LoadGroup"].StyleInfo.DataSource = loadGroups;
}
}
}
The FieldWorkerID Combo Box is:
GridDropDownStyle.AutoComplete style
and LoadGroup ComboBox is:
GridDropDownStyle.Editable style.
Changing the data source on the FieldWorkerID works but it does not on the "LoadGroup".
I checked and re-checked in the Debugger that the data assigned to the "LoadGroup" cell is correct and it is. The renderer data source shows correct list ( in the debugger ) yet when the drop down list is displayed the new values does not show.
What is happening here?
ADAdministrator Syncfusion Team March 15, 2006 05:49 AM UTC
Hi Kstoj,
Changing the ComboBox choice list dynamically in a cell works fine. Please refer to the attached sample and let us know if you are trying something different.
Regards,
Calvin.