Homam
Homam

Reputation: 23841

How to set two bindings in one expression

I have the following binding in my GridView:

Text='<%# Bind("FromDate", "{0:dd/MM/yyyy}") %>'

I would take the format from the web config instead of hard coded value.

'<%$ AppSettings:EditDateFormat %>'

How can I do that?

Upvotes: 2

Views: 74

Answers (1)

A_Nabelsi
A_Nabelsi

Reputation: 2574

How about this? this should work,

Text='<%# Bind("FromDate", "{0:" + System.Configuration.ConfigurationManager.AppSettings["EditDateFormat"]) +"}" %>'

Upvotes: 1

Related Questions