Click here to Skip to main content
15,913,941 members
Home / Discussions / C#
   

C#

 
AnswerRe: execting .bat file. Pin
Joshua Lunsford19-Jun-06 10:33
Joshua Lunsford19-Jun-06 10:33 
AnswerRe: execting .bat file. Pin
Spike^Blue^Heaven19-Jun-06 20:13
Spike^Blue^Heaven19-Jun-06 20:13 
GeneralRe: execting .bat file. Pin
tom laz19-Jun-06 10:46
tom laz19-Jun-06 10:46 
GeneralRe: execting .bat file. Pin
tom laz19-Jun-06 10:49
tom laz19-Jun-06 10:49 
GeneralRe: execting .bat file. Pin
Joshua Lunsford19-Jun-06 11:28
Joshua Lunsford19-Jun-06 11:28 
QuestionWindows Service with threading issues Pin
Joshua Lunsford19-Jun-06 10:26
Joshua Lunsford19-Jun-06 10:26 
AnswerRe: Windows Service with threading issues Pin
Tom Delany19-Jun-06 11:47
Tom Delany19-Jun-06 11:47 
QuestionPageSize not working on PagedDataSource populated by an ArrayList Pin
Afut19-Jun-06 9:07
Afut19-Jun-06 9:07 
Greetings,

I have the need to place an arraylist into a pageddataset that fills a repeater. The command buttons and total number of pages is all there, however, the pagelimit is not working. I have resolved the data source to iEnumerable, to no avail.

Can anyone assist? Here is the code...Thanks!!!

override

protected void OnLoad(EventArgs e)
{

EnsureChildControls();


// Populate the repeater control with the Items DataSet
PagedDataSource objPds = new PagedDataSource();
objPds.PageSize = 10;
objPds.AllowPaging = true;
objPds.CurrentPageIndex = CurrentPage - 1;
if (Confirm && PledgeID != -1)
{
objPds.DataSource = (IEnumerable) ResolveDataSource(array list );
}
else
{

//objPds.DataSource = PledgeUtility.GetAllPledges(ModerationStatus.Pending);
objPds.DataSource = (IEnumerable) ResolveDataSource(array list));

}


// Set the PagedDataSource's current page
lblCurrentPage.Text = "Page: " + (CurrentPage + 1).ToString() + " of "

+ objPds.PageCount.ToString();


// Disable Prev or Next buttons if necessary
cmdPrev.Enabled = !objPds.IsFirstPage;

cmdNext.Enabled = !objPds.IsLastPage;

rptPledgeList.DataSource = objPds.DataSource;

rptPledgeList.DataBind();

pnlNoPledges.Visible = (rptPledgeList.Items.Count == 0);

}


// *****************************************************************

// *****************************************************************

// Resolve the data source and normalize it to IEnumerable

private IEnumerable ResolveDataSource(object dataSource)
{

IListSource listSource;

IList list;


if (dataSource == null)

return null;
listSource = (dataSource

as IListSource);

if (listSource != null)
{

list = listSource.GetList();


return list;
}


if ((dataSource as IEnumerable) != null)

return (IEnumerable) dataSource;

return null;
}


// *****************************************************************
QuestionNeural networks in c# Pin
yasar khan19-Jun-06 8:35
yasar khan19-Jun-06 8:35 
AnswerRe: Neural networks in c# Pin
Josh Smith19-Jun-06 9:58
Josh Smith19-Jun-06 9:58 
Question.NET 2.0 properties and Javascript Pin
Marc Clifton19-Jun-06 7:59
mvaMarc Clifton19-Jun-06 7:59 
AnswerRe: .NET 2.0 properties and Javascript Pin
Marc Clifton19-Jun-06 9:25
mvaMarc Clifton19-Jun-06 9:25 
QuestionCombo Box and refresh/reload data Pin
Saamir19-Jun-06 7:45
Saamir19-Jun-06 7:45 
AnswerRe: Combo Box and refresh/reload data Pin
Paul Brower19-Jun-06 9:31
Paul Brower19-Jun-06 9:31 
QuestionRe: Combo Box and refresh/reload data Pin
Saamir19-Jun-06 10:14
Saamir19-Jun-06 10:14 
GeneralRe: Combo Box and refresh/reload data Pin
Saamir20-Jun-06 5:16
Saamir20-Jun-06 5:16 
QuestionHow to Count number of specific day Pin
rockxuyenmandem19-Jun-06 7:36
rockxuyenmandem19-Jun-06 7:36 
AnswerRe: How to Count number of specific day Pin
LongRange.Shooter19-Jun-06 7:51
LongRange.Shooter19-Jun-06 7:51 
AnswerRe: How to Count number of specific day Pin
Tom Delany20-Jun-06 4:49
Tom Delany20-Jun-06 4:49 
QuestionAutomating Word to Fill in a Word Template Pin
vnoga19-Jun-06 7:34
vnoga19-Jun-06 7:34 
AnswerRe: Automating Word to Fill in a Word Template Pin
vnoga19-Jun-06 8:14
vnoga19-Jun-06 8:14 
QuestionTextarea - Multiple data submission Pin
edgtr19-Jun-06 5:59
edgtr19-Jun-06 5:59 
AnswerRe: Textarea - Multiple data submission Pin
LongRange.Shooter19-Jun-06 7:58
LongRange.Shooter19-Jun-06 7:58 
Questionclass to be both marked with the serializable attribute and extend MarshalByRefObject [modified] Pin
Kiran Kumar Singani19-Jun-06 3:14
Kiran Kumar Singani19-Jun-06 3:14 
AnswerRe: class to be both marked with the serializable attribute and extend MarshalByRefObject Pin
Josh Smith19-Jun-06 4:03
Josh Smith19-Jun-06 4:03 

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.