i do believe that this is not possible to do in a list view , but to understand u more , wht is the scenario u r trying to achieve ?
cuz if u r tryin to retrieve 2 different data into 1 column that depends on some kind of an input parameter ,
then u could use 2 approches :
1- create 2 columns and try hide/show 1 of them depending on the input parameter ,
2-create sql stored procedure to handle this thing , i had similar thing handling retrieving data in arabic or english depending to the browser culture ,
if it was arabic then retrieve columns in arabic , if it was english then retrieve columns in english .
Hope it helps!
My scenario is that I have two columns in my database that may contain the same data but in two different languages. Both may not have data. I just want to show them both in one column, since there's no point to have two when many cells could be blank, and it would increase the length of the list view.
I like the show/hide column idea, but that would apply to the entire list whereas it would vary for each record.
I know I could accomplish it with a single control using an expression, but I'd just simply rather not. Plus, the expression would only work for read-only data but not editable data. My data isn't editable, but the fact remains. I was hoping somebody else may have run into this scenario and had a solution without code.
Language translation is a big problem for me also... we have users both in Europe and China, and showing things in navtive languages REALLY has helped us with adpotion.
For most list views we do as Ahmad suggest and use a store procedure when we have the data presented in mulitple columns in the DB. Most of our SPs take a userid as a parameter, it is cumbersome, but we lookup the language value on most of our SPs that do this kind of display.
But, there is one more technique that we use... we've created a custom control that accepts a "term id" as it's value and displays back the language translated string. This is done on the server side so the it is transparent to the user. At runtime, the control has access to both the actual user and the browsers culture so it can best decide how to react. We use local (to the web server) resource files to hold all our language translated terms (really just string resources) so it really is pretty quick and is cached in memory properly. This technique works really well for simple labels, but not so well with list views (I went through some big headaches to make my custom control render during list views). Thus, not really a solution to your specific problem, but I'm grinding down K2 on the some enhancements to make this work in list views also. This is a little difficult to bundle into a market solution because the resource files are specific for our needs, but I'd be happy to share the technique with you if you're intersted.
That's very cool Nathan, but I don't think it works for my requirement regardless.
It sounds more like you're talking about showing one or the other based on the user's language preference, is that correct? In that scenario I think the show/hide column suggestion would work fine. But that's not what I'm trying to accomplish.
I'm just going down the single control with expressions route for now but if anyone knows how to get two controls in a single list view column, please let me know.
Victoria, I reread your post several times and I think I FINALLY undestand your use case. I agree I'm doing something different. Sorry for projecting my problem on you :-)
All, I'm going to bundle my I18n controls into a market control project, just gotta find the time.
No need to apologize! What you are describing is also a pain point for us. Being in Canada we struggle to make K2 workflows and SmartForms both English & French friendly, and I have also raised it to K2's staff at every opportunity. So I still enjoyed and got value from your explanation :)