public IOrderedDictionary GetSelectedRowData()
{
IOrderedDictionary result;
if (null == this.SelectedRow)
{
result = null;
}
else
{
OrderedDictionary fieldValues = new OrderedDictionary();
foreach (object field in this.CreateColumns(null, false))
{
if (field is BoundField && !fieldValues.Contains(((BoundField)field).DataField))
{
fieldValues.Add(((BoundField)field).DataField, null);
}
}
string[] dataKeyNames = this.DataKeyNames;
for (int i = 0; i < dataKeyNames.Length; i++)
{
string key = dataKeyNames[i];
if (!fieldValues.Contains(key))
{
fieldValues.Add(key, null);
}
}
this.ExtractRowValues(fieldValues, this.SelectedRow, true, true);
result = fieldValues;
}
return result;
}