Hi Team,
I am developing mobile application using xamarin forms. I am looking for to highlight the gridrow selection.
I am not able to find the related properties in the grid. Could any one please help me on this.
Thanks in advance,
Naveen.
What I have tried:
Right Now my grid
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ASCSMobile.Pages.HomePage"
Title="Home"
NavigationPage.BackButtonTitle="Back"
>
<contentpage.content>
<StackLayout BackgroundColor="{StaticResource White}" Padding="10, 20, 10, 30">
<ListView x:Name="listviewLeft">
<listview.header>
<Grid BackgroundColor="Black" ColumnSpacing="0" RowSpacing="0">
<grid.columndefinitions>
<ColumnDefinition Width="1*">
<ColumnDefinition Width="1*">
<listview.itemtemplate>
<datatemplate>
<viewcell>
<ScrollView HorizontalOptions="FillAndExpand" HeightRequest="2" WidthRequest="25">
<Grid BackgroundColor="Black" ColumnSpacing="0" RowSpacing="0">
<grid.columndefinitions>
<ColumnDefinition Width="1*">
<ColumnDefinition Width="1*">
<StackLayout Padding="0, 30, 0, 0" Orientation="Horizontal">
<StackLayout Padding="0, 5, 0, 0" Orientation="Horizontal">
.Cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
using Xamarin.Forms.Xaml;
namespace ASCSMobile.Pages
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class HomePage : ContentPage
{
public HomePage()
{
InitializeComponent();
//On<xamarin.forms.platformconfiguration.ios>().SetUseSafeArea(true);
var leftColumnItemList = new List<homemenuitem>();
leftColumnItemList.Add(new HomeMenuItem()
{
image = "77854",
text = "Open",
//page = typeof(ApprovalInboxPage)
});
leftColumnItemList.Add(new HomeMenuItem()
{
image = "128547",
text = "Closed",
});
leftColumnItemList.Add(new HomeMenuItem()
{
image = "258547",
text = "Open",
page = typeof(AboutPage)
});
leftColumnItemList.Add(new HomeMenuItem()
{
image = "898547",
text = "Closed"
});
leftColumnItemList.Add(new HomeMenuItem()
{
image = "898547",
text = "Closed"
});
leftColumnItemList.Add(new HomeMenuItem()
{
image = "898547",
text = "Closed"
});
leftColumnItemList.Add(new HomeMenuItem()
{
image = "898547",
text = "Closed"
});
leftColumnItemList.Add(new HomeMenuItem()
{
image = "898547",
text = "Closed"
});
leftColumnItemList.Add(new HomeMenuItem()
{
image = "898547",
text = "Closed"
});
leftColumnItemList.Add(new HomeMenuItem()
{
image = "898547",
text = "Closed"
});
leftColumnItemList.Add(new HomeMenuItem()
{
image = "898547",
text = "Closed"
});
listviewLeft.ItemsSource = leftColumnItemList;
listviewLeft.ItemSelected += OnItemSelected;
}
void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
{
var mainPage = ((MainPage)((Xamarin.Forms.NavigationPage)App.Current.MainPage).CurrentPage);
listviewLeft.SelectedItem = null;
var item = e.SelectedItem as HomeMenuItem;
if (item != null)
{
if (item.text == "Signout")
{
mainPage.SetUserDetails("", "");
App.IsUserLoggedIn = false;
Navigation.InsertPageBefore(new LoginPage(), this);
Navigation.PopAsync();
}
else if (item.text == "Help")
{
var helpUrl = new Uri("http://help.mckessonstrategicsupplysourcing.net/MSSShelp/Mobile_Help/Advanced/Default.htm?src=/app/Home");
Device.OpenUri(helpUrl);
}
else if (item.text == "About")
{
Navigation.PushAsync(new AboutPage());
}
else
{
//mainPage.ChangePage(item.page);
}
}
}
public class HomeMenuItem
{
public string image { get; set; }
public string text { get; set; }
public Type page { get; set; }
}
}
}