StrataListView questions...


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
How to prevent any column from being sortable?



ex: In my listviews the first columns is for an image, I don't want this column to do any sorting.

Edhy Rijo

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi guys, any idea on how to do this?

Edhy Rijo

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
There doesn't appear to be. I'm checking with Trent/Dustin in case I missed something.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Edhy, there is no way to turn off sorting for a single column (that will change very soon...an IsSortable property has been added to columns and has already been coded in fact and should be in next build).



However, there might be an alternative. You could put a logical value in the SortValue property of the image column. If the image represents individual items, you could put the PK in it. If it represents a category, put the category in the SortValue, etc.
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Thanks Greg, will explore the alternative. Good idea! Cool

Edhy Rijo

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
How to remove an item from the StrataListView?

In the old listview I could do something like this:

For Each listItem as ListViewItem in MyListView.Items
     listItem.Remove()
Next


The new StrataListViewItem does not have a Remove() method, how can I do this?


Edhy Rijo

Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Edhy.

Have a look at the StrataListView sample:

'-- Cycle through all of the items
For Each bo As CustomersBO In Customers.GetEnumerable()
 '-- Create a new item. The item is actually the first column as well.  In this case, we do not want
 '   to show anything other than an icon.  In this example, they will all be the same and user the key "User"
 item = New StrataListViewItem(String.Empty, "User")

 '-- Create the sub items.  A sub-item is ultimately nothing more than a column.
 item.SubItems.Add(String.Format("{0}, {1}", bo.cust_LastName, bo.cust_FirstName), MicroFour.StrataFrame.UI.Rendering.Enums.StrataEmbeddedControlType.Link)
 item.SubItems.Add(String.Format("{0}, {1}, {2}  {3}", bo.cust_Address1, bo.cust_City, bo.cust_State, bo.cust_Postal), String.Empty)

 '-- Create a custom data item that stores the primary key of this record
 item.CustomData.Add("PrimaryKey", bo.cust_pk)

 '-- Add the item to the list
 lstLink.Items.Add(item)
Next


According to this, the columns will be represented by the subitems, have you tried item.subitems.remove ?
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Ivan,

Sorry, but the question is how to remove an item from the StrataListView?

According to this, the columns will be represented by the subitems, have you tried item.subitems.remove ?


Yes, I tried, but I am stock on this one.  Probably Trent can give us a hint on how to remove an item from the StrataListView.

P.S.
I am replacing most of my current listview with this one and I am totally amazed with the speed and extended functionality of this control.


Edhy Rijo

Edited 14 Years Ago by Edhy Rijo
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
In that case, have you tried the following?

yourListViewControl.Items.RemoveAt(yourItemIndex)

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Thanks Ivan.

I tried that but could not find a way to get the Index of the item, since in my sample the StrataListViewItem does not have an Index property exposed.

How can we get the index of the item to be removed?

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search