473,395 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Sorting child records in a repeater


<asp:Repeater id="rptCourseDetail2" runat="server"
datasource='<%#
((DataRowView)Container.DataItem).Row.GetChildRows ("CourseDetailRelation")
%>'
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 1755
Darren,
If you check out my tutorial on databinding, you should be something helpful
in the sample code. If you open NestedRepeaterWithItemDataBound.aspx and
the codebehind, you'll see an alternative way of databinding a nested
repeater...the code is:

rpt.DataSource =
((DataRowView)e.Item.DataItem).CreateChildView("Cu stomerOrders")
rpt.DataBind();

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

DataView dv =
((DataRowView)e.Item.DataItem).CreateChildView("Cu stomerOrders");
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******@hotmail.com> wrote in message
news:et**************@TK2MSFTNGP10.phx.gbl...

<asp:Repeater id="rptCourseDetail2" runat="server"
datasource='<%#
((DataRowView)Container.DataItem).Row.GetChildRows ("CourseDetailRelation")
%>'
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
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...
0
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: ...
2
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...
0
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...
2
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...
8
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...
7
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...
4
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...
1
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)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.