Css - Vertically Wrapping A List Generated By A Repeater
Jul 21, 2010
I've got my repeater generating a list of links that need to appear in a certain order. Meaning I need my list to appear like so
-Item1 -Item4
-Item2 -Item5
-Item3
Every solution I've found involves knowing whats going to be in your list and setting classes where the list should break. My issue is that it could be anywhere from 1 to 18 items. So my question is, is there a good, simple way to vertically wrap a list that's being dynamically generated using an ASP.NET repeater control?
View 1 Replies
Similar Messages:
Jun 21, 2010
At the moment I have ResultsCollection = List<MyDataStructure>; which is then analysed with LINQ using something like:
var OrderedData = from tc in ResultsCollection
...
select new { myLink = g.Key, Count = g.Count(), First = g.First() };
At the moment I have a Repeater that is deifned using:
myRepeater.DataSource = ResultsCollection;
myRepeater.DataBind();
Instead of binding my generic List, I would like to bind my LINQ collection instead. Only problem here is that the generic nature of the LINQ object means that DataSource cannot check and display the properties defined in MyDataStructure. How can I bind my LINQ query output to myRepeater?
View 2 Replies
Dec 2, 2010
I've two SqlDataSources and two Repeaters, each repeater contains one hyperlink (i also tried using web server button and anchors). The hyperlinks fetch from the database some values and in the NavigationUrl property I use a string.Format method to create a parameterized url, to pass for the browser, then second repeater is populated according to the value passed in the url which is originally passed by the first repeater's hyperlink. this is my sample code : [URL]
<asp:ScriptManager id="Scrptmanagr" runat="server"></asp:ScriptManager>
<asp:UpdatePanel id="updtpanl" runat="server">
<ContentTemplate>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:testConnectionString %>"
SelectCommand="SELECT [arrange_by_id], [arrange_by] FROM [arrange_by]">
</asp:SqlDataSource>
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
<ItemTemplate>
<asp:HyperLink ID="HyperLink3" NavigateUrl='<%# string.Format("{0}?SortingType={1}",Request.AppRelativeCurrentExecutionFilePath, Eval("arrange_by_id"))%>' runat="server"><%# Eval("arrange_by") %></asp:HyperLink>
</ItemTemplate>
<SeparatorTemplate>
|
</SeparatorTemplate>
</asp:Repeater>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:testConnectionString %>"
SelectCommand="SELECT [alphabet_id],[arrange_by_id], [value] FROM [alphabet] WHERE ([arrange_by_id] = @arrange_by_id)">
<SelectParameters>
<asp:QueryStringParameter Name="arrange_by_id" QueryStringField="SortingType" Type="Int32" DefaultValue="1" />
</SelectParameters>
</asp:SqlDataSource>
<br /><br />
<asp:Repeater ID="Repeater2" runat="server" DataSourceID="SqlDataSource2">
<ItemTemplate>
<asp:HyperLink ID="hyper1" runat="server" NavigateUrl='<%#string.Format("{0}?SortingType={1}&SortBy={2}",Request.AppRelativeCurrentExecutionFilePath, Eval("arrange_by_id"),Eval("value"))%>'><%# Eval("value")%></asp:HyperLink>
</ItemTemplate>
<SeparatorTemplate>
|
</SeparatorTemplate>
</asp:Repeater>
</ContentTemplate>
</asp:UpdatePanel>
Now! everytime I click any of the hyperlinks it causes a full post back and refreshes the page!
View 2 Replies
Jul 5, 2010
so I have drop down list connected to a datasource, and I need to change 2 or 3 of the values before they are displayed and I'm just having trouble figuring out what to do. I'm assuming I setup some kind of loop to check the values, but thats all I can figure.
View 1 Replies
Sep 8, 2010
How do I list all generated errors in the same div?
Something like this:
<div id="errors">
<ul>
<li>Email is invalid</li>
<li>Firstname is required</li>
</ul>
</div>
View 1 Replies
Apr 22, 2010
I have a repeater that dynamically generates the sum of integers upon a button click (a random number gets stored in an sql database). The sum works fine and I get the appropriate output, however I would like to grab the sum and put it back into my C# code so that I can perform operations with it (it's the accumalated score of a game of blackjack so want to check if they are bust etc.) Here is my code:
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1" >
<ItemTemplate>
<label runat="server" > <%# DataBinder.Eval(Container.DataItem,"a") %> </label>
</ItemTemplate>
</asp:Repeater>
How do i grab the DataItem "a" and put it back into my code?
View 4 Replies
Aug 4, 2010
I'm trying to render out some images on an aspx page. Error I'm getting in the code below is:
DataBinding: '_Default+ImageThing' does not contain a property with the name 'FileName'.
public class ImageThing
{
public string FileName;
}
private void DisplayThumbnailImages()
{
ImageThing imageThing1 = new ImageThing();
ImageThing imageThing2 = new ImageThing();
imageThing1.FileName = "asdf.jpg";
imageThing2.FileName = "aaa.jpg";
List<ImageThing> imagesToRender = new List<ImageThing>();
imagesToRender.Add(imageThing1);
imagesToRender.Add(imageThing2);
Repeater1.DataSource = imagesToRender;
Repeater1.DataBind();
}
here is the aspx:
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "FileName")%>
</ItemTemplate>
</asp:Repeater>
View 3 Replies
Jan 31, 2011
Is it possible to populate the values of a drop down list inside a repeater when the user chooses to activate the drop down list? I have a page that has 2300 rows of data generated by a repeater. The users have the option of showing a drop down list or not. If the drop down list is shown, right now I bind the values in the drop down list at the time the repeater is generated so they are available immediately.However, this adds an additional 2mb of data to the page, which increases the amount if time that it takes to render the page. I am being asked to decrease the page size. The idea they have is that if I only load the first value of the drop down list into the repeater, the amount of data on the page would drop significantly (which it does).
The problem becomes, how do I then load the remaining items into the drop down list when the user SELECTS the drop down list? These aren't static values, they are completely dependent on the data row key, so I have to go out to the DB and get the values for that individual row.I thought maybe AJAX and jquery, but can that be done inside the repeater?Ayone have any ideas as to if/how this could be done? Personally, I think the users should be educated that it is going to take an additional 5 seconds for the page to load if they choose to display the dropdowns, but the business is hesitant to go that route.
View 3 Replies
Oct 27, 2010
I have a repeater control in my page. I need to have a radio button in all the rows(Item template) on checking an radio button the remaining radio buttons must unchecked.
View 3 Replies
Aug 19, 2010
I've had a bit of a problem trying to bind a generic list to a repeater. The type used in the generic list is actually a struct.
I've built a basic example below:
[code]....
I then create two fruits using the struct (apple and orange). These fruits are then added to the list.
Finally, I bind the generic list to the DataSource property of the repeater...
The markup looks like this:
[code]....
I expect to see the fruit name and price printed on the screen, separated by a horizontal rule.
At the moment I am getting an error relating to actual binding...
**Exception Details: System.Web.HttpException: DataBinding: '_Default+Fruit' does not contain a property with the name 'FruitName'.**
View 2 Replies
Jan 4, 2011
I'm new in asp.net and javascript. I got a problem.
I have a repeater which contains dropdown list in it.
The items in the dropdown list are all the same at fist.
But if i select a item in one dropdown, then the selected item will be deleted in the other dropdown list.
For example
A, B, C, D,E are the five items in dropdown list, and repeater has three lines.
If A is selected in the dropdown list in the first line of repeater, then the dropdown list in the other lines will only have four items to select, they are B, C, D, E.
If then D is selected in the dropdown list in the third line of repeater, then the dropdown list in the second line will only have B, C, E to choose.
I can do this in csharp code, how can i do it in .aspx page?
The performance is not good using csharp code.
View 7 Replies
Jul 5, 2010
I have repeater which shows a list of users and there roles. There is also a dropdown list to chnage there role see below
<td><asp:DropDownList ID="ddlChangeType" class="controlwidth100" runat="server" AutoPostBack="true" OnSelectedIndexChanged="change" /></td>
the change event works but what I need is the ID of the row so the user can be updated.
View 3 Replies
Jun 8, 2010
assign the address list to a repeater?
[Code]....
[Code]....
View 1 Replies
Jun 14, 2010
I'm doing property booking based project.
I have repeater control for search results.
For every search result I create a dropdown list with 2 month booking overview.
<ddl>
<item value = "1"> January - February </item>
<item value = "2"> February - March </item>
etc.
Then I call function to generate 2 months calendar view, which has two parameters generate(startmonth as Integer, sku as string)
Everything works when I hardcode starmonth as some integer.
I spent all day with no progress on how to pass value. I need a guide. I guess second problem will be to restore changed dropdown values on Postback, but one step at a time.
But what I want to do, to pass selected item value, to function, that would change view for property associated with this dropdown.
View 2 Replies
Jan 4, 2011
I have a repeater which contains dropdown list in it.
The items in the dropdown list are all the same at fist.
But if i select a item in one dropdown, then the selected item will be deleted in the other dropdown list.
For example A, B, C, D,E are the five items in dropdown list, and repeater has three lines.
If A is selected in the dropdown list in the first line of repeater, then the dropdown list in the other lines will only have four items to select, they are B, C, D, E.
If then D is selected in the dropdown list in the third line of repeater, then the dropdown list in the second line will only have B, C, E to choose.
I can do this in csharp code, how can i do it in .aspx page?
View 4 Replies
Feb 18, 2010
I am attempting to bind a Repeater (but it could be a GridView or ListView) to a list of objects. The List's type is an abstract type, which has two different classes derived from it, both with different properties. Because they have different properties, I cannot just have one ItemTemplate. If I bind a control to a property of one type of class and the other type doesn't have it, it throws an error.
Here's where I'm at:
I cannot use <% if (whatever) { %> some stuff <% } else { %> some other stuff <% } %> because I cannot access the databound item to make the choice based on its type. I cannot use the <%# %> syntax, which lets me use the databound information, because you cannot code logic like if...then...else. I cannot (rather not) call a function and return a string with the code because what I want to render is complex and contains further nested databound controls. Has anyone found an ingenious way of doing if it is this type of object, display these controls, else display these other controls?
View 4 Replies
Sep 16, 2010
I have a table similar to:
ID...NAME.....HTMLTEXT
1....Footer....`<b>test</b>`
where each entry has some HTML text and an associated Name and ID.
What I want to do in ASP.net C# is to list each of these entries on a page in such a way that the HTML text should be displayed exactly how it is meant to be (e.g. <b>test</b> should show 'test' in bold) and each entry should be editable. When the Edit button is clicked on an entry, the HTML text should be replaced by a textbox with the text inside it so that you can edit it and save it.
For example:
FOOTER --EditButton--
TEXT
test
Now I am not sure on what is the best way to do this. Should I use a repeater with an ItemTemplate for each entry? If I use a repeater, and an edit button is clicked, how do I know which edit button is clicked and how do I know which textbox to display the text etc?
View 2 Replies
Jun 8, 2010
I have a repeater that displays a list of job openings. I now need to modify the repeater and break out the job openings by category.
See below for the existing code for my repeater. I'm not sure how I need to modify my repeater to display the jobs under the appropriate categories.
I've added a new JobsCategory table to the database and added the foreign key relationship between my jobListing table and the jobcategory table.
I've created a new stored procedure to pull the jobs my category:
CREATE PROCEDURE [dbo].[GetJobsByCategory]
@categoryId int
AS
BEGIN
SET NOCOUNT ON
SELECT j.JobID, j.JobTitle, j.URL, j.City, j.State, j.Country, c.CategoryName
FROM ADPJobListing j
INNER JOIN ADPJobCategory c ON j.CategoryID = c.CategoryID
WHERE j.CategoryID = @categoryId
END
In my typed dataset (tableadapter), I'll add a new query to the above stored procedure and finally in my business logic layer, I'll add a new method to call down into my data access layer:
[DataObjectMethod(DataObjectMethodType.Select, false)]
public ADP.JobsDataTable GetJobsByCategory(int categoryId)
{
return this.Adapter.GetJobsByCategory(categoryId);
}
How do I need to modify my repeater to display the jobs by category?
[Code]....
View 1 Replies
Jan 11, 2010
My application generates report which lists blocks of information within placeholders. When the text is very long it is wrapping around with no indentation.
It appears like this:
[code]....
Is this something that can be fixed?
View 7 Replies
Feb 11, 2011
Nested Repeater Issue: Each category list gets populated with the same set of date values rather then being populated with the data associated with that category. Trying to Do: Trying to group FAQ's by category and then list them using the repeaters.
The data is queryed though a business logic layer object that makes a call to the data access layer object. The data access layer object uses linq to sql to return data. There are 3 parameters that are passed into the innerDataSource's ObjectDataSource control to populate the nested repeater control (propID, CatID, isVisible).
With the debugger, the correct data is being returned and written to the nested repeater firing from the nested repeater's ItemDataBound event. Once this event is finished, another event fires and runs the FAQRule object again on the business logic layer which re-populates the nested repeater with the same data for each category. I have 2 repeaters, outerRepater (parent) and innerRepeater(child) with 2 ObjectDataSource controls innerDataSource and outerDataSource. See code below : ASP Page:
<asp:Repeater DataSourceID="outterDataSource" EnableViewState="false" runat="server">
<ItemTemplate>
<%# Eval("Description") + " " + this.Property.PropertyName %>
<asp:Repeater EnableViewState="false" runat="server" DataSourceID="innerDataSource">
<HeaderTemplate>
<ul style="width: 500px">
</HeaderTemplate>
<ItemTemplate>
<div><%# Eval("Question") %></div>
<div><p><%# Eval("Answer") %></p></div>
</ItemTemplate>
<FooterTemplate>
</ul>
</FooterTemplate>
</asp:Repeater>
<asp:ObjectDataSource ID="innerDataSource"
runat="server"
SelectMethod="FetchFAQSByPrpAndCatID"
TypeName="PropertySite.BusinessRules.FAQRules">
<SelectParameters>......................................
View 3 Replies
Dec 29, 2010
I have a user control (this has a label to display question and a radio button list to show options).
I am using this user control inside a repeater to display all the questions with their options.
In my repeater page I am not able to capture SelectedValue of radio button list.
protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
View 4 Replies
Apr 9, 2010
I would like to display data horizontally - with wrapping.. Is there some asp.net control that can do this??! I know how to do this using a plain table.. Guess I'm just feeling lazy, or wanting an easier alternative..
eg:item#1 - item#2 - item#3
item#4 - item#5 - item#6
item#7 - item#8 - item#9
View 3 Replies
May 7, 2010
I am using ASP.NET. I have an html table. One of the table cells (td) has two buttons. Just recently, when it is being rendered it is wrapping the buttons. Can anyone tell me why this is happening?
View 2 Replies
Mar 22, 2011
I have a web page and my in my data access layer I am updating the textboxes to my page. It is a simple 3 Tier App.
Something like this I have in my DataAccess Class:
public void SaveDataSet(DataTable table)
{
//What to do here???
}
How should I pass all of my textboxes value to this function as DataTable parameter?
View 2 Replies
May 17, 2010
I have a page that is essentially a group of controls on top, a button in the middle and a DataGrid at the bottom.
I wanted some asynchronous code to get ran; so I wrapped the bottom DataGrid in an UpdatePanel and made the button in the middle as the async trigger. This is working great. However, the button also needs to clear out the values of the controls up top after it adds to the bottom DataGrid.
The code to clear these controls out gets ran, but nothing changes on screen. I assume this is because the top controls need to be wrapped in an UpdatePanel as well. I did this, but I'm having a problem.
One of the controls up top is an asp:ImageButton. Clicking on this button executes a handler for the click event in the VB code behind. This VB constructs a Javascript snippet that opens a new window with a different page (don't ask me why it is done this way). That VB code gets executed, but nothing happens.
View 4 Replies