Hello
I have a scenario where the user is presented with a grid like this:
When the user selects say Q11 (as above) then I want to disable (so they cannot tick the checkbox) all questions that are not of the same type. So in the above scenario questions of Type 01 and 03 would be disabled when the user ticked Q11. The main problem I am having is that it seems very difficult to get a handle on the records that I need to disable (so that I can add a class or style). In previous versions of your controls there were many methods like MyGrid.GetRows(), but these have all been deprecated. Any advise would be greatly appreciated.
Thanks
|
public async Task RowSelectHandler(RowSelectingEventArgs<Order> args)
{
List<Order> selectedRecords = await Grid.GetSelectedRecordsAsync();
if (selectedRecords.Count() != 0)
{
if (selectedRecords.FirstOrDefault().Type != args.Data.Type)
{
//prevent the selection
args.Cancel = true;
}
}
}
|
Hey Renijith
Thanks for that. I think if I conditionally format the Types to different colors and prevent the click as you suggest then that will have to do. Its not quite what I was after because I wanted a visual clue about which records the user could click next (i.e. other records disabled). It does appear that since methods like MyGrid.GetRows() were deprecated then this will be very hard. Anyway I think I will say that "its not just good, its good enough" - Homer Simpson :-)
As a matter of interest were the methods such as MyGrid.GetRows() that were deprecated replaced with anything?
Thanks
Hello Renijith
Fyi, I was able to get the other rows to respond (and appear disabled) using CSS:
I then set the opacity in the RowSelected/RowDeselected events to get the desired results. This together with your code is the result I wanted. I guess I could have done it all in CSS by setting pointer-events: none, but what I have works.
Thanks for your help