PDA

View Full Version : Can't select certain rows in datagrid


clem_c_rock
09-30-2010, 04:14 PM
Hello,

I have a datagrid with 3 columns, that works great until you have 2 rows next to each other w/ the exact first name and last name.
When that happens, I can select the top row but I can't select the bottom row.

If I trace the onPatientSelected method, it never gets called.

here's my datagrid code below:


<code>
<mx:DataGrid
id="patientList"
dataProvider="{dataProvider}"
change="onPatientSelected()"
styleName="patientlist"
width="100%"
height="100%"
editable="false"
draggableColumns="false"
resizableColumns="false" headerRelease="checkColumnSorted(event)">

<mx:columns>
<mx:DataGridColumn headerText="Last Name" dataField="LastName" />
<mx:DataGridColumn headerText="First Name" dataField="FirstName"/>
<mx:DataGridColumn headerText="Unique Id" dataField="UniqueId" sortable="false"/>
</mx:columns>

</mx:DataGrid>
</cod>

Any ideas?

ad7
10-18-2010, 09:50 AM
It works fine here. Rows are selected as well as trace is called.
What do you have in your dataprovider ?

abduraooft
10-18-2010, 10:03 AM
here's my datagrid code below:Please use ][/COLOR] tags to wrap your code while posting here.

ad7
10-19-2010, 05:28 AM
Send your datagrid code

clem_c_rock
10-19-2010, 05:53 PM
So the problem has been solved and sorry for the long reply the culprit was the sort function:

Previously it was this:

dataProvider.sort.fields = [new SortField("LastName",true, false), new SortField("FirstName",true, false)];

and all I had to do was to make it more distinct by adding the PatientId field to the mix.

dataProvider.sort.fields = [new SortField("LastName",true, false), new SortField("FirstName",true, false), new SortField("PatientId",true, false)];



Thanks for everyone's reply!