Forms Data Controls :: Nested Repeater: Rewrites Ending Category List To All Categories

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") &#43; " " &#43; 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


Similar Messages:

Forms Data Controls :: Add Categories To Repeater That Displays List Of Job Postings

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

Forms Data Controls :: Listing / Categories That It Is Added Infinite Category,subcategory?

Sep 2, 2010

i have a problem about listing. i have categories that it is added infinite category,subcategory. Table is like that:

id
ustid
kategori
seviye

i want listing like this:

For example when i click "Arac", the list will become like following:
Araç (category)
Otomobil (subcategory)
Motorsiklet (subcategory)

Then .when i click "Otomobil"
Araç
Otomobil
----Fiat
---Audi
---BMW

when i click "Fiat"
Araç
-Otomobil
--Fiat
---Murat
---Şahin

View 3 Replies

Forms Data Controls :: Nested Gridview To Show Category And Forum?

Aug 30, 2010

there is category and under its there are all forum of this category

to do that , I create 2 tables in DB

cat for category have 2 rows ( id,title) and table forum have 3 rows ( id,title,Cat_ID)

I can do it with Php but in asp.net I can't

I read in some article to create nested gridview

View 4 Replies

Forms Data Controls :: Object Reference Not Set To An Instance Of An Object In Nested Repeater Control Of CheckBox List ...

Sep 24, 2010

[Code]....

I am getting error of in Foreach loop

[Code]....

How to resolve this situation or any other alternative to cum out of this problem.

View 6 Replies

Custom Server Controls :: Category Attribute Of User Control Property Does Not Work Correctly In Categories Tab

Aug 19, 2010

I have a User Control (ascx) and a property which a want to display in my categories tab in Visual Studio in the category named "Styles".

[Code]....

And here is the problem: Actually I do not need a get, because I only have to set the property (write only property). But when I omit the get, the property is displayed in the "Misc" category in the categories tab in Visual Studio. Only when I code the get as well, then the property is displayed correctly in the "Styles" category in the categories tab in Visual Studio.

Does anybody know why? How can I display the category correctly only with set?

View 2 Replies

Forms Data Controls :: Show / Hide A Div In A Nested Repeater By Clicking On A Button Inside Parent Repeater?

Nov 12, 2010

what changed do I need to make to my code for it to achieve what I'm after.

At the moment I am getting a "cannot cast to type" error message with the below code.

I have also tried calling the ItemDataBound method in with the parent repeater tags and had no errors but when I clicked on the button it would just move back to the top of the page and would not hide or show any data. Also I have made the div style to none but the first record still shows its child but the rest don't.

[code].....

View 1 Replies

Forms Data Controls :: 2 Dropdown List / "Displaying A Dropdown List Of Categories With A --None -- Option?

Oct 10, 2010

I am stuck at this point "Displaying a dropdown list of Categories with a --None -- Option. I want the gridview control to display 2 dropdown list one in read-only mode and the other in edit mode. When a record is in read-only mode, the dropdownlist's enabled property will be set to false."When it's on a read-only mode, it doesn't display the selected Category. it shows but the "No Category". When i click on edit to edit or change category, it doesn't display the selected category.

The example is given below( I am reading the book Sams Teach yourself ASP.NET 2.0 by Scott Mitchell. page 628)

