and here is my vf page:public with sharing class DisplaySectionsController {
public List<PI_Vendor__c> vendors {get;set;}
public String[] states {get;set;}
public void load() {
vendors = [Select ID, Name, State__c from PI_Vendor__c WHERE State__c IN ('DE','PA','MD')];
Set<String> stateSet = new Set<String>();
for (PI_Vendor__c v : vendors)
stateSet.add(v.State__c);
states = new String[stateSet.size()];
Integer i = 0;
for (String state : stateSet) {
states[i] = state;
i++;
}
}
}
but I am getting the following error:<apex:page controller="DisplaySectionsController" action="{!load}" sidebar="false">
<apex:sectionHeader title="My Sample Display Page" subtitle="Group by States"
description="This page shows how you can dynamically group results by field value."/>
<apex:repeat value="{!states}" var="state">
<apex:pageBlock title="{!state}">
<apex:repeat value="{!vendors}" var="vnd">
<apex:outputPanel rendered="{!IF(state=vendors.State__c,true,false)}">
{!vnd.Name} - {!vnd.State__c}<br/>
</apex:outputPanel>
</apex:repeat>
</apex:pageBlock>
</apex:repeat>
</apex:page>
What can I do to make this work with a custom object? And more importantly, where am I currently going wrong? Thanks in advance!JohnError: Unknown property 'VisualforceArrayList.State__c'

I forgot to initialize the Map. Add this before your for loop (after the stateSet initilization)vendorMap = new Map<String, List<PI_Vendor__c> >();