i am getting "Index was outside the bounds of the array." error when i try to get the checked items from list view.
the code is
[code=c#]
private void btnFinish_Click (object sender, EventArgs e)
{
WaitCallback async = new WaitCallback(Ex ecutefeed);
ThreadPool.Queu eUserWorkItem(a sync, alParams);
waitBar.ShowDia log();
}
private void ExecuiteDataFee d(object param)
{
ArrayList alParams = (ArrayList)para m;
if(this.lstInvo iceTran.Checked Items.Count > 0)
{
this.m_InvoiceS election = null;
for ( int y = 0; y < lstInvoiceTran. CheckedItems.Co unt; y++ )
{
this.m_InvoiceS election += this.lstInvoice Tran.CheckedIte ms[y].SubItems[0].Text;
this.m_InvoiceS election += ", ";
}
m_InvoiceSelect ion = m_InvoiceSelect ion.Remove(m_In voiceSelection. Length - 2, 2);
m_InvoiceSelect ion = m_InvoiceSelect ion.Replace(" ","");
}
}
[/code]
when i debug, " lstInvoiceTran. CheckedItems.Co unt" in the FOR loop is failing.
please help.
the code is
[code=c#]
private void btnFinish_Click (object sender, EventArgs e)
{
WaitCallback async = new WaitCallback(Ex ecutefeed);
ThreadPool.Queu eUserWorkItem(a sync, alParams);
waitBar.ShowDia log();
}
private void ExecuiteDataFee d(object param)
{
ArrayList alParams = (ArrayList)para m;
if(this.lstInvo iceTran.Checked Items.Count > 0)
{
this.m_InvoiceS election = null;
for ( int y = 0; y < lstInvoiceTran. CheckedItems.Co unt; y++ )
{
this.m_InvoiceS election += this.lstInvoice Tran.CheckedIte ms[y].SubItems[0].Text;
this.m_InvoiceS election += ", ";
}
m_InvoiceSelect ion = m_InvoiceSelect ion.Remove(m_In voiceSelection. Length - 2, 2);
m_InvoiceSelect ion = m_InvoiceSelect ion.Replace(" ","");
}
}
[/code]
when i debug, " lstInvoiceTran. CheckedItems.Co unt" in the FOR loop is failing.
please help.
Comment