Skip to main content

Posts

Showing posts with the label radiobuttonlist

RadioButtonList SelectedIndexChanged event in asp.net c#

SelectedIndexChanged event in RadioButtonList RadioButtonList is an ASP.NET list web server control that provides a single selection radio button group. RadioButtonList can be populated statically or dynamically from a data source object. RadioButtonList contains an item collection that holds ListItem objects. Each ListItem object represents an item (radio button) in RadioButtonList control. RadioButtonList OnSelectedIndexChanged method raises the SelectedIndexChanged event. This method allows us to provide a custom handler for the SelectedIndexChanged event. RadioButtonList SelectedIndexChanged event occurs when the item selection changes between posts to the web server. This event works only when we set the RadioButtonList control's AutoPostBack property value to True. AutoPostBack property gets or sets a value indicating whether a postback to the server automatically occurs when the user changes the list selection. So when the us...

How to use RadioButtonList AutoPostBack in asp.net c#

AutoPostBack feature in RadioButtonList The following ASP.NET C# example code demonstrates to us how can we use the RadioButtonList AutoPostBack property/feature. RadioButtonList is an asp.net list web server control that renders a radio group on the web page. RadioButtonList provides a single selection/check radio group. Users can select an item from RadioButtonList at a time. We can get the user selection from a RadioButtonList after page submission to the web server. RadioButtonList control has a property named AutoPostBack which allows us to automatically submit the page to web server each time the RadioButtonList item selection is changed. AutoPostBack property accepts a Boolean value. If we set the AutoPostBack property value to true then each time we change the RadioButtonList item selection, it posts the web page to the server. If we set the AutoPostBack property value to false then it does not post the page to the server when we ch...

asp.net - Add an item to a RadioButtonList programmatically

Add list item to RadioButtonList programmatically RadioButtonList is an ASP.NET list web server control that allows us to render a single selection radio button group in the web browser. RadioButtonList control contains an item collection that holds all ListItem objects. We can populate a RadioButtonList control statically by declarative syntax. We also can populate a RadioButtonList control dynamically by data binding with a data source object. RadioButtonList server control has built-in properties and methods to customize it. We can change the default look and feel of a RadioButtonList control. Even we can programmatically add or remove items from its items collection at run time. Each ListItem object has three possible properties those are Text, Value, and Selected. We can create a ListItem object programmatically. We also can add this ListItem object to RadioButtonList control's Items collection programmatically. Items collection'...

asp.net - DataBind a RadioButtonList with an array

DataBind a RadioButtonList with array The following ASP.NET C# example code demonstrates to us how can we data bind a RadioButtonList with an Array data source. RadioButtonList is an ASP.NET list web server control. RadioButtonList control renders a radio group on the web page. RadioButtonList’s each ListItem object renders a single RadioButton with the same group name. We can populate RadioButtonList items from various data sources such as SqlDataSource, ObjectDataSource, Array, ArrayList, Generic List, Dictionary, etc. The Array is a popular data source object to data bind with a list web server control such as RadioButtonList, BulletedList, ListBox, etc. Each element from the Array object creates a new ListItem object when we data bind a list server control with the Array data source. To populate a RadioButtonList with an Array data source is very simple in the ASP.NET C# environment. First, we need to create an Array object. Next, w...

asp.net c# RadioButtonList control example

RadioButtonList control example RadioButtonList is an ASP.NET list web server control. RadioButtonList control renders a group of radio button controls where each radio button shares the same group name. RadioButtonList control encapsulates a radio group. RadioButtonList control each ListItem object is renders a single radio button control. RadioButtonList control's items exist in an items collection. So we can manage (edit, insert, and delete) RadioButtonList item collection by the .NET framework's Collection Class methods and properties. RadioButtonList control has many built-in properties to design and style the control itself such as BackColor, ForeColor, CssClass, etc. We also can customize its items level style by core CSS style such each different colors for different items. RadioButtonList control's AutoPostBack property and SelectedIndexChanged event allow us to quickly get the user's item selection after each tim...

How to use RadioButtonList control in asp.net c#

RadioButtonList web server control ASP.NET RadioButtonList control enables the user to select an item from the list. RadioButtonList supports data binding programmatically from the database. We can also populate it manually by inputting a list of items inside the RadioButtonList tag. RadioButtonList is a single selection radio button group. RadioButtonList has an item collection. We can determine which item is selected by testing its SelectedItem property. We can change RadioButtonList design by setting up its various property as like BackColor, BorderColor, BorderStyle, BorderWidth, CellPadding, CellSpacing, CssClass, Font-Bold, Font-Italic, Font-Names, Font-Overline, Font-Size, etc. there are more three properties RepeatColumns, RepeatDirection, and RepeatLayout which help you to place list item vertically or horizontally. RadioButtonList has standard AutoPostBack property. As with other list control, RadioButtonList has an excellent event Sel...