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
1355
Renaming name/Caption of newly added column thru propertydescriptors associated with a grid
posted

Hi,

    I have a Class A which implements bindinglist<B>  and ITypedList and am using it as a datasource for grid. Internally i use propertydescriptors which allows user's to add new columns dynamically to the grid.If user'  decides to rename the newly added customproperty, how can i do that? 

I am trying to implement by renaming the property in my underlying object which in turn shoud reflect in the grid when it queries property descriptor collection. It partly works when there is no data for that column and i can rename as manay times i want. But when i type some value on the column and then i try to rename the property, It throws me a runtime exception where grid can't load

"Message:   Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index

Source:    mscorlib

Help link: 

Stack:

   at System.Collections.ArrayList.get_Item(Int32 index)

   at Infragistics.Win.UltraWinGrid.CellsCollection.HasCell(Int32 index)

   at Infragistics.Win.UltraWinGrid.CellsCollection.HasCell(UltraGridColumn column)

......"

I really appreciate ur help.

 

Thanks,

Valliappan