The contextual menus are the ones that we can enter and they are similar to those that appear in the SharePoint lists.
Note: You can create only a menu. In the column that you want, but only one menu.
ContextMenu - Element for the context menu
It gathers the various options that will appear in the contextual menu.
Attributes
Fields - (string) - Fields lists separated by commas
Format - (string) - Equivalence between identifiers and fields
These attributes will enable us to transfer data as part of the (QueryString) url in the context menu options.
Example:
<ContextMenu Fields="CustomerID" Format="ID=CustomerID">
<ContextMenuItem ... />
</ContextMenu>
Element Contains: ContextMenuItem
ContextMenuItem – Element for the context menu options
Attributes:
Name - (string) - Description - text that will appear in the menu
Image - (string) - image Url - ej: /_layouts/images/edit.gif
Url - (string) - URL to which the option will skip, if the "Row" value is specified here, when selecting this option, the row will be marked up as what is selected and if we are using this WebPart as a server all columns specified in the SELECT command will be sent to the consumer webpart.

Sample Selected row
If we have established values to Fields and Format in the ContextMenu section, we can create Urls that will be able to transfer these values.
Example:
<ContextMenuItem Name="Select" Image="/_layouts/images/list.gif" Url="Row" />
Example transferring values declared in the ContextMenu:
<ContextMenuItem Name="View Details"
Image="/_layouts/images/editicon.gif"
Url="TestN2.aspx?ID=%ID%" />
Full example:
<DataField Name="CompanyName" Header="CompanyName">
<ContextMenu Fields="CustomerID" Format="ID=CustomerID">
<ContextMenuItem Name="Select"
Image="/_layouts/images/list.gif" Url="Row" />
<ContextMenuItem Name="View Details" Image="/_layouts/images/editicon.gif"
Url="TestN2.aspx?ID=%ID%" />
</ContextMenu>
</DataField>