I have a databound datagrid and wish to show only the leftmost 10 characters of a certain string field in a certain column. How would I do that ?
Thanks
SELECT tblID, Substring(tblText,1,10) AS halfString FROM tblStuff
That way, if you have Columns autogenerated, it would only load the 10 characters. Change the halfString to something more user friendly - AS 'My Field'
if you specify the columns, do HeaderText="My Field" DataField="halfString
JohnnyBGoode - I could not get your proposal to work.
adamroof - I had thought of your proposal before I posted the question, but could not get it right. However after I read your post and done some fiddling in which I substituted your substring() with mid() I got it to work correctly. Have a star.
This is a very interesting problem many people would have. Ultimately I settled for the solution that fetched the whole field and turned item wrapping off.
Thanks guys.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.