This is a migrated thread and some comments may be shown as answers.

Lat/Lon Custom Editor

1 Answer 62 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kenneth
Top achievements
Rank 1
Kenneth asked on 19 Dec 2011, 10:16 PM
Hi,

I have an application that has latitude and longitude values in cells in a GridView.  I need to have the user edit these values.  Currently, I have them as individual cells and the user can edit them individually by entering new values.  What I would like to do is extend this editing so that the values can be set by clicking a location on a globe.  The lat/lon value would then be returned via an event and the values in the cells updated accordingly.

I'm not sure how to do his if I have separate cells for the lat/lon values.

Does anyone have any suggestions on how to proceed?

Thanks.


Ken...

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 21 Dec 2011, 03:33 PM
Hi Kenneth,

Thank you for writing.

I am not quite sure in what format you will receive the data, but let's assume that you receive the following string - 10.12345, 20.98765. So in this case, you will know that the lat is 10.12345 and the lon is 20.98765. So as you see the data is separated by comma, so what you can do is to split the string by ',' and you will have the lan and lon separated. Then simply set the deisred cells values or add new row with them. For example if you have two columns in RadGridView, recpectively named "latitude" and "longitude" here is how to add row or change some cells values:
string dataFromSomewhere = "10.12345,20.98765";
string[] data = dataFromSomewhere.Split(',');
string lan = data[0];
string lon = data[1];
radGridView1.Rows.Add(lan, lon);
//or if you want to modify some row
radGridView1.Rows[10].Cells["latitude"].Value = lan;
radGridView1.Rows[10].Cells["longitude"].Value = lon;

I hope that you find this information helpful. Should you have any other questions, do not hesitate to contact us.

Best wishes,
Stefan
the Telerik team

Q3’11
of RadControls for WinForms is available for download (see what's new). Get it today.
Tags
GridView
Asked by
Kenneth
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or