DataView.Sort causing duplicate entries in a DataGrid control

G

Grant Harmeyer

I have a custom object that exposes data through one of its properties that
is of type DataTable. I then use the resultant DataTable from the property
to create a new DataView to bind to a DataGrid control and everything works
just fine.

The problem is when I attempt to apply a sort to the DataView
(<DataViewObj>.Sort = "field_name";), it will apply the sort, but it
duplicates each row in the DataGrid.
If I comment out the line of code in my method that sorts the DataGrid
(<DataViewObj>.Sort = "field_name";) , this behavior does not occur, but I
lose the functionality of my DataGrid.SortCommand.

I also stepped through the DataTable and the DataView.Table (before setting
the *Sort* property ) and verified that the row duplication isn't happening
in the DataTable, it's limited only to the *sorting* of the DataView.

I apologize if this is very vague, but I have never seen this type of
behavior before. Has anyone experienced anything like this and if so, how do
you bypass it?

(this is an ASP.NET project written in C# if that matters)


Grant Harmeyer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top