Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem rendering an inherited custom control
Message
Information générale
Forum:
ASP.NET
Catégorie:
WebForms
Titre:
Problem rendering an inherited custom control
Divers
Thread ID:
00881311
Message ID:
00881311
Vues:
45
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?
Brian Burlingame
Software Engineer/Consultant
Olympic Consulting Group
brian.burlingame@ocgworld.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform