/// <param name="alias">The alias for the column (display name).</param>
public ObjectViewColumn Add(string propertyName, string alias)
this.orderObjectView.Columns.Add("OrderId", "Order number");
==============================
alias seems to be internationalized as display name. why not use propertyName? thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'd also rather use the property name for these things. Problem only is that it has to map to the name of the PropertyDescriptor. That should still be fine, since the PropertyDescriptor has a Name and a DisplayName property, but for some reason the DisplayName is not used by UI controls.
To show friendly names in grid headers we have to set the alias as the name of the PropertyDescriptor.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'll have a look at it. The goal is to stay as close to the DataView as possible.
One question though: wouldn't it be much more efficient to do sorting on multiple fields with queries? I think the ApplySort() method is specifically designed for interacting with UI controls.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
DataView has a Sort property which allows sorting on multiple items, so I thought I was just adding something that DataView offered.
The system I'm working on always caches the DataSet or DataTable. This has proven to be more effient then re-running the query. Doing the sort in the view means that we don't have to go to the DB just for a sort on the data.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ApplySort take a PropertyDescripter parameter which is complex to get,
can it using string parameter?
Yes, a string parameter is possible. In fact, it is already there but for some reason it is not in CVS. I'll have a look at it tonight when I'm home.
have or not isn't series, but simple.thanks
It's in CVS now.
/// <param name="alias">The alias for the column (display name).</param>
public ObjectViewColumn Add(string propertyName, string alias)
this.orderObjectView.Columns.Add("OrderId", "Order number");
==============================
alias seems to be internationalized as display name. why not use propertyName? thanks.
I'd also rather use the property name for these things. Problem only is that it has to map to the name of the PropertyDescriptor. That should still be fine, since the PropertyDescriptor has a Name and a DisplayName property, but for some reason the DisplayName is not used by UI controls.
To show friendly names in grid headers we have to set the alias as the name of the PropertyDescriptor.
Is there a way to sort on Multiple properties similar to the DV.Sort = "COL1 DESC, COL2 DESC"?
No, I don't think so.
I've added support for sorts on Multiple Properties; via OV.Sort = "Prop1 Desc,Prop2". It works great for me, but would love a second pair of eyes.
Who should I send the code to?
I've uploaded the files into the patches section.
I'll have a look at it. The goal is to stay as close to the DataView as possible.
One question though: wouldn't it be much more efficient to do sorting on multiple fields with queries? I think the ApplySort() method is specifically designed for interacting with UI controls.
DataView has a Sort property which allows sorting on multiple items, so I thought I was just adding something that DataView offered.
The system I'm working on always caches the DataSet or DataTable. This has proven to be more effient then re-running the query. Doing the sort in the view means that we don't have to go to the DB just for a sort on the data.
Ah well, that indeed makes sense.