Why can't FeatureSet.Features.Remove( ) works?

Dec 1, 2011 at 8:00 AM

Dear all,

I want to delete a specified feature,I used "fs.Features.Remove (ft as IFeature);" statement ,but It doesnot work?  Why??  Is there other solution?

Developer
Dec 1, 2011 at 9:23 PM

What does happen? I noticed the following XML comment:

Unable to remove while the ReadOnly property is set to true.
Dec 2, 2011 at 1:53 AM
Edited Dec 2, 2011 at 2:02 AM

Thank you very much,but how can i solve this problem? and is there other solution?

 When I use this statement "bool flg=fs.Features.Remove(ft as IFeature);" , it always returns "false".

Dec 5, 2011 at 9:19 AM

because the ifeature of ft is not in the your fs.features,the feature of ft is a new ifeature!

Dec 8, 2011 at 10:06 AM

but My ft is got from "ft=featureSet.Features[i]" statement ,then I use "bool flg=featureSet.Features.Remove(ft)"

ft is always equal to false.I am very confused ,where am i wrong?

Dec 8, 2011 at 10:08 AM

but My ft is got from "ft=featureSet.Features[i]" statement ,then I use "bool flg=featureSet.Features.Remove(ft)"

ft is always equal to false.I am very confused ,where am i wrong?

Dec 8, 2011 at 10:13 AM

but My ft is got from "ft=featureSet.Features[i]" statement ,then I use "bool flg=featureSet.Features.Remove(ft)"

ft is always equal to false.I am very confused ,where am i wrong?

Dec 8, 2011 at 10:24 AM

How can I set ReadOnly property to false?

Dec 12, 2011 at 8:19 AM

if your ft is from featureSet.Features[i],why don't you try the method featureSet.Features.Remove(i)  or  featureSet.Features.Remove( featureSet.Features[i] ) !