StrataFrame Forum

StrataListView questions...

http://forum.strataframe.net/Topic28144.aspx

By Edhy Rijo - 8/28/2010

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.
By Edhy Rijo - 8/31/2010

Hi guys, any idea on how to do this?
By Greg McGuffey - 8/31/2010

There doesn't appear to be. I'm checking with Trent/Dustin in case I missed something.
By Greg McGuffey - 8/31/2010

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.
By Edhy Rijo - 8/31/2010

Thanks Greg, will explore the alternative. Good idea! Cool
By Edhy Rijo - 9/19/2010

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?
By Ivan George Borges - 9/20/2010

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 ?
By Edhy Rijo - 9/20/2010

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.
By Ivan George Borges - 9/20/2010

In that case, have you tried the following?

yourListViewControl.Items.RemoveAt(yourItemIndex)
By Edhy Rijo - 9/20/2010

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?
By Ivan George Borges - 9/20/2010

Hi Edhy.

That is a good question. BigGrin

I tried to find out over here but didn't get to a good result yet, gues I will need some help from the guys.
By Edhy Rijo - 9/20/2010

Hi Ivan,

Glad to see we are in the same page Hehe