Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
640
"Specified method is not supported" for fields, derived from BoundDataField
posted

I'm getting following error "Specified method is not supported"

here

   Infragistics.Web.UI.GridControls.FieldCollection.CreateCollectionObject(String objectType) +204
   Infragistics.Web.UI.GridControls.ControlDataField.Clone() +54
   Infragistics.Web.UI.GridControls.WebDataGrid.CopyFields() +156
   Infragistics.Web.UI.GridControls.WebDataGrid.FillFields() +108
   Infragistics.Web.UI.GridControls.WebDataGrid.DataBind() +497

when at least one field of my custom type added to Columns collection of WebDataGrid

Definition of my custom field type class is very simple

public class BoundFieldEx: BoundDataField
{
public string FieldFormat;
}

Execution code is very simple too

WebDataGrid grid1 = new WebDataGrid
{
ID = "grid",
Height = Unit.Pixel(200),
Width = Unit.Pixel(800)
};

....

GridField col = new BoundFieldEx
{
Key = "Customer.Company",
DataFieldName = "Customer.Company"
};
col.Header.Text = "Company";
col.Header.Tooltip = "Company";
grid1.Columns.Add(col);

....

grid1.AutoGenerateColumns = false;
grid1.DataSource = ds;
grid1.DataBind();

 

What is wrong with my custom field type? How can I avoid this exception?

And I really need field type, derived from BoundDataField.

Version I'm using: 10.3 SR2120 for ASP.Net

Parents
  • 33839
    Suggested Answer
    posted

    Hi Andrey Abramov,

    I investigated this and found that there was actually a bug surrounding it.  It is sumbitted as 83810 and has been fixed.  It will be available in the next Service Release.  But there will be one other thing you'll need to do in order to make it work.  You'll have to make your class definition as follows:

    public class BoundFieldEx: BoundDataField, Infragistics.Web.UI.ICollectionObject
    And inside your class somewhere, you need to add the following method:
    string ICollectionObject.GetObjectType()
    		{
    			string name = this.GetType().AssemblyQualifiedName;
    			name = name.Replace('.', '~');
    			return name;
    		}

    That will allow the grid to find the type and create your column, but only after this bug fix is in your code. I will have Developer support follow up to attach your case and see if you need this escalated.

    regards,

    David Young

     

Reply Children