Gridview Formatting is poor.

E

Edwin Knoppert

I want to format a hyperlink bounded field.
Fields *could* have http:// *or not* in the websitename entered.
I want to format this to http://website.com otherwise i'll get a relative
link.

I know the itemtemplate workarounds or through row events.
It's that i'm trying to use the internal format stuff itself.
Is this possible?
 
P

Patrice

I would handle this at the query level (or even when the data is entered).
It allows to make sure you have the protocol info instead of relying each
time you need it on formatting to get the proper value.

Not familiar yet with the gridview. Doesn't it support databinding
expression ? In the worst case, you could also add a computed column...
 
E

Edwin Knoppert

computed column
I guess this is the same as an itemtemplate.
Yes, i'm looking for a way i can simply insert it in a property rather than
using additional code.
I don't know how, i'm not to clever with expressions and such.
 
E

Edwin Knoppert

There is only a dataformatstring propert accepting {0:} stuff.
I read about that yesterday and it seems limitted.
Only date and number format.

The user which fills in is not interested in a protocol (http://)
Even if we added it on update/insert the user is confronted with the
protocol which he never entered.
Besides i find that result code should be check, not input code.
The result code is what is actually used such in this case simply clicking
it and results in wrong url.
If the format is not able to do this, i'll be forced to stupid eval code
with possibly verify if field was empty.
O well, only the actual link (href) needs to be modified, not what the users
sees per se.
 
E

Edwin Knoppert

Hmm, you might be right.
I guess i need to use some way to invoke a target (is a property) and modify
the url so that the it's not becoming a virtual link.
Frankly, i find it odd that the control not supports a slightly better
handling.
Entering url's without protocol is obvious.

:)
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top