LuisEstebanValencia
asked on
LINQ to Sharepoint problem with choice fields
I created a list with a choice column called price
Values for example:
5 per user/month
10 per company/month
When I generate the linq to sql entities using spmetal this becomes an enum and it rewrites the values to something like:
_5peruser_month
_10_percompany_month
Then in a repeater I need to show that data, I need to show the real value.
protected void WrapsRepeater_ItemDataBoun d(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingIt em)
return;
string price = ((Entities.Wrap)e.Item.Dat aItem).Pri ce.Value.T oString();
Literal litprice = (Literal)e.Item.FindContro l("WrapPri ce");
litprice.Text = price;
}
what can I do?
Values for example:
5 per user/month
10 per company/month
When I generate the linq to sql entities using spmetal this becomes an enum and it rewrites the values to something like:
_5peruser_month
_10_percompany_month
Then in a repeater I need to show that data, I need to show the real value.
protected void WrapsRepeater_ItemDataBoun
{
if (e.Item.ItemType != ListItemType.Item && e.Item.ItemType != ListItemType.AlternatingIt
return;
string price = ((Entities.Wrap)e.Item.Dat
Literal litprice = (Literal)e.Item.FindContro
litprice.Text = price;
}
what can I do?
and BTW using the api should return the values in a format you expect
ASKER
I am sorry but that was not my question., I need to know how to return the original value in linq. simple question
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here's a link to the 2007 SDk http://msdn.microsoft.com/en-us/library/ms550992%28v=office.12%29.aspx
and here's a link to the 2010 SDK
http://msdn.microsoft.com/en-us/library/ms550992%28v=office.12%29.aspx
here's an artilce about the 2010 SDK
http://blogs.msdn.com/b/randalli/archive/2010/05/24/download-the-sharepoint-2010-sdk-software-development-kit.aspx