Print Page | Close Window

How do indices work?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=7563
Printed Date: 09 June 2024 at 4:12pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How do indices work?
Posted By: vschwarz
Subject: How do indices work?
Date Posted: 09 July 2007 at 8:57am
Hello,
 
I am trying the following:
Get the position of item1, remove item1, create item2 and insert it at item1's position.
 
This is part of my code:
int i = e.item.get_Index();
String c = e.item.get_Caption();
Object t = e.item.get_Tag();
e.item.Remove();
e.item.get_Parent().InsertChildItem(i, PropertyItemType.PropertyItemString, c, new String("")).set_Tag(t);
 
Using this code the new item always appears at another position (4 rows further down than were item1 was) - so I wonder how the indexing in the grid works...



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net