Numeric UpDown Control for Xamarin Forms - xamarin.forms

Can any one Please provide Numeric UpDown Control demo with Xamarin Forms
Does this control Available in Xamarin Forms?
thanks
Prashanth

See edit #2.
No there is not a spinner control out-of-the-box. If you do not want to get creative, you could use the Picker control and insert predefined values into it. Picker info here.
Otherwise it would be pretty trivial to create an up and down Button and an Entry or Label. Clicking the up Button increments a number in the Entry or Label. Clicking the down Button decrements a number in the Entry or Label.
*Edit: Just happened to land on Syncfusion's NumericUpDown control which does want you want. You can also get a free community license for the control if you are a lone developer or a group of 5 or fewer people. Community License info here
*Edit #2: Was looking through the Xamarin Views list page here and saw that actually do have a Stepper control now!

You can use Stepper for this:
XAML
<Stepper Value="5"
Minimum="0"
Maximum="10"
Increment="0.1"
HorizontalOptions="LayoutOptions.Center"
VerticalOptions="LayoutOptions.CenterAndExpand"
ValueChanged="OnValueChanged" />
C#
void OnValueChanged(object sender, ValueChangedEventArgs e) {
lbldisp.Text = String.Format("Stepper value is {0:F1}", e.NewValue);
}

https://learn.microsoft.com/en-us/dotnet/api/xamarin.forms.stepper?view=xamarin-forms
maybe this could help. you might want to write a custom render for putting that textBox in between the -/+ buttons but sure if you can use as it is, it works fine.

Related

Reading Label Barcode in asp.net mvc4

I am developing a web application in which we have generated labels with barcode. Now we need to read these labels during packing stage.
I understand that Barcode scanners work as keyboard entry so I have created a View with text box to read the barcodes from labels. When I scan any label its reading barcode and automatically directing to some search page.
View
<td>
#Html.TextBoxFor(model => model.StyleNumber)
#* <input type = "text" style="border:0px;" value = "" />*#
</td>
There are 2 issues :
Automatically append row with a text box with for each label
Not to direct to some other page and have all the scanned labels on the same page to be read and used for further processing.
I have tried a lot but didn't find anything concrete. Please advise.
I'd like to suggest to move in this direction:
Obtain technical specification of barcode reader
Barcode should add some "begin and ending char" before and after the barcode read
Example if you barcode in 123456 reader can add 123456/n
where /n is new line or something else
You can monitor keydown of text field and monitor when text change and you detect ending character, at this point you can submit the form that contain your textbox. You can use javascript/Jquery
http://www.aaronkjackson.com/2011/02/quick-tip-use-jquery-to-submit-a-textbox/
This example if the first that I've found but it can be improved for example sumitting a form without button
You can perform barcode validation on server side
At this point you can process barcode on server side and return void from controller method. Y
You can improve solution providing some better user experince for example validating barcode client side or hide the text control or submit data using jquery insted of form like this:
How to send data in jquery.post to mvc controller which use ViewModel as parameter?
Pay attention on setting focus over control otherwise if user ckick mouse out of text control the text read form barcode reader isn't inserted into textbox.
I think that could be possibile develop some ActiveX but this is more invasive solution
HTML5 is your answer. But it will work in HTML5 compatible browser only. If you are targeting older version of browser you need to create Activex which is pretty old and not secure.
There is a jquery plugin for reading QR and Barcode which is worth looking into it.
http://dwa012.github.io/html5-qrcode/
Another way is doing capturing it on mobile devices with HTML5
http://www.html5rocks.com/en/tutorials/getusermedia/intro/
There is a paid option also.
http://www.visionsmarts.com/products/barcode-shell.html

How to disable hyperlink button in devexpress gridview

I am using devexpress for windows application. I am having a devxgrid which populates the data and at the last column, I have a hyperlink button named cancel. When I click the cancel button it will do some functionalities that is working great. After that the corresponding cancel button should be disabled. How to make it disabled? Any help is greatly appreciated.
There are two ways to implement this task:
Create two ButtonEdit repository items. One with the enabled button and another with the disabled button. Then handle the GridView.CustomRowCellEdit event and pass the necessary repository item to the e.RepositoryItem parameter according to a specific condition. Please see the Assigning Editors to Individual Cells help topic for additional information.
If the button editor has several buttons and their Enabled state must be changed dynamically, you can implement this functionality by handling the GridView.CustomDrawCell event as shown in the following DevExpress Forum thread:
How to display disabled buttons for particular cells within a ButtonEdit column
.
But you should follow the first approach, In case of hyperlinkEdit., for your implementation logic add a custom column with bool values, that will give you condition that whether you will show enabled or disabled hyperlinkEdit repository edit.
If you just want to set this readonly then you do in following way:
you can make the editor read only by handling CustomRowCellEdit:
private void gridView1_CustomRowCellEdit(object sender, CustomRowCellEditEventArgs e)
{
if(code goes here)
e.RepositoryItem.ReadOnly = true;
}
you can also prevent the editor from being show by handling ShowingEditor:
private void gridView1_ShowingEditor(object sender, CancelEventArgs e)
{
if (code goes here)
e.Cancel = true;
}
Hope this help you to solve your task..

