Thank you Gary.
I might be not very clear in the question.
Here is my source code.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Map1.MapUnit = GeographyUnit.DecimalDegree;
Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);
Map1.MapTools.MouseCoordinate.Enabled = true;
//Zip codes are in "ZCTA5CE10" column in shape file
ShapeFileFeatureSource.BuildIndexFile(@"C:\temp\WebSites\ThinkGeo\Data\NJ\tl_2010_34_zcta510.shp", @"C:\temp\WebSites\ThinkGeo\Data\NJ\tl_2010_34_zcta510.idx", "ZCTA5CE10", "\\w", BuildIndexMode.DoNotRebuild);
ShapeFileFeatureLayer stateLayer = new ShapeFileFeatureLayer(@"C:\temp\WebSites\ThinkGeo\Data\NJ\tl_2010_34_zcta510.shp", @"C:\temp\WebSites\ThinkGeo\Data\NJ\tl_2010_34_zcta510.idx");
stateLayer.Name = "StateLayer";
stateLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Park1;
stateLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;//20 is zoomest
//"SALES_AREA" is custom column
stateLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.CreateSimpleTextStyle("SALES_AREA", "Arial", 8, DrawingFontStyles.Italic, GeoColor.StandardColors.Black, 3, 3);
stateLayer.FeatureSource.CustomColumnFetch += new EventHandler<CustomColumnFetchEventArgs>(FeatureSource_CustomColumnFetch);
stateLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.RequiredColumnNames.Add("SALES_AREA");
LayerOverlay staticOverlay = new LayerOverlay();
staticOverlay.IsBaseOverlay = false;
staticOverlay.Layers.Add(stateLayer);
Map1.CustomOverlays.Add(staticOverlay);
//================================
Map1.CurrentExtent = GetFullExtent(stateLayer);
}
}
void FeatureSource_CustomColumnFetch(object sender, CustomColumnFetchEventArgs e)
{
//Form here, all i can know is the e.ColumnName and e.Id.
//e.ColumnName is alwasys 'SALES_AREA' in this case.
//In our oracle db, we have SALES_AREA and zip code combination. A sales area might have multiple zip codes.
//I need to know what is values of zip code ( column name in shp file = "ZCTA5CE10") in this event handler to identify the corresponding SALES_AREA.
//As far as I know, e.Id is not representing any column from shape file.
string columnName = e.ColumnName;
e.ColumnValue = "SALES_AREA0" + e.Id;
}
As mentioned in the source code, form event handler, all i can know is the e.ColumnName and e.Id.
e.ColumnName is alwasys 'SALES_AREA' in this case.
In our oracle db, we have SALES_AREA and zip code combination. A sales area might have multiple zip codes.
I need to know what is values of zip code ( column name for zip code in shp file = "ZCTA5CE10") in this event handler to identify the corresponding SALES_AREA.
As far as I know, e.Id is not representing any column from shape file.
Thank you