How to implement text-trimming for silverlight textbox as in textblock? - textbox

How can i implement text-trimming for silverlight textbox to be used with windows phone project? I would like to add an ellipsis to the text content when it overflows the control.

In the silverlight 5.0 , I have been using
TextTrimming="WordEllipsis" TextWrapping="NoWrap"
or from cs use
myTextBlock.TextTrimming = TextTrimming.CharacterEllipsis;
Hope this helps

Related

What does #Html.Sitecore.Placeholder() point to?

In Sitecore 7 MVC, my understanding is that partial views are represented by using Razor declarations such as #Html.Sitecore().Placeholder("some_thing") in a .cshtml file.
In this context, what does the argument "some_thing" actually represent - is it something located in the Sitecore instance? If so, how can I locate the thing that "some_thing" represents within the Sitecore database?
In the shortest way: Sitecore Placeholder is a place where you can add your components.
The argument some_thing in #Html.Sitecore().Placeholder("some_thing") is the name of the placeholder.
You can have multiple placeholders on your page. When you add a component to a page, you tell Sitecore "Put in in placeholder some_thing and that's how Sitecore knows where to place it.
Read Presentation Component Reference for more information (yeah this document is years old, but the idea is still the same).
#Html.Sitecore().Placeholder("some_thing") is typically in a layout page such as your DefaultLayout page. Like Marek said it is a place that you put components. If you log into Sitecore and look into at a page, under the Presentation tab, there is an icon that says Detail. Click that. A pop-up will open (I think it still did in version 7, I dodn't have an instance running. On that popup, select a component or add a new component to the Default Layout. In the settings for the component will be a field called Placeholder. Put the text "some_thing" in there without the quotes. I think this is what you are asking what this is the placeholder representing.

MVC.NET Empty Text