<asp:Label ID="UserIdValue" runat="server" Visible="False"></asp:Label>
<asp:SqlDataSource ID="picturesDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [Pictures] WHERE ([UserId] = @UserId) ORDER BY [UploadedOn] DESC"
DeleteCommand="DELETE FROM [Pictures] WHERE [PictureID] = @PictureID"
InsertCommand="INSERT INTO [Pictures] ([UserId], [CategoryID], [Title], [Description], [UploadedOn]) VALUES (@UserId, @CategoryID, @Title, @Description, @UploadedOn)"
UpdateCommand="UPDATE [Pictures] SET [UserId] = @UserId, [CategoryID] = @CategoryID, [Title] = @Title, [Description] = @Description, [UploadedOn] = @UploadedOn WHERE [PictureID] = @PictureID">
<DeleteParameters>
<asp:Parameter Name="PictureID" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="UserId" />
<asp:Parameter Name="CategoryID" Type="Int32" />
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Description" Type="String" />
<asp:Parameter Name="UploadedOn" Type="DateTime" />
</InsertParameters>
<SelectParameters>
<asp:ControlParameter ControlID="UserIdValue" Name="UserId" PropertyName="Text"/>
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="UserId"/>
<asp:Parameter Name="CategoryID" Type="Int32" />
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Description" Type="String" />
<asp:Parameter Name="UploadedOn" Type="DateTime" />
<asp:Parameter Name="PictureID" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
<br />
<asp:SqlDataSource ID="categoriesDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT [CategoryID], [Name] FROM [Categories] WHERE ([UserId] = @UserId)">
<SelectParameters>
<asp:ControlParameter ControlID="UserIdValue" Name="UserId" PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>
<br />
<asp:SqlDataSource ID="maxPictureIDDataSource" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT MAX(PictureID)
FROM Pictures
WHERE UserId = @UserId">
<SelectParameters>
<asp:ControlParameter ControlID="UserIdValue" Name="UserId"
PropertyName="Text" />
</SelectParameters>
</asp:SqlDataSource>
<br />
<asp:Label ID="cannotUploadImageMessage" runat="server"
Text="The photo could not be added to your album either because you did not specify a file to upload or the file specified was not a JPEG image with the file extension .JPG"></asp:Label>
<br />
<asp:DetailsView ID="dvPictureInsert" runat="server"
DataSourceID="PicturesDataSource" Height="50px" Width="125px"
AutoGenerateRows="False" CellPadding="4" DataKeyNames="PictureID"
DefaultMode="Insert" ForeColor="#333333" GridLines="None">
<AlternatingRowStyle BackColor="White" />
<CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" />
<EditRowStyle BackColor="#2461BF" />
<FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" />
<Fields>
<asp:TemplateField HeaderText="Picture">
<InsertItemTemplate>
<asp:FileUpload ID="imageUpload" runat="server" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
ControlToValidate="imageUpload" Display="Dynamic"
ErrorMessage="There was no file selected" ValidationGroup="PictureAdd"></asp:RequiredFieldValidator>
</InsertItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Category" SortExpression="CategoryID">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("CategoryID") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:DropDownList ID="pictureCategory" DataSourceID="categoriesDataSource"
runat="server" DataTextField="Name" DataValueField="CategoryID"
SelectedValue='<%# Bind("CategoryID") %>'
Visible='<%# Bind("CategoryID") %>' AppendDataBoundItems="True">
<asp:ListItem Selected="True" Value="">-- Select Category --</asp:ListItem>
</asp:DropDownList>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("CategoryID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Title" SortExpression="Title">
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Title") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Title") %>'></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="TextBox1" Display="Dynamic"
ErrorMessage="you must provide a name for the title"
ValidationGroup="PictureAdd"></asp:RequiredFieldValidator>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("Title") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Description" SortExpression="Description">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Description") %>'></asp:TextBox>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Description") %>'

View 2 Replies

DataSource Controls :: Repeating A Nested (or Sub) Query For Multiple Categories?

Jul 10, 2010

I'm trying to design a page that displays all suppliers by their location. I'd quite like this to work from a query that will automatically include new locations added in the future.

At the moment my design has a table that holds 'locations' with locationID and locationName fields. In my 'suppliers' table I also have a locationID to join them.

I'm not sure how to query the database to return all the suppliers in location 1, then all in location 2. (Or even sure of the terms I need to Google to get some examples!) For example:

Location 1
Supplier 1
Supplier 2
Location 2
Supplier 3
Supplier 4

View 3 Replies

