Click here to Skip to main content
15,921,905 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionError while placing Script Manager Control in CotentPage Pin
Dinesh Girija Sundaram11-Sep-07 19:32
Dinesh Girija Sundaram11-Sep-07 19:32 
AnswerRe: Error while placing Script Manager Control in CotentPage Pin
Sandeep Akhare11-Sep-07 21:39
Sandeep Akhare11-Sep-07 21:39 
AnswerRe: Error while placing Script Manager Control in CotentPage Pin
Urs Enzler12-Sep-07 1:21
Urs Enzler12-Sep-07 1:21 
QuestionLoading Dictionary issue Pin
samerh11-Sep-07 19:21
samerh11-Sep-07 19:21 
QuestionASP.NET Pin
ramyanaidu11-Sep-07 18:41
ramyanaidu11-Sep-07 18:41 
AnswerRe: ASP.NET Pin
Sathesh Sakthivel11-Sep-07 18:45
Sathesh Sakthivel11-Sep-07 18:45 
AnswerRe: ASP.NET Pin
Sandeep Akhare11-Sep-07 21:48
Sandeep Akhare11-Sep-07 21:48 
QuestionIndexOutofRangeException in grid Pin
kunal_gct11-Sep-07 18:26
kunal_gct11-Sep-07 18:26 
hi,

i am developing a c# based web application. I incorporated a radgrid on to my user form, and filled it programmatically.

However i get an indexoutofrangeexception whenever i click to move on to the next page.

Below is the code that i ham using to bound items.

//CODE STARTS
<code>protected void rgCases_ItemDataBound(object sender, Telerik.WebControls.GridItemEventArgs e)
{

int index = e.Item.ItemIndex + (rgCases.PageSize * rgCases.CurrentPageIndex);
if (e.Item is GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
lnkBtn = new LinkButton();
lnkBtn.ID = "LinkButton1";

lnkBtn.Text = "<a href='./CasesDetail.aspx?idCase=" + ds.Tables[0].Rows[index][0].ToString() + "'>" + ds.Tables[0].Rows[index][4].ToString() + "</a>";
item["idcase"].Controls.Add(lnkBtn);
}


} </code>
//CODE ENDS

The exception arises in the line

<code>lnkBtn.Text = "<a href='./CasesDetail.aspx?idCase=" + ds.Tables[0].Rows[index][0].ToString() + "'>" + ds.Tables[0].Rows[index][4].ToString() + "</a>"; </code>

The exception detail is as follows


There is no row at position 5.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.



Exception Details:
System.IndexOutOfRangeException: There is no row at position 5.

Source Error:
<code>
Line 299: lnkBtn.ID = "LinkButton1";
Line 300:
Line 301: lnkBtn.Text = "<a href='./CasesDetail.aspx?idCase=" + ds.Tables[0].Rows[index][0].ToString() + "'>" + ds.Tables[0].Rows[index][4].ToString() + "</a>";
Line 302: item["idcase"].Controls.Add(lnkBtn);
Line 303: }
</code>
MY page size is 5 as well.

cana nyone please help, if not on how to remove on a TELErIK RAdgrid, atleast tell me, how i can remove on a Grid

thanks,

Kunal
AnswerRe: IndexOutofRangeException in grid Pin
Sandeep Akhare11-Sep-07 21:44
Sandeep Akhare11-Sep-07 21:44 
Generalanother apporach,another error Pin
kunal_gct12-Sep-07 21:03
kunal_gct12-Sep-07 21:03 
QuestionDropDownList -problem Pin
Rmesh11-Sep-07 18:06
Rmesh11-Sep-07 18:06 
AnswerRe: DropDownList -problem Pin
Imran Khan Pathan11-Sep-07 18:26
Imran Khan Pathan11-Sep-07 18:26 
AnswerRe: DropDownList -problem Pin
N a r e s h P a t e l11-Sep-07 18:28
N a r e s h P a t e l11-Sep-07 18:28 
QuestionAjax Tab Control Pin
Patrice in Irvine11-Sep-07 12:02
Patrice in Irvine11-Sep-07 12:02 
QuestionCreate and add event for linkbutton Pin
ctlqt1211-Sep-07 12:01
ctlqt1211-Sep-07 12:01 
AnswerRe: Create and add event for linkbutton Pin
Imran Khan Pathan11-Sep-07 18:56
Imran Khan Pathan11-Sep-07 18:56 
QuestionNavigation Control Question Pin
RJLuppino11-Sep-07 8:58
RJLuppino11-Sep-07 8:58 
AnswerRe: Navigation Control Question Pin
netJP12L11-Sep-07 10:48
netJP12L11-Sep-07 10:48 
QuestionTextBoxWatermark Pin
netJP12L11-Sep-07 7:43
netJP12L11-Sep-07 7:43 
Questionjavacript popups Pin
A.Vishal11-Sep-07 7:07
A.Vishal11-Sep-07 7:07 
QuestionDrop Down list Pin
seemamltn11-Sep-07 6:56
seemamltn11-Sep-07 6:56 
AnswerRe: Drop Down list Pin
A.Vishal11-Sep-07 7:12
A.Vishal11-Sep-07 7:12 
GeneralRe: Drop Down list Pin
seemamltn11-Sep-07 7:30
seemamltn11-Sep-07 7:30 
GeneralRe: Drop Down list Pin
N a r e s h P a t e l11-Sep-07 18:32
N a r e s h P a t e l11-Sep-07 18:32 
QuestionCharting Software Pin
RahulOP11-Sep-07 6:53
RahulOP11-Sep-07 6:53 

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.