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.
How can I change the datasource of a combobox cell when is clicked. I tried the following code without success:
private void GDBG_CurrentCellActivated(object sender, System.EventArgs e)
{
if (GDBG.CurrentCell.ColIndex == 4)
{
GridComboBoxCellRenderer cr=(GridComboBoxCellRenderer)GDBG.CurrentCell.Renderer;
CurrencyManager cm = (CurrencyManager) this.BindingContext[GDBG.DataSource];
DataRow row = (DataRow) ((DataRowView) cm.Current).Row;
string ownertype = Convert.ToString(row["Descr"]);
string filter = "ContactGroup LIKE ''" + ownertype + "''";
oDS.Tables[2].Rows.Add(oDS.Tables[1].Select(filter));
cr.ListBoxPart.DataSource = oDS.Tables[2];
cr.ListBoxPart.ValueMember = "ContactTypeKey";
cr.ListBoxPart.DisplayMember = "ContactTypeDescription";
}
ADAdministrator Syncfusion Team February 22, 2006 06:19 AM UTC
Hi Kingsley,
Setting the DataSource for a ComboBox type cell in the CurrentCellActivated event handler works fine. The DataSource can also be set in the CurrentCellShowingDropDown event handler. Please check whether the oDS.Tables[1].Select(filter) in your code returns any row. The DropDown list part wont be shown when the DataSource is empty.
Regards,
Calvin.
KIKingsleyFebruary 23, 2006 03:15 PM UTC
You''re right, the problem is from the filter line. It''s ok now, Thanks
>Hi Kingsley,
>
>Setting the DataSource for a ComboBox type cell in the CurrentCellActivated event handler works fine. The DataSource can also be set in the CurrentCellShowingDropDown event handler. Please check whether the oDS.Tables[1].Select(filter) in your code returns any row. The DropDown list part wont be shown when the DataSource is empty.
>
>Regards,
>Calvin.