Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem rendering an inherited custom control
Message
From
26/02/2004 20:29:37
Keith Payne
Technical Marketing Solutions
Florida, United States
 
General information
Forum:
ASP.NET
Category:
WebForms
Miscellaneous
Thread ID:
00881311
Message ID:
00881327
Views:
17
Perhaps the string is converted to a value that is out of the bounds of the Cell collection. Have you inspected Convert.ToInt32(str) in the watch window?

>I'm experieincing a weird situation on a custom control I've created from a DataGrid. What I was attempting to do is add a property in which I could specify a comma-delimted list of column indexes I want the control to automatically sum in the footer.
>
>To do this I've overriden the 'OnItemDataBound' event; for each row being bound, I get the value for each cell I've designated for summing. However, it seems that whenever I cast the cell value to a decimal (the type i need for summing) the control will not render in the designer. I get the following message:
>
>.. "There was an error rendering the control. Check to make sure all properties are valid".
>
>The only difference is how I'm referencing the index of the cell. If I use a variable, the rendering does not work:
>
>foreach(string str in summaryIndexes)
>{
> cellIndex = Convert.ToInt32(str);
> foreach(DataGridItem dgi in this.Items)
> {
> TableCell tc = dgi.Cells[cellIndex];
> }
>}
>
>... But it does work if I have a hard-coded interger instead:
>
>foreach(string str in summaryIndexes)
>{
> cellIndex = Convert.ToInt32(str);
> foreach(DataGridItem dgi in this.Items)
> {
> TableCell tc = dgi.Cells[0];
> }
>}
>
>Anyone know what the deal is?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform