I am working on a winforms application that uses Sybase Datawindow.net. Basically I have a datawindow that retrieves data (dw_retailer.Retrieve(id)) and what I get back is an object list. The datawindow itself excists of labels and textboxes and I bind the data like this
newRetailer.foto1 = ((object[])(dataWindowControl.PrimaryData.Rows[0]))[7].ToString();
newRetailer.foto2 = ((object[])(dataWindowControl.PrimaryData.Rows[0]))[6].ToString();
What I want to do now is put a string into the object[] list like this
((object[])(_targetForm.dw_retailer.PrimaryData.Rows[0]))[5] = retailer.text;
But obviously that doesnt work.
((object[])(_targetForm.dw_retailer.PrimaryData.Rows[0])).SetValue(retailer.text,5);
That doenst work either (index out of range) altho it has 9 objects
_targetForm.dw_retailer.PrimaryData.Rows[0] {object[9]} object {object[]}
Tried it like this too
Array arrayList = _targetForm.dw_retailer.PrimaryData.Rows.ToArray();
arrayList.SetValue(retailer.text, 0,5);
Array is not multidimensional. Because I need the objects in the object so i need arrayList[0][5] but that doenst work either.
I don't even know if it is just a setting I have to select in the DataWindow Designer Application. How do I convert the array to object[] so I can put it back in the _targetForm.dw_retailer.PrimaryData.Rows. Is it even possible to edit the datawindows?
Still not working Marc
IList list = ((IList)(_targetForm.dw_retailer.PrimaryData.Rows[0]));
list[5] = retailer.text;
retailer.text has the value "tekst" list[5] is unchanged.
It's not exactly adding an item, more like editting one. About the index out of range, I know there were only 8 items in the list, that's why I find it strange that the fifth is index out or range. Maybe I just dont understand .SetValue() that well.
Thanks for the IList tho! But how do I convert the IList back to object[]?