Click here to Skip to main content
15,881,281 members
Home / Discussions / C#
   

C#

 
AnswerRe: About records Pin
Richard Deeming3-Jan-22 23:14
mveRichard Deeming3-Jan-22 23:14 
GeneralRe: About records Pin
Super Lloyd3-Jan-22 23:17
Super Lloyd3-Jan-22 23:17 
AnswerRe: About records Pin
BillWoodruff4-Jan-22 5:38
professionalBillWoodruff4-Jan-22 5:38 
GeneralRe: About records Pin
Super Lloyd4-Jan-22 5:49
Super Lloyd4-Jan-22 5:49 
AnswerRe: About records Pin
endo funk7-Jan-22 1:55
endo funk7-Jan-22 1:55 
GeneralRe: About records Pin
Super Lloyd7-Jan-22 8:49
Super Lloyd7-Jan-22 8:49 
GeneralRe: About records Pin
endo funk7-Jan-22 10:39
endo funk7-Jan-22 10:39 
QuestionBlazor: IEnumerable ElementAt Pin
chrisb15162-Jan-22 23:49
chrisb15162-Jan-22 23:49 
Quick preamble, I last coded in C# probably 10 years ago. A lot has changed.

I am using SyncFusions drop down box to return an index value from a list.

The variables ddlIndex, and feederDropValue both return the correct values.

C#
<SfDropDownList  DataSource  = "@lines" TValue="string" TItem="FeederTableQuery" Placeholder="Select a feeder" @bind-Value = "@FeederDropValue" @bind-Index="@ddlIndex">
	<DropDownListFieldSettings Text="FeederId" Value="FeederId"></DropDownListFieldSettings>
</SfDropDownList>

<DashboardLayoutPanel Column="2" Row="1" SizeX="2" SizeY="2">
	<HeaderTemplate>
		<div class="e-header-text">Feeder Details</div>
		<div class="header-border"></div>
	</HeaderTemplate>
	<ContentTemplate>
		<div class="panel-content">
			<p>Selected value was @FeederDropValue</p>
			<p>Selected index was @ddlIndex</p>
			@lines.ElementAt(ddlIndex).ToString(); 
		</div>
	</ContentTemplate>
</DashboardLayoutPanel>

@code
{
	private int? ddlIndex { get; set; } = 0;
	public string FeederDropValue;
	private IEnumerable <FeederTableQuery> lines { get; set; }
}


I want to the print out what is at that index value, however I get an error when trying select elementAt:

cannot convert from 'int?' to 'System.Index


I admit I not profficent with IEnumerables (probably where I am going wrong), but any help is much appreciated!
AnswerRe: Blazor: IEnumerable ElementAt Pin
#realJSOP3-Jan-22 2:16
mve#realJSOP3-Jan-22 2:16 
GeneralRe: Blazor: IEnumerable ElementAt Pin
chrisb15163-Jan-22 10:11
chrisb15163-Jan-22 10:11 
GeneralRe: Blazor: IEnumerable ElementAt Pin
#realJSOP3-Jan-22 22:39
mve#realJSOP3-Jan-22 22:39 
AnswerRe: Blazor: IEnumerable ElementAt Pin
OriginalGriff3-Jan-22 2:23
mveOriginalGriff3-Jan-22 2:23 
AnswerRe: Blazor: IEnumerable ElementAt Pin
Gerry Schmitz3-Jan-22 5:51
mveGerry Schmitz3-Jan-22 5:51 
GeneralRe: Blazor: IEnumerable ElementAt Pin
OriginalGriff3-Jan-22 6:28
mveOriginalGriff3-Jan-22 6:28 
Questioncausing the computer to freeze Pin
Calin Negru2-Jan-22 4:01
Calin Negru2-Jan-22 4:01 
AnswerRe: causing the computer to freeze Pin
Gerry Schmitz2-Jan-22 4:42
mveGerry Schmitz2-Jan-22 4:42 
GeneralRe: causing the computer to freeze Pin
Calin Negru3-Jan-22 8:11
Calin Negru3-Jan-22 8:11 
AnswerRe: causing the computer to freeze Pin
OriginalGriff2-Jan-22 6:29
mveOriginalGriff2-Jan-22 6:29 
GeneralRe: causing the computer to freeze Pin
Calin Negru3-Jan-22 6:13
Calin Negru3-Jan-22 6:13 
GeneralRe: causing the computer to freeze Pin
OriginalGriff3-Jan-22 6:45
mveOriginalGriff3-Jan-22 6:45 
AnswerRe: causing the computer to freeze Pin
#realJSOP2-Jan-22 23:53
mve#realJSOP2-Jan-22 23:53 
AnswerRe: causing the computer to freeze Pin
0x01AA5-Jan-22 4:40
mve0x01AA5-Jan-22 4:40 
QuestionAsync/Await Questions Pin
Kevin Marois30-Dec-21 7:35
professionalKevin Marois30-Dec-21 7:35 
AnswerRe: Async/Await Questions Pin
Gerry Schmitz30-Dec-21 18:43
mveGerry Schmitz30-Dec-21 18:43 
QuestionRead signature data from APK's RSA signature file Pin
mynametaken30-Dec-21 4:46
mynametaken30-Dec-21 4:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.