Client-side Row/Column selection prevention

Hi folks,

Is there any way to prevent selection of columns/rows of the grid on the client side. I want to perform some custom client side validation and prevent users from interacting with the grid until any discrepancies have been resolved.

I saw the AllowSelection(bool) property, but is this invokable from the client side?


2 Replies

JB Jason Beal September 26, 2011 07:39 PM UTC

I guess I would also need to restrain any grid interaction such as paging, grouping / sorting.

I basically want to render the entire grid non-interactive, but still preserve any groups, filters, paging as well as selected grid items.



ES Eswari S Syncfusion Team September 27, 2011 01:41 PM UTC

Hi Jason,

Thank you for your interest in Syncfusion products.

Query #1 : selection prevention

AllowSelection property is invokable form client side. We can prevent selection of rows using AllowSelection property in Onload event. Please refer to the following code snippets :

[Aspx]

<%=Html.Syncfusion().Grid("OrdersGrid")
. . .
. . .

.ClientSideEvents(eve=>{
eve.OnLoad("Onload");
})
%>



Query #2 : Preserve any groups, filters, paging

We can prevent the actions like paging ,sorting using properties AllowPaging ,AllowSorting .Please refer to the following code snippets :

[Aspx]

<%=Html.Syncfusion().Grid("OrdersGrid")

// AllowPaging , AllowSorting can be set false to disable the paging and sorting .

.PageSettings(page =>
{
page.AllowPaging(false);
})
.SortSettings(sort=>{
sort.AllowSorting(false);
})
.Grouping(group=>{
group.AllowGrouping(false); // to disable grouping
})
.Filtering(filter=>{
filter.AllowFiltering(false); // to disable filtering

})
%>


Also , we can done through client script in Onload event.





For your convenience ,we have prepared the sample and the same can be downloaded from the following link :

Sample-1683864767.zip

Please try this and let us know if you need any further assistance.

Regards,
Eswari.S




Loader.
Up arrow icon