Last post Nov 05, 2009 05:36 AM by epb1
Nov 05, 2009 04:54 AM|epb1|LINK
I am using LINQ to SQL and Dynamic Data. Is it possible to make a default selection in the filters that are given by default in Dynamic Data (the ones that are generated by the FilterRepeater)? For example would it be possible to have a table "Persons" and
setting a default filter selection such that only the persons with Name = "Adam" are displayed by default.
Nov 05, 2009 05:36 AM|epb1|LINK
Found a solution myself: changed the FilterUserControl class which is used to generate the filters dynamically. I added the following code in Page_Init which selects "Adam" if the filter being created is filtering the Name-column:
if (DataField == "Name") DropDownList1.SelectedValue = "Adam";