this code throws an exeption: (System.ArgumentException)Message "Value
does not fall within the expected range."

siteCollection.AllWebs[0].Lists[j].Fields.Delete(siteCollection.AllWebs[0].Lists[j].Fields[i].Title);

and this code throws this
exception:(Microsoft.SharePoint.SPException) _message "Cannot change
Hidden attribute for this field" string

siteCollection.AllWebs[0].Lists[j].Fields[i].Hidden = true;

just for the record, there us no problem with the enumerations (i,j)
and the field "title" does have a value (and the correct one too).
this does not happen with the property ReadOnlyField... !?

if some one knows why.... i'd like to know!
:) thanks a bunch.
Tomer.

Re: fields hidden property, can't change property can't delete field. by Mike

Mike
Wed Jan 07 10:07:13 CST 2004

Just a thought. Whenever I get the "Value does not fall within expected
range" error I have to use the internal name of the field instead. It might
be looking for that instead. Try it, you might get lucky.


"Tomer Cohen" <tomerc@egged.co.il> wrote in message
news:f1817f5f.0401060705.cc0e7f4@posting.google.com...
> this code throws an exeption: (System.ArgumentException)Message "Value
> does not fall within the expected range."
>
>
siteCollection.AllWebs[0].Lists[j].Fields.Delete(siteCollection.AllWebs[0].L
ists[j].Fields[i].Title);
>
> and this code throws this
> exception:(Microsoft.SharePoint.SPException) _message "Cannot change
> Hidden attribute for this field" string
>
> siteCollection.AllWebs[0].Lists[j].Fields[i].Hidden = true;
>
> just for the record, there us no problem with the enumerations (i,j)
> and the field "title" does have a value (and the correct one too).
> this does not happen with the property ReadOnlyField... !?
>
> if some one knows why.... i'd like to know!
> :) thanks a bunch.
> Tomer.