What is wrong with this code line?

S

Shapper

Hello,

I have a BoundColumn in a datagrid. The DataField must be created using
the Session("culture") value. Shoudn't this work?

<asp:BoundColumn DataField='<% "title_" & Session("culture")
%>'></asp:BoundColumn>

What is wrong?

Thanks,
Miguel
 
G

Guest

BoundColumn is used to show data from data source. It should be

<asp:BoundColumn DataField="Data_Source_Field_Name"></asp:BoundColumn>

HTH

Elton Wang
 
S

Shapper

Yes I know.

But the field name in my case changes with culture.

So, for example, when culture is en-GB I want to use the field
title_en-GB

Cheers,
Miguel
 
G

Guest

In that case, it's better to use TemplateColumn, and in ItemDataBound event
assign data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top