Forms Data Controls :: How To Display Category Name Without Category Id

Mar 30, 2011

I am working in a project that is a musical website. I want to display the web page with all categories I have. In my database , named Category_Master, I have two fields like Category_Id (which is a primary key ) and Category_Name. I have generated category_Id with NEWID() function. The category_Id is not supposed to display on the web page. But, i have to select Category_Name and according to that , I have to get the category_Id. If I am using Static connection with SqlDataSource, i am able to make visible=false property so that the category_id won't be visible. But , at that time, I can't write code to Select the category_id of the selected index.

If i am using disconnected approach, I filled the dataset with the Category_Master, and binded it to GridView. But, at that time, I can't hide the category_id from the user. I want to select category_id by clicking on the category_name with out displaying category_id ..?

View 4 Replies

Forms Data Controls :: Command In A Nested Repeater?

Dec 4, 2010

Users can reply to a comment made in the parent repeater by clicking a link that opens a popup that inserts a row in the replies table. This is then displayed in the repeater as soon as the lists refresh. What I need to do is have a Delete comment link that only the user that inserted the reply can utilize. How do you get the command or onclick from a ImageBUtton that is in the child segment?

[Code]....

The Enabled='<%# isEnabled() %>' disables the button foe users that are not logged in...that seems to work OK

View 1 Replies

Forms Data Controls :: GridView Nested In Repeater?

Aug 13, 2010

i'm new on this forum and my english is not the best, so i hope that i can explain my problemI have a gridview nested in a Repeater, this is the markup :

<ItemTemplate>
<asp:GridView ID="GridView1" EmptyDataText="<%#((mioDataTable)Container.DataItem).categoria %>" runat="server" AutoGenerateColumns="False" CellPadding="4" CssClass="grid" DataKeyNames="id"

[code]...

View 4 Replies

Web Forms :: Data List Control To Display The Categories And Forum?

Mar 30, 2012

sample code for datalist to display the categories and forum like used in a  aspsnippet forum

View 1 Replies

Forms Data Controls :: Finding Control Within Nested Repeater?

Jun 8, 2010

What I'm trying to do is find a control within a nested repeater when the OnItemDataBound event is fired on the 'main' repeater.

[Code]....

This has driven me mental! And I've done stacks of web searches and ended up confusing myself even further.

View 4 Replies

Forms Data Controls :: Create Nested Repeater In Code Behind?

Feb 18, 2011

I am using ASP .NET 2.0 C#.

I have a Repeater that I created in my code behind. I want to create a nested repeater inside of that parent repeater. How do I go about doing that?

View 4 Replies

Forms Data Controls :: Nested Repeater Control Does Not Work?

Sep 8, 2010

I have a presentation to the CFO in two hours. I can't get a nested repeater control to work right, something to do with teh placement of the <table> tags I think.The first repeater first section works fine, then the child repeater shows the first child section right, but the next section of the parent repeater loses all the formatting applied at the parent table. I've tried vaious permutations of where to place the closing table tag of the outer and the inner and get different results, but never the right results.

Here is my current code:

<tr
style="font-size:small">

<th
style="width:100px">[code]....

These are the results I get:

View 7 Replies

Forms Data Controls :: Nested Repeater - How To Get Particular Field Of The Anonymous Type?

Jan 26, 2011

nested repeater like this:

<asp:Repeater ID="repeaterReportListByJob" runat="server" DataSource='<%# GetReportsByJobNID(Eval(Container.DataItem, "JobNID")) %>'>

It seems my Eval(Container.DataItem, "JobNID") is not working and I assume this is because the datasource of the outer (parent) repeater is an anonymous type. So how am I supposed to access a particular field of my anonymous type?

View 7 Replies

Forms Data Controls :: Retrieve Values From Nested Repeater Control?

Jan 4, 2011

am using C# .net.. in my page am having nested repeater control.. in child repeater there is check box and a hidden ID. i want to store(here am get strucked) the ID of checked box in to my data base.. look at the below code..