Dataform and toolkit NumericUpDown in Silverlight 5 not working as expected

We have just migrated an old Silverlight 4 app to Silverlight 5 and have noticed a problem with one of our Dataforms. The Dataform in question contains a NumericUpDown control from the SL5 toolkit. We have noticed that the CommitEdit doesn't appear to fire (i.e it returns false) in the following scenario:
1) Open the popup window containing the DataForm
2) Change the value in the NumericUpDown control by either clicking on the up or down arrows.
3) Click on the Save button connected to the Dataform.
The Click event code connected to the Save button is as follows:
private void OKButton_Click(object sender, RoutedEventArgs e)
{
if (updateUserDataForm.ValidateItem())
updateUserDataForm.CommitEdit(true);
else
updateUserDataForm.CancelEdit();
}
The XAML is:
<toolkit:DataField Label="Display Order" LabelStyle="{StaticResource LabelStyles}" HorizontalAlignment="Left">
<toolkit:NumericUpDown Minimum="1" Maximum="200" Value="{Binding DisplayOrder, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ValueChanged="NumericUpDown_ValueChanged"/>
</toolkit:DataField>
The CommitEdit works fine when you first give another control on the form focus before clicking on the Save button. We never had this behaviour when we were using the DatForm and NumericUpDown controls from the SL 4 toolkit. Is this an issue that has been introduced with the SL5 toolkit?
OK it appears that this is actually a bug:
http://forums.silverlight.net/t/182569.aspx/1
I have fixed it by extending the NumericUpDown control as described here:
http://silverlight.codeplex.com/workitem/4633
I'm sure this must be a bug specific to the SL5 toolkit.

What is the easiest way to disable a form but keep it readable?

I have my form fields in a Panel which, if a read-only version is required, I set Enabled = False on the Panel. This was quick and dirty and the results are mostly dirty, mostly in IE. Can't scroll through large ListBoxes. Multi-line TextBoxes only show the first few lines. There's some funky styling to disabled Labels.
Do you have any ideas as to how to disable an entire form, letting the user read the data, visually indicating that it is disabled (gray input or text in place of input), but to the server keep the control disabled so it's not loading any data that could be manipulated by enabling fields by nefarious means.
(Also, I'm hoping I don't have to add a label corresponding to each data field.)
You could remove all the buttons and use jQuery to change the background color on all inputs. This would be a quick and easy solution.
$(':input').addClass('disabled');
You can have your fields assigned the readonly attribute, ie:
<input type="text" name=myText value="Enter Your Name" readonly>
This can easily be done with js but is more robust if done right in html.
You could also disable or even remove the submit button.
I would use the ASP web controls. The TextBox for the input type="text".
All web controls have the enabled property
<asp:TextBox id="txtSomething" runat="server" />
You can now enable/disable all controls from code like you do today (for the panel). But you have to do it for every one (I don´t know how many you have).
txtSomething.Enabled = False
You can also do this with JavaScript.
Loop all elements in the form, and disable/enable them.
function DisableEnableForm(myForm,setDisable){
elems = myForm.elements;
for(i=0;i<elems.length;i++){
elems[i].disabled = setDisable;
}
}
You can trigger this JavaScript function from ASP like this:
Button1.Attributes.Add("onclick", "javascript:DisableEnableForm(´form1´,true)");

creating help for asp.net website

My requirement is to have database based help system for asp.net website, as shown in the image below. i have searched web but could not find even remotely related solution.
DNN Help System http://img3.imageshack.us/img3/6720/dnnhelpimage20091125.jpg
You could assign each help item a unique ID (perhaps GUID to make it easier to generate by the developer enabling help for that item).
Clicking on the link opens a dialog, tooltip, new window, whatever. Just have the UI load the help text by ID from the database.
To make this easier to implement in the UI, there are a few ways. Perhaps you can create a jQuery client-side behavior.
your HTML would look something like:
<span class="help" id="#{unique-id-here}">Admin</admin>
and you could have jQuery on DOM load:
$(function() {
var help = $(".help");
help.prepend("<img src=\"path/to/images/help.png\" />");
help.click(function() {
//do something with this.id; open a popup, a title bar, whatever.
}
});
We did it on our site by doing the following:
We have a HelpTopics database with a HelpTopicId and HelpTopicText
We create an aspx page that displays the HelpTopicText based on the HelptopicId passed in the querystring.
We set up a css class for the A tag that displays the link to the help with the question mark image.
We created a UserControl named TitleandHelp that contained a link to the page mentioned in step 2 and the style for the link set to step 3 above: The usercontrol has a public rpoperty for the title and one for the topicID (We called it HelpContext).
We add the usercontrol to the aspx page where appropriate
<uc2:titleandhelp ID="titleandhelp1" runat="server" HelpContext="4" PageTitle="Forgot Password" />
it may sound like a lot of work, but really it only takes a half hour or so to do all of the setup. The rest of the work lies in populating the table and dragging the usercontrol onto the pages where appropriate.

Resources