akgulebubekir / Maui.DataGrid

DataGrid component for Maui
MIT License
245 stars 48 forks source link

Selecting Value from Row Can't Find Commands #197

Closed VegasJohnson closed 1 day ago

VegasJohnson commented 1 month ago

So im trying to find the correct commands todo the following with your grid and cant find the correct commands.

private async void dataview_ItemSelected(object sender, SelectionChangedEventArgs e)
{
    await Task.Delay(1000); // Temp

    DataRowView ID = (DataRowView)dataview.SelectedItem as DataRowView;
    if (dataview.SelectedItem != null)
    {

        string id = ID.Row["Id"].ToString();

        await Navigation.PushAsync(new Editjob(id));
    }

}
VegasJohnson commented 1 month ago

Figured it out , I called from the DataList instead of the Datagrid.

var sel = dataview.SelectedItem as Dataview; var id = sel.Id.ToString();