Skip to main content

igRating

Namespace: Wisej.Web.Ext.Ignite

Assembly: Wisej.Web.Ext.Ignite (4.1.0.0)

The igRating control is an HTML 5 capable jQuery widget that lets users rate an item by selecting a number of votes (stars).

public class igRating : igBase

Constructors​

Instance member igRating()​

Constructs a new instance of the igRating class.

Example:

The following example creates a rating control and configures it through the Options object.

var rating = new igRating();
rating.Options.voteCount = 5;
rating.Options.value = 3;
rating.Size = new Size(200, 40);
this.Controls.Add(rating);

Instance member igRating(options)​

Constructs a new instance of the igRating class using the specified options.

NameTypeDescription
optionsObjectInitial set of options passed to the igRating widget: an anonymous object, a JSON string or a dynamic object.

Example:

The following example creates a rating control that accepts half votes and handles the valueChange event to read the rating selected by the user.

var rating = new igRating(new
{
voteCount = 5,
value = 3.5,
precision = "half"
});
rating.Instance.onValueChange += new WidgetEventHandler(this.rating_ValueChange);
this.Controls.Add(rating);

private void rating_ValueChange(object sender, WidgetEventArgs e)
{
AlertBox.Show($"Rated {e.Data.value} (was {e.Data.oldValue}).");
}

Implements​