Is there any way in MVC to specify "Empty Text" for text fields?
Empty Text is normally a property give to a textbox to display when text is empty, and is cleared out OnClick.
For example: have the text box say "Enter here..." and then onFocus that text would clear and allow you to type in the entry, however if text is empty, "Enter here..." would display again.
I'm trying to find out if there's any ways to get this out of the box w/o any additional coding, as this feature is widely supported by 3rd Party controls (ie: Telerik's AJAX Controls) does anyone know if MS made any provisions to offer anything similar?
Thanks.
You could use HTML5 placeholder attribute:
#Html.TextBoxFor(x => x.SomeProperty, new { placeholder = "some default text" })
And if you need to support older browsers you could always achieve the same effect with javascript. For example there are existing jQuery plugins such as jQuery.placeholder.
Use placeholder attribute in HTML 5
There's no such thing as what you are referring to in HTML, at least not called that. 3rd party controls have implemented this functionality themselves.
There is, in HTML 5, a property called a placeholder, but this won't appear in non-html5 compliant browsers (IE8, IE7, older versions of FF, etc..)
The only way to do this cross browser is to use javascript to implement the functionality.

Smart GWT HTML Layout

Hello All
I am using smart gwt 2.2, Operating system is Windows xp and browser is Mozilla Firefox.
Before working on the smart gwt I worked on smart gwt-ext.
In gwt-ext I used HTMLTable to give html view to my form. But after using HTMLTable I found TableLayout in gwt-ext, which is more easy to use and manage.
Because for putting element in HTMLTable I have to write complex for loop,
But the TableLayout is rich enough to handle this type of coding.
So I searched some type of Table Layout component in the smart gwt, But not succeeded yet.
So I just want to know that I have a form and for HTML preview Is there better way than HTML Table in smart gwt.
My form will be like this:
If there is 3 text fields then In the first column of the HTML Table will be Label
column on in the second column the control (i.e Text Field) will be putted.
Thanks in advance
Hello All
Chapter 6 "Layout" from the SmartGWT Quick Start Guide.There is Form Layout in the Smart GWT
which also provide the method named RowSpan , ColSpan, NumOfColumns.
So Form Layout can be a substitute of Table Layout (in gwt-ext) in smart gwt.
I asked the exact same question (HTML Table-like Layout) on the SmartGWT forums and never got a reply. I think we're stuck with HLayout, VLayout, HStack and VStack. See Chapter 6 "Layout" from the SmartGWT Quick Start Guide.
You could add HTML Layout to their Wishlist.

FreeTextBox tabs are not preserved at postback

We are using the FreeTextBox 3.1.6 on an intranet. The control appears on an ASP.Net project built in Visual Studio 2008.
When clients enter tabs in the text box, those tabs do not get preserved at postback. Rather, the tabs are lost. Other text formatting, like bold, italics, or font size are preserved.
Even when the postback event that occurs on the web page does not save anything to a database we are loosing the tabs. According to http://wiki.freetextbox.com/default.aspx/FreeTextBoxWiki.Installation the JavaScript and XML used by FreeTextBox are stored in a dll. So I cannot edit the contents of those files.
Has anyone encountered this issue with FreeTextBox? If so, how did you resolve it?
Here is the behavior that occurs. Enter text with tabs in the FreeTextBox control.
alt text http://img132.imageshack.us/img132/4826/ftb1postcz4.gif
Then select the "Save" button. This is a command button that posts back the page. In my test scenario nothing gets saved and loaded from a database. The FreeTextBox control is strictly displaying text that was posted. My guess is that the mechanism handling that is in ViewState, but I'm not sure about that.
alt text http://img132.imageshack.us/img132/175/ftb2postbd6.gif
As you can see, all of the tabs are gone. Even the tabs inserted between words are gone.
Thanks for your help.
Ken
Setting TabMode to "InsertSpaces" did not resolve this. My source code for instantiating the control is below. Pictures I posted didn't previously show up. Visit these links to see them.
http://img132.imageshack.us/img132/4826/ftb1postcz4.gif
http://img132.imageshack.us/img132/175/ftb2postbd6.gif
<FTB:FREETEXTBOX id="txtDocument" EnableHtmlMode="False" Width="100%" runat="server" AllowHtmlMode="True"
StripAllScripting="True" Height="400px" FormatHtmlTagsToXhtml="False"
AutoGenerateToolbarsFromString="true"
ToolbarLayout="ParagraphMenu, FontFacesMenu, FontSizesMenu, FontForeColorsMenu, FontForeColorPicker| Bold, Italic, Underline, Strikethrough; Superscript, Subscript, RemoveFormat| JustifyLeft, JustifyRight, JustifyCenter, JustifyFull; BulletedList, NumberedList, Indent, Outdent; CreateLink, Unlink, InsertImage, InsertRule| Cut, Copy, Paste; Undo, Redo, Print"
TabMode="InsertSpaces"
>
I found the answer. The original programmer had code that intercepted the contents of the textbox when it was submitted. That code reformatted the text for special currency characters like the Yen, Euro, and Pound.
Here is what the code looked like.
Dim hstrg As String = txtDocument.Text
Dim f As New FreeTextBoxControls.Support.Formatter
hstrg = f.HtmlToXhtml(hstrg)
What fixed the issue was commenting out that HtmlToXhtml() method. We don't need the contents to be Xhtml compatible, so this was a viable option for us.
i've been using free text box in some of my former development, but it had some quirks and wouldn't work right in IE.
try moving to FCKEditor, or TinyMCE. they seem like much better experience than FTB. i've chosen FCK, and i think WordPress uses TinyMCE. try them if a switch of editor is an option.

How do I know what scripts do I need for what Ajaxtoolkit control in ASP.Net MVC

I was wondering how do i know what scripts are required for what Ajaxtoolkit control?
for instance i know for Datetime control these are requried in the following sequence
as seen here
BaseScripts.js
Common.js
DateTime.js
Animations.js
PopupBehavior.js
AnimationBehavior.js
Threading.js
Timer.js
CalendarBehavior.js
For an ASP.NET MVC app, follow these directions.
Note, however, that the jQuery date picker is nicer.

Resources