itemdatabound

How to only display certain images in a folder into a Repeater in ASP.NET

I have a Repeater that takes all my images in a folder and display it. But what code changes must i make to only allow lets say Image1.jpg and Image2.jpg to be displayed in my repeater. I dont want the repeater to display ALL the images in my folder. My Repeater <asp:Repeater ID="repImages" runat="server" OnItemDataBound="repImages_Ite...

How do I access datasource fields in an ASP.net Repeaters ItemDataBound event?

Hi I have a Repeater control that is being bound to the result of a Linq query. I want to get the value of one of the datasource's fields in the ItemDataBound event, but I'm not sure how to do this. Regards Peter ...

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...

ListView ItemDataBound - determine if item is AlternatingItem?

I'm using the Listview to display my data. On the ItemDatabound event I want to do some manipulation and change some of the data being displayed. When I check the Item on this event I am using the following code, But I need to know if the item is an alternating item as this will effect what I want to do with the row. Can anyone point me ...

Styles in dataList control

In the ItemDataBound handle i set backgroud color to some items: protected void MyDataList_ItemDataBound(object sender, DataListItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { TextBox cellTextBox = (TextBox)e.Item.FindContro...

Repeater itemdatabound event value type and reference type

Im trying to bind a list with datetime objects to my repeater. if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item) { DateTime actualDate = e.Item.DataItem as DateTime; } When I want access the itemdatabound event on the repeater Then I get an errorme...

Set Dropdownlist value in listview on itemdatabound

hello, i have dropdownlist of year which is coming dynamically.i have filled the dropdownlist using object datasource.on inserting in the listview control it is working fine. but when i click on edit button that dropdownlist value should be set which is coming from the database. e.g. if i have a row which contains Year=2006 an...

Listview: So you think you know itemDataBound?

In my webpage i use the following in order filling the listview control <asp:ListView ID="ListView1" runat="server"> <layouttemplate> <asp:PlaceHolder id="itemPlaceholder" runat="server" /></layouttemplate> <ItemTemplate> <tr> <td><asp:Label ID="Label1" runat="server" Text = '<%# DataBinder.Eval(Container.DataItem, "Ans1") %...

ASP.NET Button click not caught (button in user control which is dynamically loaded in Repeater)

I have written a user control that captures some user input and has a Save button to save it to the DB. I use a repeater to render a number of these controls on the page - imagine a list of multiple choice questions with a Save button by each question. I am loading the user control inside the repeater's ItemDataBound event like this (co...

How to keep a trace of a record inside a nested repeater?

Hi, I have the following implementation: As you can see I have a repeater (listing the Machines) and a nested repeater (listing the WindowsServices inside each Machine). For each Windows Service I can perform an action using a button. However, to perform this action I need to know which Machine and which WindowsService are concerned....

ItemDataBound 'e.item.dataitem("key")' with ListView Control

With the ASP.NET Repeater control, I am used to being able to access my data item values in the ItemDataBound Event Handler by doing: e.item.dataitem("column_name") However, it seems with the ListView control this is not possible. How can I access the data item values? ...

LINQ2SQL: how to delete entity by retrieving it from datagridview?

Hi2all! I have a datagridview and attached list of Employees to it, somthing like this: IQueryable<Employee> data = (from em in db.Employees where em.StationID == stationID select em); dgvView.DataSource = data; Now I want to delete specific Employee by selected row in datagri...