When using Infragistics. Win. UltraWinGrid. UltraGrid, we sometimes want to double-click the grid. For example, double-click a row to display the corresponding detailed data. However, no row information is provided for the double-click event. So how can we determine whether a user double-click a row. Here I will explain it in code. I believe everyone can understand it.
Private void ultrabod=doubleclick (object sender, System. EventArgs e)
{
// Double-click the test to check whether the current double-click position is a line. If yes, the form is displayed.
// Obtain the position of the current double-click point
Point p = System. Windows. Forms. Cursor. Position;
// Obtain the position of the current double-click point in the grid.
P = this. Ultrated1.pointtoclient (p );
// Obtain the elements of the double-click grid control.
Infragistics. Win. UIElement oUI = this. Ultrated1.displaylayout. UIElement. ElementFromPoint (p );
If (oUI! = Null)
{
// Determine whether a double-click vertex is a row or a column. If the grid control is not used to select the entire row.
Infragistics. Win. UltraWinGrid. Ultraman drow oRowUI = oUI. SelectableItem as Infragistics. Win. UltraWinGrid. Ultraman drow;
If (oRowUI! = Null)
{
// If the row is selected, we can use the cell of the row to obtain the corresponding information.
String s = oRowUI. Cells [0]. Value. ToString ();
}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service