repeater

button event in nested repeater

蓝咒 提交于 2019-12-20 04:50:04
问题 I am using nested repeater and child repeater has a user control in it. <asp:repeater> <asp:repeater> <uc:userControl /> </asp:repeater> </asp:repeater> UserControl saves the information in database and raise the itemsaved event passing success message as event args. I do have public event in usercontrol that will be raised but there is no way I can bind that event in the main page. (it would be really good if I can do that). But I found another way to handle it in parent repeater's

Repeater and add columns to header and itemtemplate on page load

时光毁灭记忆、已成空白 提交于 2019-12-19 19:09:31
问题 I haven't used repeaters for much more than showing data from a datatable. I am building a grid that that shows a list of users and columns of roles that the user has been assigned, shown with checkboxes (shown with true/false below but pretent they are checkboxes). ex. |Rep Name|Caller|Closer|Manager|SuperUser| |Bob |True |true | false | false | |Tom |false |false |True | True | Basically using it for roles management. However the roles may change later on so I want to load the roles(headers

How to access the item being data bound during ItemDataBound?

≯℡__Kan透↙ 提交于 2019-12-19 12:49:18
问题 I want to get at the item that is being data bound, during the ItemDataBound event of an asp:repeater. I tried the following (which was an unaccepted answer in a stackoverflow question): protected void myRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e) { Object dataItem = e.Item.DataItem; ... } but e.Item.DataItem is null. How can I access the item being data bound during the event called ItemDataBound. I assume the event ItemDataBound happens when an item is being data bound. I

Insert TextBoxes into a Repeater dynamically and retrieve their value

六月ゝ 毕业季﹏ 提交于 2019-12-19 11:46:35
问题 I have a Repeater bound from SQL, containing a mixture of editable and read-only elements. When you click the "Edit" button on a row, the editable portions should convert to textboxes, and when you click "Update", it should save your changes. Here's a (very) simplified version of the Edit and Update buttons' OnClick code: switch(commandName) { case "Edit": Label1.Visible = false; //hide read-only version PlaceHolder1.Visible = true; //show editing version //Dict1 is Dictionary<string, string>

Access Repeater values using JavaScript

て烟熏妆下的殇ゞ 提交于 2019-12-19 11:42:45
问题 i searched a lot on NET, to get the solution, but i could not find Can anyone tell me how to access the label and textbox values of repeater control inside using the javascript ? This is my code <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1"> <ItemTemplate> <table id="t1" width="200px:" style="background-color: skyblue" runat="server"> <tr> <td> <asp:TextBox ID="TextBox3" Text='<%#DataBinder.Eval(Container.DataItem, "empid")%>' runat="server" /> <asp:CheckBox ID=

Access Repeater values using JavaScript

≯℡__Kan透↙ 提交于 2019-12-19 11:42:25
问题 i searched a lot on NET, to get the solution, but i could not find Can anyone tell me how to access the label and textbox values of repeater control inside using the javascript ? This is my code <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1"> <ItemTemplate> <table id="t1" width="200px:" style="background-color: skyblue" runat="server"> <tr> <td> <asp:TextBox ID="TextBox3" Text='<%#DataBinder.Eval(Container.DataItem, "empid")%>' runat="server" /> <asp:CheckBox ID=

Send string with QueryString in Repeater Control in ASP.net

◇◆丶佛笑我妖孽 提交于 2019-12-19 10:53:43
问题 I use a Repeater Control for showing the data in my WebSite. I use a HyperLink in the Repeater Control for showing one field of my table in the database. When you click, I want that link go to another page and send a string to that [page] with a QueryString. I don't know how I do that - can you explain how to do it? I am using Linq in ASP.net. 回答1: <asp:HyperLink ID="HyperLink3" NavigateUrl='<%#Eval("ID_Message","~/ADMIN/Reply.aspx?ID={0}") %>' runat="server">OK</asp:HyperLink> 回答2: Let's

How to add Repeater control dynamically from code behind?

最后都变了- 提交于 2019-12-19 10:45:31
问题 I have a method that creates table and then creates a repeater right after, the table gets rendered but the repeater just does not get rendered. The method below simply creates a table first, filling it with information then dynamically constructs a repeater which works fine, but then it just does not render the repeater onto the aspx page. I have tried using the stringbuilder to return it as a string but still doesn't work. here is the code below. Thanks private void

Export to Excel from a Repeater?

左心房为你撑大大i 提交于 2019-12-19 03:12:18
问题 Right now I am using this to export a repeater (with multiple nested repeaters) to excel: protected void ExportToExcel(object sender, EventArgs e) { Response.Clear(); Response.Buffer = true; Response.AddHeader("content-disposition", "attachment;filename=finance.xls"); Response.Charset = ""; Response.ContentType = "application/vnd.ms-excel"; System.IO.StringWriter stringWrite = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); rptMinistry

Variable repeater columns

拥有回忆 提交于 2019-12-19 02:54:12
问题 I have an objectdatasource which i want to bind to a repeater. the problem is, I cannot work out how to display a variable amount of columns with a variable amount of rows. for example: The dataset I have is structured like this. The objectdatasource is a List<item> . item { string name; List<itemdata> data; } itemdata { DateTime year; double amount; } so basically i want to make a table | year | year | year | year name | amount | amount | amount | amount name | amount | amount | amount |