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

scrolling issue while drag and drop

7 Answers 130 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kamalakannan
Top achievements
Rank 1
Kamalakannan asked on 26 Jul 2012, 10:50 PM
I am using the below code for the fill handle like excel but i have one more issue. Please help on this.please have look the attached images. when i drag it will copy one cell value to selected range of cell but  scroll is not working remaining cell at the right side.scroll bar is not move automatically.

     Private Sub gv_CPS_MouseUp(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles gv_CPS.MouseUp

            If gv_CPS.Rows.Count > 0 Then
            If gv_CPS.SelectedCells.Count > 1 Then
                Dim objSelecteCellValue As Object = Nothing
                For Each dc As Telerik.WinControls.UI.GridViewCellInfo In gv_CPS.SelectedCells
                    If dc.IsCurrent Then
                        objSelecteCellValue = dc.Value
                    End If
                  Next
                For Each dc As Telerik.WinControls.UI.GridViewCellInfo In gv_CPS.SelectedCells
                    If Not dc.IsCurrent Then
                        If Not dc.[ReadOnly] Then
                            If Validate(Convert.ToString(objSelecteCellValue)) Then
                                dc.Value = objSelecteCellValue
                            Else
                                Exit For
                            End If
                        End If
                    End If
                Next
            End If
        End If
    End Sub

thanks in advance

7 Answers, 1 is accepted

Sort by
0
Accepted
Svett
Telerik team
answered on 30 Jul 2012, 11:40 AM
Hello Kamalakannan,

Thank you for writing.

The RadGridView supports auto-scrolling when selection is performed. This feature is available since Q2 2012 (2012.2 608). I recommend upgrading to this version where this and many innovations and improvements are applied.

Greetings,
Svett
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Kamalakannan
Top achievements
Rank 1
answered on 30 Aug 2012, 06:04 PM
Hi Svett,

Thanks for you reply. I have one more problem in drag and drop. Have look attached image.
Some times drag and drop doesn't copy the cell value from one cell to selected range of cell.

Below is code for drag and drop. I need your help. I couldn't understandard why this happening. Sometimes selection skip one or more cells while scrolling that time also copy fails. Please help on this as soon as possible.

 Private Sub gv_CPS_MouseUp(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles gv_CPS.MouseUp

        Dim IsSuccesCalc As Boolean = False
        Try

            isActiveCellValueChangedEvent = False  'inactive the cell value change

            'Me.gv_CPS.HorizontalScrollState = Telerik.WinControls.UI.ScrollState.AlwaysShow

            If gv_CPS.Rows.Count > 0 Then
                'Dim i As Integer = 0
                If gv_CPS.SelectedCells.Count > 1 Then
                    IsSuccesCalc = True

                    Dim objSelecteCellValue As Object = Nothing
                    For Each dc As Telerik.WinControls.UI.GridViewCellInfo In gv_CPS.SelectedCells
                        'If dc.ReadOnly = True Then
                        '    'If dc.IsCurrent Then
                        '    '    objSelecteCellValue = dc.Value
                        '    '    Exit For
                        '    'End If
                        'Else

                        If dc.IsCurrent And Not dc.ReadOnly Then
                            objSelecteCellValue = dc.Value
                            Exit For
                        End If

                        'End If
                    Next
                    For Each dc As Telerik.WinControls.UI.GridViewCellInfo In gv_CPS.SelectedCells
                        If Not dc.IsCurrent Then
                            If Not dc.[ReadOnly] Then
                                If Validate(Convert.ToString(objSelecteCellValue)) Then
                                    dc.Value = objSelecteCellValue
                                End If
                            End If
                        End If
                    Next
                End If
            End If

        Catch ex As Exception

            ErrorMessage(ex)

        Finally
            isActiveCellValueChangedEvent = True  'the cell value change to active
            If (IsSuccesCalc = True) Then
                DoPlanningCalculation()
            End If

        End Try
    End Sub
0
Svett
Telerik team
answered on 03 Sep 2012, 12:51 PM
Hi Kamalakannan,

I am not able to assist you efficiently with the supplied code snippet. I am sharing a project that shows how you can perform drag and drop of cells. Note that it is working with the latest release. If the project does not fit your requirements, I would like to kindly ask you to provide me with a project that demonstrates your case together with the exact steps that we should follow in order to reproduce the undesired behavior.

Regards,
Svett
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Rangadurai
Top achievements
Rank 1
answered on 03 Sep 2012, 06:28 PM
Hi Svett,

Thanks for your Support,

I run the attached project that is not my desired result. I developed fill handle like excel. it is working but sometime it is not working due to while  some cell sometime selection discontinuation. Please find the attached file. I already submit project and db file in Support Ticket Section. 

Thanks in Advance.
0
Svett
Telerik team
answered on 05 Sep 2012, 12:50 PM
Hi Rangadurai,

I am not able to assist you efficiently by following the screenshots that you provided. I have tried to reproduce this case in the project that you have previously sent, but all drag and drop logic there is commented. Can you please provide me with a full up to date project, where you have illustrated your drag and drop scenario. This will help us to investigate it in depth and determine what causes it.

Kind regards,
Svett
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Kamalakannan
Top achievements
Rank 1
answered on 06 Sep 2012, 11:48 AM
Hi Svett,

The below code only i am used for fill handle like excel. Is it possible to do net meeting that will helpful for us and show you the issue.
Now i removed the commented lines.

    Private Sub gv_CPS_MouseUp(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles gv_CPS.MouseUp
        Dim IsSuccesCalc As Boolean = False
        Try
            isActiveCellValueChangedEvent = False  'inactive the cell value change
            If gv_CPS.Rows.Count > 0 Then
                If gv_CPS.SelectedCells.Count > 1 Then
                    IsSuccesCalc = True
                    Dim objSelecteCellValue As Object = Nothing
                    For Each dc As Telerik.WinControls.UI.GridViewCellInfo In gv_CPS.SelectedCells
                        If dc.IsCurrent And Not dc.ReadOnly Then
                            objSelecteCellValue = dc.Value
                            Exit For
                        End If
                    Next
                    Dim dtDay As Date
                    For Each dc As Telerik.WinControls.UI.GridViewCellInfo In gv_CPS.SelectedCells
                        If Not dc.IsCurrent Then
                            If Not dc.[ReadOnly] And Date.TryParse(dc.ColumnInfo.Name, dtDay) Then
                                If (dtDay >= Now.Date) Then
                                    If Validate(Convert.ToString(objSelecteCellValue)) Then
                                        dc.Value = objSelecteCellValue
                                    End If
                                End If
                            End If
                        End If
                    Next
                End If
            End If

        Catch ex As Exception

            ErrorMessage(ex)

        Finally
            isActiveCellValueChangedEvent = True  'the cell value change to active
            If (IsSuccesCalc = True) Then
                DoPlanningCalculation()
            End If

        End Try
    End Sub

Thanks for support
0
Svett
Telerik team
answered on 10 Sep 2012, 01:42 PM
Hello Kamalakannan,

It seems that you are posing from two different accounts. Could you open future support tickets and forum threads from the account where you have downloaded a trial, since it has trial support package as well.

The code snippet is the same as in the project which you have provided in the support ticket. Lets keep the communication there, since in it we can exchange files.

Kind regards,
Svett
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Kamalakannan
Top achievements
Rank 1
Answers by
Svett
Telerik team
Kamalakannan
Top achievements
Rank 1
Rangadurai
Top achievements
Rank 1
Share this question
or