This is a migrated thread and some comments may be shown as answers.

Strange behavior with GridEditMode.InPlace and GridCellSelectionMode.SingleCell

7 Answers 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ilja
Top achievements
Rank 1
Ilja asked on 01 Aug 2012, 09:42 AM

Hello Telerik Team,

i found  a strange behavior in my RadGrid.
While GridEditMode.InPlace and GridCellSelectionMode.SingleCell both are active, i can not click in editable cells. I reproduced this bahavior in Firefox and IE 8 and higher.

To my Testpage: It is a single RadGrid with following parameters:  

RadGrid1.ClientSettings.Selecting.CellSelectionMode = GridCellSelectionMode.SingleCell
RadGrid1.MasterTableView.EditMode = GridEditMode.InPlace

The datasource is a simple table bound in NeedDataSource event.

Protected Sub getData(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
        RadGrid1.DataSource = GetTable()
    End Sub
    Function GetTable() As DataTable
        ' Create new DataTable instance.
        Dim table As New DataTable
        ' Create four typed columns in the DataTable.
        table.Columns.Add("FELD1", GetType(String))
        table.Columns.Add("FELD2", GetType(String))
        table.Columns.Add("FELD3", GetType(String))
        table.Columns.Add("FELD4", GetType(String))
        ' Add five rows with those columns filled in the DataTable.
        table.Rows.Add("11", "12", "13", "14")
        table.Rows.Add("21", "22", "23", "24")
        table.Rows.Add("31", "32", "33", "34")
        table.Rows.Add("41", "42", "43", "44")
        table.Rows.Add("51", "52", "53", "54")
        Return table
    End Function

The last step is the PreRender event.
Private Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.PreRender
Dim i As Integer
For i = 0 To RadGrid1.PageSize - 1
RadGrid1.EditIndexes.Add(i)
Next i
RadGrid1.Rebind()
End Sub

It looks good, but the open cells are inaccessable on mouse click... the only thing i can do to access them is to tab in.

Without "RadGrid1.ClientSettings.Selecting.CellSelectionMode = GridCellSelectionMode.SingleCell" everything is working fine. But this setting is needed in the real page to execute js on Clientside in OnCellSelected event.
The InPlace-Editmode is required too.

i hope i provided enough informations so you can help me to find my error.

Kind regards,
Ilja Resch

7 Answers, 1 is accepted

Sort by
0
Ilja
Top achievements
Rank 1
answered on 02 Aug 2012, 09:09 AM
Can anyone help me?
0
Eyup
Telerik team
answered on 03 Aug 2012, 10:54 AM
Hi Ilja,

We are aware of this issue and our developers will provide a fix in the future for the observed behavior. Sorry for any inconvenience caused.

Nevertheless, I have created a sample RadGrid web site where I implemented a workaround for the described scenario. Could you please check out the attached application and try to use it in accordance with your own project?

Greetings,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ilja
Top achievements
Rank 1
answered on 03 Aug 2012, 12:42 PM
Seems good on my test page. Implementing in my real project now. Thanks!
Can you estimate any date, when the fix will be ready?

Thanks again,
and kind regards,

Ilja
0
Ilja
Top achievements
Rank 1
answered on 06 Aug 2012, 12:05 PM
There is stll a problem wth the workaround. The onRowClick event is not fired when klicked in an "open" cell.  But this is needed to fire some JS together with your workaround. Can you solve this problem please? It is realy important. Thanks a lot!
   
0
Ilja
Top achievements
Rank 1
answered on 07 Aug 2012, 05:55 AM
What is needed is an event that occurs, when the cell is clicked. The executed JS needs a column name of the cell and the row that is clicked.

Your workaround would work, but it is not firing if textbox of the open cell is clicked.

I need your help as soon as it is possible.

Thanks a lot.
0
Eyup
Telerik team
answered on 07 Aug 2012, 11:18 AM
Hello Ilja,

Please note that the suggested approach is barely a workaround and it is not tested with many possible scenarios. Therefore, please keep in mind that we could not guarantee that possible issues will not occur.

Nevertheless, I have modified the provided application to select the cell of the clicked edit form control. Please find the attached web site and try to make best avail out of it.

Greetings,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ilja
Top achievements
Rank 1
answered on 08 Aug 2012, 09:39 AM

Hi,

i got the solution.I used the first solution from Eyup for the closed cells
and added the folowing code to the ItemDataBound-Event for each edited cell:
(This is only a snippet, the check for grids own cells may be needed)

Protected Sub RadGrid1_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
        If e.Item.ItemType = Telerik.Web.UI.GridItemType.EditItem Then
            For Each cell As Telerik.Web.UI.GridTableCell In e.Item.Cells
                    If cell.Column.IsEditable = True Then
                        Dim myItem As GridDataItem = DirectCast(e.Item, GridDataItem)
                        Dim myTextBox As TextBox = CType(myItem(ColName).Controls(0), TextBox)
                        myTextBox.Attributes.Add("onclick", "showHelpBox('" + cell.Column.UniqueName + "', '" + e.Item.ItemIndexHierarchical + "');")
                    End If
            Next
        End If
    End Sub

Tags
Grid
Asked by
Ilja
Top achievements
Rank 1
Answers by
Ilja
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or