webForumDet fria alternativet

boundcolumn, DataFormatString

3 svar · 471 visningar · startad av cyprys

cyprysMedlem sedan dec. 20003 105 inlägg
#1

Hur fungerar egentligen detta attribut?
Om jag vill sätta datafield=id men skriva ut i datagriden i stil.

DataFormatString='<%# "DITT ID ÄR " & container.dataitem("id")%>'

hur skriver man då?
Får helt enkelt inget grepp om det...

/r visst asp:templatecolumn funkar men......

NETworkMedlem sedan juni 20011 679 inlägg
#2

Från dokumentationen:

The data format string consists of two parts, separated by a colon, in the form {A:Bxx}. For example, the formatting string, {0:D2}, would format the cell to display a number with two decimal places. The entire string must be enclosed in curly braces to denote that it is a format string and not a literal string. Any text outside the curly braces is displayed as literal text.

Jag gissar att du ska skriva nåt i stil med:

DataFormatString="DITT ID ÄR {0:N}"
cyprysMedlem sedan dec. 20003 105 inlägg
#3

Hittade denna.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuiwebcontrolsboundcolumnclasstopic.asp

/r så måste man klicka sig fram lite i menyn också

elisaMedlem sedan apr. 200432 inlägg
#4

..

..

Genererad på 381 ms · cache AV · v20260730165559-full.f96bc7eb