Hi im trying to convert winform to asp.net, i have one fail i cant see how to solve:
- PaperSource pkSource;
- List<object> listPaperSource = new List<object>();
- protected void comboFillPapersource()
- {
- for (int i = 0; i < printDoc.PrinterSettings.PaperSources.Count; i++)
- {
- if (printDoc.PrinterSettings.PaperSources[i].SourceName == "test")
- {
- pkSource = printDoc.PrinterSettings.PaperSources[i];
- }
- listPaperSource.Add(printDoc.PrinterSettings.PaperSources[i]);
- }
-
- DropDownPaperSource.DataSource = listPaperSource;
- DropDownPaperSource.DataTextField = "SourceName";
- DropDownPaperSource.DataValueField = "RawKind";
- DropDownPaperSource.SelectedItem = pkSource;
- DropDownPaperSource.DataBind();
- }
the code prints papersources from a defined printer. its the second last line that fail, with, cant convert papersource to itemlist (DropDownPaperSource.SelectedItem = pkSource;
With the error cant convert papersourse to listitem
:/