Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MmDataGrid
Message
De
03/02/2004 10:09:18
 
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Divers
Thread ID:
00872912
Message ID:
00873372
Vues:
18
>Steve,
>
>>I've noticed that the mmDataGrid doesn't handle the column collection properly when you have the AutoGenerateColumns set on. Every time I've tried this, I get an Index Out of Range exception. I've also tried adding bound columns to the mmDataGrid at run time and can't seem to get the binding to work properly.
>
>I haven't seen this problem before with the AutoGenerateColumns property. If you drag and drop an mmDataGrid on a form this property is automatically set to true. I'd be curious to see if you drop a new mmDataGrid on your Web Form and simply set the BindingSource type if you still see this error.
>
>Regarding bound columns you have added dynamically at run time, do other design-time columns bind properly? If none of the columns are binding, try calling the MM .NET Web form's BindControl() method.
>
>Regards,

Calling the BindControl() method fixed the problem with the columns added via code.

I left out some important information on the AutoGenerateColumns issue. The error happens when I call the SaveDataSet in the code below.

private void dgStates_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
// Get the item to be updated
this.dgStates.EditItemIndex = e.Item.ItemIndex;
// Retrieve the previous States DataSet
DataSet dsStates = (DataSet)Session["dsStates"];
// Save the DataSet (the DataGrid automatically binds back)
this.oStates.SaveDataSet(dsStates);
// Reset the edited item and rebind the DataGrid
this.dgStates.EditItemIndex = -1;
this.BindControl(this.dgStates);
}
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform