473,624 Members | 2,346 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sorting child records in a repeater


<asp:Repeater id="rptCourseDe tail2" runat="server"
datasource='<%#
((DataRowView)C ontainer.DataIt em).Row.GetChil dRows("CourseDe tailRelation")
%>'
EnableViewState ="false"


I am having troubles trying to sort child records that appear in a
repeater..... Above is the code that i use for the BINDIng...

.... Before binding i sort the dataset and it sorts correctly... however it
seels that the GetChildRows messes up the sorting routines...

has anyone had this before?

what do i need to do to get this working? Do i need to then sort the results
of GetChildRows? If so how can i sort an datarow array by a specific colomn?

any help would be good..

Darren
http://www.webling.com.au
Nov 19 '05 #1
1 1775
Darren,
If you check out my tutorial on databinding, you should be something helpful
in the sample code. If you open NestedRepeaterW ithItemDataBoun d.aspx and
the codebehind, you'll see an alternative way of databinding a nested
repeater...the code is:

rpt.DataSource =
((DataRowView)e .Item.DataItem) .CreateChildVie w("CustomerOrde rs")
rpt.DataBind();

CreateChildView returns a DataView, which you can easily filter...

DataView dv =
((DataRowView)e .Item.DataItem) .CreateChildVie w("CustomerOrde rs");
dv.Sort = "COLUMN ASC";
rpt.DataSource = dv;
rpt.DataBind();

Something like this is probably your best bet
Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"news.microsoft .com" <dc******@hotma il.com> wrote in message
news:et******** ******@TK2MSFTN GP10.phx.gbl...

<asp:Repeater id="rptCourseDe tail2" runat="server"
datasource='<%#
((DataRowView)C ontainer.DataIt em).Row.GetChil dRows("CourseDe tailRelation")
%>'
EnableViewState ="false"
>
I am having troubles trying to sort child records that appear in a
repeater..... Above is the code that i use for the BINDIng...

... Before binding i sort the dataset and it sorts correctly... however it
seels that the GetChildRows messes up the sorting routines...

has anyone had this before?

what do i need to do to get this working? Do i need to then sort the

results of GetChildRows? If so how can i sort an datarow array by a specific colomn?
any help would be good..

Darren
http://www.webling.com.au

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1628
by: Jeremy Tittle | last post by:
I'm using a nested Repeater to display some hiearcy data that's very similar to this one example http://support.microsoft.com/default.aspx?scid=kb;en- us;306154 But want I am trying to do is take an ID from the parent sql statement and pass it into he child statement, so I will only be showing data based off that ID and then continue looping through the records and showing the
0
2045
by: BG | last post by:
Is it possible to get a value from the parent repeater from within a child nested repeater? Here is an example of what I want to do, but can't figure out how or if it's possible at all: <asp:Repeater Runat="server"> <ItemTemplate> ... <asp:Repeater Runat="server" DataSource='<%# GetData( DataBinder.Eval(Container.DataItem, "ID")) %>'> <ItemTemplate>
2
945
by: DelphiBlue | last post by:
I have a Nested Datagrid that is using a data relations to tie the parent child datagrids together. All is working well with the display but I am having some issues trying to sort the child datagrid. HTML Datagrid1 TemplateColumn Table Header information Detail Information
0
1182
by: Ross | last post by:
ASP.NET Problem: I have a dataset with a parent table and a child table. For every row in the parent table there are ~1/2 dozen corresponding records in the child table. In the ASPX page I have a repeater control that shows the parent data as rows in an HTML table. Now what I want is a datagrid control as a child of the repeater. In the end, the user will see a table of items each with its own button, which upon clicking will expose...
2
4429
by: Viktor Popov | last post by:
Hi, I'd like to asky you if it could be accomplished sorting with repeater by column? If yes would you give me an example or link to find out? Thanks! Viktor --- Outgoing mail is certified Virus Free.
8
4142
by: Matthew Curiale | last post by:
I am creating an app that lists clients of a company for management of different attributes for that company. The first page is a listing of the companies currently in the database. I have my repeater working, and paging/sorting works, but there is a small bug that I can't seem to figure out. If, for example, I display 5 records per page, the paging function executes fine, and only shows 5 records per page. This is no problem. When I...
7
4811
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the expandable row, the hidden row is made visible with css. The problem is when i sort the rows, the hidden rows get sorted as well which i don't want and want to be moved (while sorting) relative to their parent rows. The following is my complete html code...
4
1621
by: Pieter | last post by:
Hi, I want to bind a proeprty of a child object to a DataGridView, but it doesn't work. For instance: Imagen that I have an object Company, and this object company has a child object Address. Address has a property Street.
1
2945
by: dorandoran | last post by:
The sort on the childgrid is not working; nothing happens when I click on the each column header for sort. (I followed Satay's sample: http://www.codeproject.com/KB/aspnet/EditNestedGridView.aspx) and i am using object for datasource. please suggest. = = = default.aspx = = <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
0
8233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8675
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8619
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6108
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.