repeater

only one radiobutton selection in repeater

这一生的挚爱 提交于 2019-11-29 08:16:43
I want to select only one radio button but I cant do this. Here is my code: <asp:Repeater ID="Repeater_secenekler" runat="server" DataSource='<%#Eval("Secenekler")%>'> <HeaderTemplate> <table> </HeaderTemplate> <ItemTemplate> <tr> <td style="margin-left: 20px;"> <asp:CheckBox ID="CheckBox" runat="server" Text='<%#Eval("OptionName")%>' Visible='<%# Eval("TypeId").ToString() == "1" %>' /> <asp:RadioButton ID="RadioButton" runat="server" Text='<%#Eval("OptionName")%>' Visible='<%# Eval("TypeId").ToString() == "2" %>' GroupName="RadioButtonGrup" /> </td> </tr> </ItemTemplate> <FooterTemplate> <

force a string to 2 decimal places

与世无争的帅哥 提交于 2019-11-29 05:29:22
i have a repeater item that displays a double. occasionally the double seems to be coming out with 3 decimal places like this 1165.833. im trying to force it to two decimal places by wrapping it in a string.format method but it still comes out the same: <%# String.Format("{0:f2}",DataBinder.Eval(Container.DataItem, "pricerange").ToString())%> any ideas why? String simply does not implement IFormattable . To use the formatting, remove .ToString() so that you aren't passing in a String. <%# String.Format("{0:f2}",DataBinder.Eval(Container.DataItem, "pricerange"))%> To see this more explicitly,

How can I loop through Items in the Item Template from an asp:Repeater?

我的梦境 提交于 2019-11-29 04:47:49
问题 I have a repeater, which is bound on preRender with items. In the Item template each row has a check box. This works fine. I'm trying to loop through all the checkboxes in the item template after it has been bound. Is there any way of doing this? 回答1: It sounds to me like you want to use the ItemDataBound event. http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.repeater.itemdatabound.aspx You will want to check the ItemType of the RepeaterItem so that you don't attempt to find

Accessing Textboxes in Repeater Control

独自空忆成欢 提交于 2019-11-28 23:04:34
All the ways I can think to do this seem very hackish. What is the right way to do this, or at least most common? I am retrieving a set of images from a LINQ-to-SQL query and databinding it and some other data to a repeater. I need to add a textbox to each item in the repeater that will let the user change the title of each image, very similar to Flickr. How do I access the textboxes in the repeater control and know which image that textbox belongs to? Here is what the repeater control would look like, with a submit button which would update all the image rows in Linq-to-SQL: alt text http:/

JSF2 Paging / Pager for Repeater

 ̄綄美尐妖づ 提交于 2019-11-28 19:20:21
问题 Do you know this feeling when every code you write works immedietly and you underrun your schedule :-P It's like 'oh yeah now I have time to make it perfect'. That's where I am at the moment^^ So I implemented a repeater with JSF (ui:repeat) and I thought about a paging for all the entities. Is there maybe an easy way to do that? What are the points I have to think about? Would be nice if someone gives me some help. My googleskills haven't helped me so far :-P Cheers... 回答1: Here is a simple

How to use paging with Repeater control in ASP.NET?

旧时模样 提交于 2019-11-28 18:57:46
<asp:Repeater ID="RepCourse" runat="server"> <ItemTemplate> <div style="width:400px"></div> <div class="course" style="float: left; margin-left: 100px; margin-top: 100px"> <div class="image"> <asp:Image ID="imgteacher" runat="server" Height="150" Width="248" ImageUrl='<%# "ShowImage.ashx?id="+ DataBinder.Eval(Container.DataItem, "CourseID") %>'/> </div> <div style="margin-left: 3px; width: 250px"> <div class="name"> <a href="#"><asp:Label runat="server" ID="lblname" Text='<%#Eval("CourseName") %>'></asp:Label></a> </div> <div style="height: 13px"></div> <div id="teacher"> <a href="#"><%#Eval(

ASP.NET repeater alternate row highlighting without full blown <alternatingitemtemplate/>

*爱你&永不变心* 提交于 2019-11-28 16:48:31
I'm trying to accomplish simply adding a css class to a div on alternate rows in my <itemtemplate/> without going to the overhead of including a full blown <alternatingitemtemplate/> which will force me to keep a lot of markup in sync in the future. I've seen a solution such as http://blog.net-tutorials.com/2009/04/02/how-to-alternate-row-color-with-the-aspnet-repeater-control/ which I'm tempted to use but this still doesn't "smell" right to me. Has anyone else got a more maintainable and straightforward solution? Ideally I'd like to be able to do something like: <asp:repeater id=

Populating DropDownList inside Repeater not working

谁说我不能喝 提交于 2019-11-28 12:37:35
I'm trying to populate a dropdown list inside a repeater, but I'm not being very successful. I'm probably using the wrong EventArgs e . Here's my aspx code: <asp:Repeater runat="server" id="criteriaScore"> <HeaderTemplate> <ul> <li class="header"><span class="item">Kriterie</span><span class="value">Poeng</span><span class="description">Beskrivelse</span></li> </HeaderTemplate> <ItemTemplate> <li> <span class="item"> <%# Eval("criteria") %>:</span> <asp:DropDownList id="ddlRating" runat="server" autopostback="true" enableviewstate="false"></asp:DropDownList> <span class="value score<%# Eval(

ASP.Net: why is my button's click/command events not binding/firing in a repeater?

橙三吉。 提交于 2019-11-28 09:18:59
Here's the code from the ascx that has the repeater: <asp:Repeater ID="ListOfEmails" runat="server" > <HeaderTemplate><h3>A sub-header:</h3></HeaderTemplate> <ItemTemplate> [Some other stuff is here] <asp:Button ID="removeEmail" runat="server" Text="X" ToolTip="remove" /> </ItemTemplate> </asp:Repeater> And in the codebehind for the repeater's databound and events: Protected Sub ListOfEmails_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles ListOfEmails.ItemDataBound If (e.Item.ItemType = ListItemType.Item) Or (e.Item.ItemType =

Bind 5 items in each row of repeater

自闭症网瘾萝莉.ら 提交于 2019-11-28 09:05:05
问题 I have a set of items coming from the database. Their number may vary. I have bound them in a repeater. Now my following example will explain what I want: I have 11 items coming from database, I want them to be grouped in terms of 5 items per row. 1st row: 5 items. 2nd row: 5 items. 3rd row: 1 item. Currently, I am just binding them in a repeater. How do I do this? 回答1: Yes. It is possible: <asp:Repeater ID="rptItems" runat="server"> <ItemTemplate> <asp:Literal runat="server" Text='<%# Eval(