repeater

ASP.NET: Accessing data associated with the RepeaterItem on Command execution.

Hi guys, I want to access the data associated with the RepeaterItem in which an ItemCommand fired up. The scenario is, I have multiple RepeaterItems which Button controls in which the Command is set declaratively like this: <asp:Repeater ID="Repeater3" runat="server" DataSource='<%# ClientManager.GetClientEmployees(Eval("ClientID")) %>'...

Setting MyLabel.Text in Repeater's HeaderTemplate

Every sample I've found of doing this consists of writing a function outside of my page's OnLoad in order to do this, but I'm curious if there's a more concise way to go about it. I have a Label inside of a HeaderTemplate, and I just want to set the text of the label to a string. I can do the following if the label is outside the repeate...

Which User Control event comes between data binding (other controls) and Render?

I'm currently building a user control that displays a message when a Repeater is empty. The idea is simple, provide the user control with the ID of the Repeater. When the user control is rendered look up the Repeater and check Items.Count. If it's zero then display the message. I would like to add one more feature though. I want to be ...

ASP.Net Repeater control

I've been trying everything I know to change the color of a row in an asp:repeater control. What I'm trying to do is this: Based on a value, I want to be able to set the color of a record in the repeater control. I've tried DIV tags, can't make it work. How do I go about this? Thaks ...

What control is used on StackOverflow to display posts?

Hi guys, I am building a site in ASP.NET MVC. I intend to replicate the way StackOverflow displays its posts. Are these guys using a repeater control in ASP.NET MVC? I do want complete control on the markup rendered, but I also want pagination. What is the best approach in such a case. ...

ASP.NET repeater issue (+ question about best practices)

I am fairly new to ASP.NET and I discovered repeaters recently. Some people use them, other don't and I'm not sure which solution would be the best practice. From what I've experienced, it makes simple operation (display a list) simple, but as soon as you want to do more complicated things the complexity explodes, logic wise. Maybe it...

How do I programmatically add an unknown number of columns to an ASP.NET page using a repeater where some of the columns are declared at runtime in the SQL string?

I am declaring a SQL string that looks something similar to the following: string SQL = "SELECT Column1, Column2, Column3, Date1, Date2 FROM Somewhere"; The number of columns can vary by circumstance and the dates can be called different names such as StartDate, InterestDate and so on. What I would like to do is bind this to an ASP.N...

VB.NET Repeater Simple Data Binding Without Datasource

I've got a form that has to be a repeater on a webpage. I have a number parameter that tells me how many additional customer details are to be added. In this page I have a repeater control that needs to repeat items a set number of times. For each item there is a set of input boxes that needs an id appended to it. All I need to bind is a...

How do I bind an ASP.NET Repeater Control to an IList<String>?

I've never had to do this, but I'm binding a repeater to a generic list of Strings, and I'm not sure of the correct syntax. If I was binding to an IList and myType had a property LayerName I'd use this: <asp:Repeater ID="rptChecks" runat="server"> <ItemTemplate> <input type="checkbox" id="<%#Eval("LayerName") %>"/> ...

nested dictionary to nested repeater asp.net c#

Hi, I'm making an asp.page that will display hierarchical information about company assets. To grab the data I used a lambda expression: FASAssetInfoDataContext fasInfo = new FASAssetInfoDataContext(); var data = from g in fasInfo.Asset_Informations where g.Department.Substring(0, 3) == p ...

How can I stack an unknown number of ASP.NET Repeaters?

Hello all. I am building a pop-out menu, and the client wants it to be able to pop out continously based on a heirarchy. For example, the first pane is a list of options. When they are hovered over, another pane should pop up next to it with the next level of options, and so on until the last level of options is reached. I can handle ...

"Action" column in a DataReader

I have an "action" column in my repeater which shows actions a user can select for an item. The column contains ASP.NET HyperLink or LinkButton controls. Some actions are based on whether a user is in a role, which I determine programatically. I'm struggling with the best way to dynamically generate this column when I populate the rep...

Display list of events in a GridView / Repeater / ListView

I'm going to be developing an events calendar page which will display a list of events for 12 months from the current date (it will be read-only). It's easy enough to grab the data from the DB with a SP passing in the start date and number of months etc, but I need to group the information by month when it is displayed in the page. e.g. ...

repeater .net properties and methods

With a .NET repeater is there anyway to call methods in the #Eval('') directive? For example, if I am binding to an object with a DateTime property, it would be really convenient to set #Eval("ADateTimeProperty.ToString('hh:mm')") or something along those lines. Is the only option to create another property with that returns a formatte...

How do I set controls' values of a repeater control regardless to their data

This is the repeater: <asp:Repeater ID="rptrReports" runat="server"> <ItemTemplate> <div style="margin: 2"> <asp:Label ID="lblAccount" runat="server" Text='<%#Eval("Account").FullName%>' />&nbsp; <asp:TextBox ID="txtDescription" runat="server" MaxLength="256" Text='<%#...

ASP.NET: Bind a value to a custom user control inside a repeater

I have an ASP.NET control that binds data to a repeater. Inside that repeater, I have another custom user control. I want to pass a value to this second control based on the current binding item. <asp:Repeater runat="server" ID="ProductList"> <ItemTemplate> <p>Product ID: <%# Eval("ProductID") %></p> <myControl:MyCoo...

string [,] and repeater

Hello How do I write out my array with a repeater? string[,] month = { {"Januari", "Februari", "Mars", "Apri", "Maj", "Juni", "Juli", "Agusti", "September", "November", "Oktober", "December"}, {"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"} }; Now I can use Container.Data...

ASP.NET: "Object Required" when repeating LinkButtons in an UpdatePanel

I have an UpdatePanel which has a Repeater repeating LinkButtons. When I click a LinkButton, the page does a partial postback, then I get a javascript error: "Object required". I tried debugging the javascript, but couldn't get a call stack. If I remove the UpdatePanel, the LinkButtons do a full postback, and they disappear from the ...

e.Item.FindControl throws Object reference not set to an instance of an object.

Here is the part of Repeater code that throws exception... "Computer.Administrators" is StringCollection object. Debugger shows that "AdminsEnumerator.Current" gets correct string value but when "txtAdministrators.Text" tries to set value - exception is thrown. Please help with ideas. <asp:Repeater ID="repeatAdministrators" OnItemDataB...

asp:Repeater - How to make "StringEnumerator" move to next item in "ItemDataBound"?

Here is the snapshot of repeater code. I have problems with geting all the values. In result my "repeater" prints only first element in collection. <asp:Repeater ID="repeatAdministrators" OnItemDataBound="repeatAdministrators_ItemDataBound" runat="server"> <HeaderTemplate> <tr> <td...