This is my code for generating the gridview
User u1 = new User();
User u2 = new User();
for (int i = 0; i < files.Count; i++)
{
u1.Files = files[i];
items.Add(u1);
}
for (int i = 0; i < sharedFiles.Count; i++)
{
u2.Files += sharedFiles[i];
items.Add(u2);
}
gridview1.ItemsSource = items;
}
public class User
{
public string Files { get; set; }
}
This is my xaml page
<ListView.View>
<GridView >
<GridView.Columns>
<GridViewColumn Width="250" DisplayMemberBinding="{Binding Files}" ></GridViewColumn>
<GridViewColumn >
<GridViewColumn.CellTemplate>
<DataTemplate>
<Button Content="Download" Click="fileDownloadClick" CommandParameter="{Binding Files}"></Button>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<Button Content="Share" Click="fileShareClick" CommandParameter="{Binding Files}" ></Button>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView.Columns>
</GridView>
</ListView.View>
I would like to know if its possible to only allow my Share buttons disabled in my 2nd for loop (u2) while my Share buttons in (u1) is still enabled. Currently both are enabled. I am currently using this to retrieve values for particular role
private void fileShareClick(object sender, RoutedEventArgs e)
{
object share = ((Button)sender).CommandParameter;
}