TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
jesper
NA
89
54.1k
cant convert papersource to list
Jan 11 2013 6:12 AM
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 = pkSo
urce;
With the error cant convert papersourse to listitem
:/
Reply
Answers (
1
)
sample chat application in asp.net
Bind data to asp.net dropdownlist in gridview?