Reputation: 1
help to understand what the error, thanks. Project write Universal Windows Platform (UWP) app, errors in XAML.
Error in line 61 case 6: // UserPage.xaml line 61 { this.RowHeaderMouseClick_dgvUsers = (global::Windows.UI.Xaml.Controls.Grid)(target); ((global::Windows.UI.Xaml.Controls.Grid)this.RowHeaderMouseClick_dgvUsers).Tapped += this.RowHeaderMouseClick; } break;
<Grid Grid.Column="0" x:Name="RowHeaderMouseClick_dgvUsers" Tapped="RowHeaderMouseClick">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
code in c#
private void RowHeaderMouseClick_dgvUser(object sender, TappedRoutedEventArgs e)
{
Grid grd = sender as Grid;
int rowIndex = Grid.GetColumn(grd);
Grid.GetRow(grd);
id_user.Text = dgvUsers.Text[0].ToString();
first_name.Text = dgvUsers.Text[1].ToString();
last_name.Text = dgvUsers.Text[2].ToString();
email.Text = dgvUsers.Text[3].ToString();
username.Text = dgvUsers.Text[4].ToString();
password.Text = dgvUsers.Text[5].ToString();
contact.Text = dgvUsers.Text[6].ToString();
address.Text = dgvUsers.Text[7].ToString();
gender.Text = dgvUsers.Text[8].ToString();
user_type.Text = dgvUsers.Text[9].ToString();
}
Upvotes: 0
Views: 377
Reputation: 12993
In the code behind, the name of the event handler is wrong. It should be RowHeaderMouseClick, not RowHeaderMouseClick_dgvUser.
RowHeaderMouseClick_dgvUser is the name of the control (by the way it is a bad name for the control, dgvUser is more appropriate)
The compiler complains it cannot find a method called RowHeaderMouseClick (as you wired up in the XAML code).
Upvotes: 2