HTML page....

[Code]....

View 2 Replies

Forms Data Controls :: How To Add CheckBoxList Control In Nested Repeater Dynamically

Sep 28, 2010

How can i create Dynamic Child Repeater Control inside of Parent Repeater (This one created Dynamically)

and

How to Create a Dynamic CheckBoxList control inside of a Child Repeater Control(if we able to create in Parent Repeater Control Successfully)

View 1 Replies

Forms Data Controls :: Create New Textbox In Nested Repeater Footertemplate?

Jan 15, 2010

I have a nested repeater which displays a food menu - e.g.

Sub Heading
- Food 1
- Food 2
- Button 1

Another Heading
- Food 1
- Food 2
- Button 2

etc. etc.

What I have is a series of buttons inside the itemtemplate of the parent repeater (button 1 and button 2) which, when clicked, i need to somehow add a new blank textbox to below food 2 in whichever section it is clicked

I am having trouble doing this. See my code snippet below:

[Code]....

When I run this though, I receive an error of "object reference not set to an instance of object..."

Do I need to actually find a control within the footertemplate itself?

View 3 Replies

Forms Data Controls :: Retrieve Dropdownlist Value Inside Nested Repeater?

Jul 15, 2010

I'm having a problem trying to retrieve a dropdownlist value that is located within a nested repeater. Basically I'm trying to create a shopping cart that allows the user to select a shipping method and the shipping method is contained in the repeater. So my page structure looks something like this.

Gridview

[Code]....

To me this should work, but the problem I'm facing is that there are no repeater items. The Items.Count property in the repeater is 0. I am not calling DataBind on the Gridview nor the Repeater before this code is reached (this code is the first thing that happens in my button click event) and my binding is done inside a !IsPostBack statement in my page load. I've made sure databinding is not occurring by setting breakpoints on the code that databinds both the gridview and repeater.

It seems to me like the nested repeater is losing it's viewstate or something on a postback. If that's the case, how can I get the selected value of that dropdown control inside a nested repeater?

View 1 Replies

Forms Data Controls :: Using Nested Repeaters And Access A Value From Parent Repeater Within The Child?

Apr 30, 2010

I am using nested repeaters and wanted to access a value from my parent repeater within the child...is this possible?

View 3 Replies

Forms Data Controls :: Client Side Dragable Columns For A Nested Repeater?

Feb 1, 2010

I am trying to find a way in whihc I CAN Move the columns of nested repeaters from one to another. Like I have three caegories of products say A,B,C and I will have X,Y,Z products within each categories and I am trying to find a way of I can find a way that on client side the user can drag items from one category to another like the drag functionality of Ajax control kit ReOrder List.

View 1 Replies

Forms Data Controls :: Bind GroupBy Values In Nested Repeater Control?

Sep 24, 2010

In a dataset i m getting values like this

IdApplication ApplicationDesc Permissions
1 User Add
1 User Delete
1 User Update
2 Role Add
2 Role Delete
3 User2 Modify
3 User2 Change

How can i Bind like in nested repeater control

In my Nested repeater control bound i need to Bind the Values like this Formate According Groupwise

User Add Update
Role Add Delete
User2 Modify Change

In the nested repeater control i taken a label in Header Template i need to bind 3 different values Application Desc once User, Role, User2 and in Item Template i had binded the <%# Eval("Application Desc")%> but i am getting like this all permissions in 1 line

Add Update Add Delete Modify Change

View 5 Replies

Forms Data Controls :: Saving State With Nested Repeater Controls?

Feb 17, 2010

I have two repeaters (one nested in the other) with checkboxes for each. AutoPostback is set to true. ViewState is enabled. for the repeaters. The layout is similar to a treeview control.

I am having trouble retaining state for the child repeater's checkboxes when I check the parent repeater's checkboxes. How can I retain these child checkboxes as I click on the parent's.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved