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.
Hi,
I''m using GGC where the DataSource is set to a DataSet with several Tables and defined relations.
One of the tables is used for a ForeignKeyReference relation.
1.How do I dynamically filter records, that are showing in dropdowngrid on per record basis?
For instance: The lookup table contains values 1,2,3,4,5;
If a parent record==2, then dropdown shoud display only 2,3,4,5
I''ve tried to handle TableControlCurrentCellShowingDropDown:
private void oGrid_TableControlCurrentCellShowingDropDown(object sender, GridTableControlCurrentCellShowingDropDownEventArgs e)
{
GridGroupingControl grid = (GridGroupingControl)sender;
GridCurrentCell curCell=grid.TableControl.CurrentCell;
if(curCell!=null)
{
Syncfusion.Windows.Forms.Grid.Grouping.GridTableDropDownListCellRenderer renderer = curCell.Renderer as Syncfusion.Windows.Forms.Grid.Grouping.GridTableDropDownListCellRenderer;
if(renderer!=null)
{
GridTableDropDownListControlPart part=renderer.DropDownContainer.Controls[0] as GridTableDropDownListControlPart;
GridGroupTypedListRecordsCollection coll = part.DataSource as GridGroupTypedListRecordsCollection;
coll.TableDescriptor.ResetRecordFilters();
if (coll.TableDescriptor.RecordFilters.Count == 0)
{
coll.TableDescriptor.RecordFilters.Add("StatusId in (1,2,3,4)");
}
}
}
}
but it throws exceptions.
2. Is there a way to use the same type of relation and just show regular DropDown instead of DropDownGrid?
Thank you.
ADAdministrator Syncfusion Team February 17, 2006 07:21 PM UTC
Hi Ivan,
check out the MultipleColumnForeignKeys example. You can have one column define a filter for the dropdown of a second column in a record.
Stefan
ADAdministrator Syncfusion Team February 20, 2006 07:12 PM UTC
Stefan,
Thank you for the answer.
Is there a way to achieve the same functionality without modifing the datasource and a single RelationKey. For instance - setting a RowFilter on child''s defaultview in some grid event?
Thank you
ADAdministrator Syncfusion Team February 20, 2006 11:39 PM UTC