Select to view content in your preferred language

Biding Datagrid and Maptips

965
3
10-06-2010 01:30 PM
FranciscoRodriguez1
Emerging Contributor
Hi I want to binding my datagrid row with maptip. I like clic in the row and show maptips.
Please help me
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
I'm afraid you cannot use MapTip for this because MapTips are designed to only show when you enter a feature in its GraphicsLayer.
0 Kudos
FranciscoRodriguez1
Emerging Contributor
Let me explain more,I work in Silverlight visuastudio 2010. I create the proyect map, GraphicsLayer and  Add Marker Graphics read from database:

string strComplete = "";
            List<string> str = new List<string>();
            for (int i = 0; i < coordinateList.Coordinates.Count; i++)
            {
                Graphic graphic = new Graphic()
                {
                    Geometry = new MapPoint(coordinateList.Coordinates.X, coordinateList.Coordinates.Y),
                    Symbol = LayoutRoot.Resources["GlobePictureSymbol"] as Symbol,
                };
               
                str.Add(cod_inm.Substring(0, 2));
                str.Add(cod_inm.Substring(2, 2));
                str.Add(cod_inm.Substring(4, 2));
                str.Add(cod_inm.Substring(6, 2));
                str.Add(cod_inm.Substring(8, 3));
                str.Add(cod_inm.Substring(11, 2));
                str.Add(cod_inm.Substring(13, 6));
                str.Add("01");
                //string[] testing = str.ToArray();
                strComplete = string.Join("-", str.ToArray());
                graphicsLayer.Graphics.Add(graphic);
                //graphic.Attributes.Add("Calle", calle);
                graphic.Attributes.Add("Nombre", nombre1);
                graphic.Attributes.Add("Uso", usoo_inm);
                graphic.Attributes.Add("Siglo", sigl_inm);
                graphic.Attributes.Add("Fecha", fecha_d_inm);
                graphic.Attributes.Add("ID", id_inm);
             
             
            }

I put in the datagrid  the same fields. I like to do clic in the event handler SelectionChanged and obtain:

Inm_Chib_silver gddato = this.MainGrid.SelectedItem as Inm_Chib_silver;
            GraphicsLayer graphicsLayer = this.Mimapa.Layers["MyGraphicsLayer"] as GraphicsLayer;
I try to use:


FindResult findResult = (FindResult)MainGrid.SelectedItem;


But, I use different method of the example:

http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Find

Please help me or tell me where i find more information
0 Kudos
dotMorten_esri
Esri Notable Contributor
Create a usercontrol you want to show the user with the information fields set (similar to what you would put in a maptip).
When the user clicks a row, use the MyMap.MapToScreen() method to figure out where on the screen this geometry is located. Then place the usercontrol on top of the map at this position.
0 Kudos