Last post Aug 11, 2013 06:25 AM by sjnaughton
Aug 10, 2013 12:54 AMfirstname.lastname@example.org|LINK
i have created dynamic data project web application. its working fine. at one situation the foregin key values are showing in DropDownList, there
i want to sort the data and then show on Dropdwonlist, I know that, to sort then use DisplayColumn but, i dont know how to use it, may i know how to sort it?
experts please help me.
Aug 10, 2013 06:32 AM|sjnaughton|LINK
winseealn@ho..., this is fixed byt using the DisplayAttribute on the table you would use
Note: you put the actual column names int he quotes :)
Aug 10, 2013 06:44 AMemail@example.com|LINK
thanks for your response.
if i put just this single line [Display("<ColumnNameTodisplay>","<ColumnNameToSortBy>")] then will it work or have to adjust some more code?
Aug 10, 2013 06:47 AMfirstname.lastname@example.org|LINK
i tried ur code but, getting below error
Error 4 'System.ComponentModel.DataAnnotations.DisplayAttribute' does not contain a constructor that takes 2 arguments ......
Aug 10, 2013 07:13 AM|sjnaughton|LINK
Sorry my Bad its DisplayColumnAttribute oh the same
Aug 10, 2013 07:35 AMemail@example.com|LINK
i dont understand, please tell me what code i have to use? and whee i have to put it?
Aug 11, 2013 01:37 AMfirstname.lastname@example.org|LINK
finally, i got resolved
i put this code
[DisplayColumn("company_name", "company_name", false)]
on top of public partial class Table1: INotifyPropertyChanging, INotifyPropertyChanged
Aug 11, 2013 06:25 AM|sjnaughton|LINK
That last false is optional you only set it to true if you want the sort order to be descending instead of ascending :)