score:-1
Try putting your CheckBoxList binding inside the ItemDataBound event of the repeater.
See:
score:0
add OnItemDataBound event to Repeater :
<asp:Repeater ID="Repeater1" OnItemDataBound="Repeater1_ItemDataBound" runat="server">
then in code behind do something like this :
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
var parameters = (from resx in clParameterDetailDTO
select resx.ParameterType).Distinct();
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
CheckBoxList chkParList = (e.Item.FindControl("chkParList") as CheckBoxList);
chkParList.DataSource = parameters.ToList();
chkParList.DataTextField = "ParameterName";
chkParList.DataValueField = "ParameterID";
chkParList.DataBind();
}
}
Source: stackoverflow.com
Related Articles
- How bind Checklistbox inside repeater control having datasource as LINQ
- How can I bind the single LINQ object to ASP.NET Repeater Control
- display images in repeater control from linq datasource
- Syntax to execute code block inside Linq query?
- I am trying to learn how to bind an IEnumerable LINQ collection to a repeater
- Is there any way to create a LINQ query as a variable without having the data source (yet)?
- LINQ Source Code Available
- creating Linq to sqlite dbml from DbLinq source code
- Bind Gridview Datasource with Linq (asp.net)
- source code for LINQ 101 samples
- Bind distinct data to repeater using linq to object distinct
- C# LINQ Find List Inside Another List, Better way to code this than a foreach loop
- Use LINQ inside an HtmlHelper to bind a specific item of a Collection outside a @foreach
- Bind LINQ Query results to Repeater
- c# Linq or code to extract groups from a single list of source data
- c# WPF bind combobox to TPH in Entity Framework code first using LINQ
- How to bind an Event Handler to a dynamically created control inside of a collection?
- Linq to dataset and display linq result in repeater control
- How can I bind a query with a join to a GridView, with a Linq datasource with a business layer and data access layer
- Concat all strings inside a List<string> using LINQ
- Convert string[] to int[] in one line of code using LINQ
- Code equivalent to the 'let' keyword in chained LINQ extension method calls
- Linq with group by having count
- Linq code to select one item
- How are people unit testing code that uses Linq to SQL
- Calling a method inside a Linq query
- What actually happens when using async/await inside a LINQ statement?
- Using a partial class property inside LINQ statement
- Assigning values inside a LINQ Select?
- Using Linq select list inside list
- Add simultaneity two object depend on each other
- Group by Time(Only hrs part) in linq
- C# Linq OrderBy based on condition
- How to report progress on a long call to .Distinct() in C#
- C# implement raven db full text search by the part of word
- How to write the following query in LINQ
- Converting a given SQL Query to LINQ
- How to link to items in a database and not creating the same item again
- NSubstitute not matching Linq Expression
- Lambda Expressions and searching
- Is it possible to split a value and add an if condition in a LINQ Query?
- Group by Weeks in LINQ to Entities
- Unable to project the anonymous type to model type. (The entity or complex type cannot be constructed in a LINQ to Entities query.)
- Can we use overloaded Where operator in LINQ Query?
- How can I get distinct objects extracted from a property of a list of objects?
- How do I get the value of the Value tag in an XML snippet?
- Entity Framework .Include Load Tables Joined in Different Context
- Query entity and return back a dictionary
- How do I build up dynamic linq queries to solve a set of constraints?
- C# Linq to XML getting the elements where value of name contains a specific string