Enable/Disable Grid for OnLoad DataBount event are fired
Hi, in my blazor component i need to disable my grid when onload event is fired and enable it when the databound is fired.
How can achieve this?
Thanks
Stefano
SIGN IN To post a reply.
3 Replies
RS
Renjith Singh Rajendran
Syncfusion Team
July 5, 2021 12:22 PM UTC
Hi Stefano,
Greetings from Syncfusion support.
We suggest you to add attributes for grid and apply style according to enable/disable grid. We have prepared a sample based on this requirement, please download the sample from the link below,
|
<SfGrid DataSource="@Orders" @attributes="@GridAttributes" AllowPaging="true">
<GridEvents OnLoad="LoadHandler" DataBound="DataBound" TValue="Order"></GridEvents>
...
</SfGrid>
<style>
.e-grid[disable="yes"] {
opacity: .5;
pointer-events: none;
-ms-touch-action: none;
touch-action: none;
cursor: no-drop;
}
</style>
private Dictionary<string, object> GridAttributes { get; set; } = new Dictionary<string, object>();
...
public void LoadHandler()
{
GridAttributes.Add("disable", "yes");
}
public void DataBound()
{
GridAttributes["disable"] = "no";
}
|
Please get back to us if you need further assistance.
Regards,
Renjith R
Hi Renjith, your solution works very well, the only "problem" is the spinner because inherits the same css styles of the grid. It's possible to give evidence to the spinner ?
Thanks
Stefano
RS
Renjith Singh Rajendran
Syncfusion Team
July 7, 2021 10:27 AM UTC
Hi Stefano,
We suspect that, you would like to hide the default Grid spinner and display your own customized spinner in Grid. If so, then we suggest you to hide the default Grid’s spinner by adding the below style in your application.
|
<style>
.e-grid .e-spinner-pane { /*hide the Grid spinner */
display: none;
}
</style>
|
Now the Grid’s default spinner won’t be displayed. Now you can render your custom spinner component and then show/hide the customized spinner by using the Grid events(OnLoad, DataBound, OnActionBegin etc.), which will be triggered for each corresponding actions in Grid.
Reference :
We have prepared a sample based on the above suggestion. Please download the sample from the link below,
Please get back to us if you need further assistance.
Regards,
Renjith R
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
SC Stefano Capobianco
- Jul 4, 2021 05:47 AM UTC
- Jul 7, 2021 10:27 AM UTC