You've got a couple of options. An ObjectListView has two members which deal with filtering: olv.ListFilter and olv.AdditionalFilter. You could use these two together to indicate your primary and secondary filters (be they the same or different type of filter). A second alternative is, if you want unlimited levels of filtering, to use a CompositeFilter. This will join any number of filters and apply them together. The filters don't even need to be of the same type. In particular, there is a CompositeAllFilter, where a model object needs to satisfy ALL contained filters to be included in the list.
I'm afraid I don't have any immediate help for the right-to-left text highlighting, but you could try poking around the OLV source code in Renderer.cs. Look for the HighlightTextRenderer's render methods. It looks like it's basically drawing a box around the text, starting from the left, up to the size of the matched text. If you can somehow pass this function a parameter telling it whether to start from the left or right, you can probably get it to do what you want. Alternatively, if your application will only be used in a right-to-left language, you could modify the function always to start from the right, build it, and use the modified DLL in your project.
Thanks for your both precious answers. That really helped. I think it is good to add a property in OLV for RightToLeft highlighting at least. When one is using OLV in RightToLeft layout, definitely he need highlighting in RightToLeft as well. Alternatively programer can detect, in which language user is typing and can use RightToLeft highlighting property. It would be great help for beginners like me. Thanks once again.
This is an ObjectListView. The items in your list should represent "model" objects. The value of each cell usually corresponds to a member of your model object. Therefore, when the value of one member changes, you should know which other member also needs to be updated at the same time. Then, all you need to do is refresh that object in ObjectListView, and both cells will be updated.
We also have an ObjectListView called ProductList with four columns, one for each property of our Product model object. In one of the OLV's CellEdit events, you can determine what value is being modified and adjust another value.
// In this example, we modify the Price if the Quantity is 10 or more
privatevoid ProductList_CellEditFinishing(object sender, CellEditEventArgs e)
Product model = (Product)e.RowObject;
if (e.Column.AspectName == "Quantity") // The configured aspect name of the column
if (model.Quantity >= 10)
model.Price *= 0.8m; // 20% discount on 10 or more
ProductList.RefreshObject(model); // Do this only if the cells do not refresh automatically
In my case, the control is a FastDataListView, the data is retrieved using a SQL query and add the control using the DataSource and DataMember, once this is done the user selects the rows you want to update (by check in the records) and combobox selecting a particular value is at the time when you have to loop through the rows of fastdatalistview and if the record is checked, depending on the value of a column, change the contents of another column.
I'm not sure I completely understand your situation (and my experience with FastDataListView is limited), but some should still apply. Firstly, if the checkbox is in the first column of your list, then you should be able to use the OLV.CheckedObjects property to get the list of all checked records instead of looping through the entire list. Secondly, if you know which column you are changing and what the new value is, then you should be able to make a change to the contents of another column at the same time. You probablky would not even need an event like I was mentioning before. Perhaps I'm still misunderstanding your situation...
When using ObjectListView, you cannot use the regular ListView methods that interact with items & colums directly. That's because OLV is doing a lot of things for you internally. You must instead use the ObjectListView-specific methods. For example, instead of using listView.Items, you would use a method such as listView.GetItem(). There are numerous examples but this is the general idea.
Since this is an object list view, one way of changing the colour via a button would be to add a field to your model object class to represent the state that the change of colour represents. Perhaps you even have a candidate field already. When you click the button, update the field in the object, call listView.RefreshObject(...), and yes, create a FormatCell / FormatRow event that will take care of the rest for you.
There may be other approaches, but using FormatCell / FormatRow and switching on fields within the model objects is what I use and I believe it's the intended approach with OLV.
I use the property "Tag" to store a integer. I override Equals and GetHascode to use the Tag to differentiate the object.
I have also implemented ICloneable to change the Tag for a clone because it's my program that clone the object (normal behaviour).