The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi,
I am trying to simulate readonly property for the griddataboundgrid object.
In the OnCurrentCellActivating i am checking to see if the form is readonly and cancel the request accordingly.
The problem here is, that every time the user scrolls down and then click on any cell, the grid returns to the top.
It doesn''t happen if the scroll horizontally though.
I don''t want to set every cell to readonly, because the grid''s quite large.
Here''s the code i''m using that''s causing the problem (i believe).
Protected Overrides Sub OnCurrentCellActivating(ByVal e As Syncfusion.Windows.Forms.Grid.GridCurrentCellActivatingEventArgs)
If Not mReadOnly Then
MyBase.OnCurrentCellActivating(e)
End If
e.Cancel = mReadOnly
End Sub
Thanks in advanced!
ADAdministrator Syncfusion Team June 14, 2005 12:23 AM UTC
Instead of setting e.Cancel = true, try setting e.ColIndex = 0 to see if that will do what you want.
BHBernard HerrokJune 14, 2005 12:29 AM UTC
Clay,
I think you missunderstood what I meant.
All I want the grid to do is ignore the entering of a cell.
Just so it acts like it''s readonly/disabled.
On the onCellActivating event I cancel (e.cancel = true) the user request. This works ok. But the grid then goes to the top, instead of just staying where the user clicked.
>Instead of setting e.Cancel = true, try setting e.ColIndex = 0 to see if that will do what you want.
>
>
ADAdministrator Syncfusion Team June 14, 2005 12:40 AM UTC
If you cancel OnCurrentCellActivating, the focus will not move to the clicked cell.
If you do not want to see the cursor in ths clicked cell, but still let the click cell get focus, then try handling CurrentCellStartEditing, and setting e.Cancel there.
BHBernard HerrokJune 14, 2005 12:52 AM UTC
Thanks Clay, that''s worked a treat!
>If you cancel OnCurrentCellActivating, the focus will not move to the clicked cell.
>
>If you do not want to see the cursor in ths clicked cell, but still let the click cell get focus, then try handling CurrentCellStartEditing, and setting e.Cancel there.