We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

WrapCellBehavior in multi row record grid Issue

Thread ID:

Created:

Updated:

Platform:

Replies:

9477 Dec 19,2003 07:58 AM Dec 20,2003 11:32 AM Windows Forms 1
loading
Tags: GridControl
vamsi krishna
Asked On December 19, 2003 07:58 AM

Hi, please try the following in the MultiRowRecord Sample. In MyBase.Load add the following lines Me.gridDataBoundGrid1.Model.Options.WrapCellBehavior = GridWrapCellBehavior.WrapRow AddHandler Me.gridDataBoundGrid1.Model.QueryCellInfo, AddressOf CustomerGridQueryCellInfo Add the following procedure Private Sub CustomerGridQueryCellInfo(ByVal sender As Object, ByVal e As GridQueryCellInfoEventArgs) If e.ColIndex > 0 And e.RowIndex > 1 Then If (e.ColIndex = 1 Or e.ColIndex = 5) And e.RowIndex Mod 3 = 0 Then e.Style.Enabled = False Exit Sub End If End If End Sub Now try tab in the grid. It is not behaving properly if we have the last or first column blocked. please give me a solution to handle the above kind of scenario. Thanks in advance. Regards, Vamsi.

Administrator [Syncfusion]
Replied On December 20, 2003 11:32 AM

Hi Vamsi, The reason for this behavior is that grid has different row index and column index in the MultiRow mode. When the Multi rows per record check box is checked, you are having a different layout of columns specified by binder.LayoutColumns
 binder.LayoutColumns(New String() {"CustomerID", "CompanyName", "-", "ContactTitle", "ContactName", "-", ".", "Address", "-", "-", "City", "-", "-", ".", "PostalCode", "Country", "-", "Phone", "Fax", "Region"})
So you should have the same logic implemented for this rows and columns too. In the Model.QueryCellInfo, you should have a condition that if checkbox is true, the logic for MultiRows, if not the logic for single row.
Private Sub CustomerGridQueryCellInfo(ByVal sender As Object, ByVal e As GridQueryCellInfoEventArgs)
        If Not Me.toggleMultiRowCheckBox.Checked Then
            If e.ColIndex > 0 And e.RowIndex > 1 Then
                If (e.ColIndex = 1 Or e.ColIndex = 5) And e.RowIndex Mod 3 = 0 Then
                    e.Style.Enabled = False
                    Exit Sub
                End If
            End If
        Else
      // Extra 2 headers are counted as Rows
            If e.ColIndex > 0 And e.RowIndex > 5 Then
      // The logic for your case
                If (e.RowIndex Mod 9 = 0 Or e.RowIndex Mod 9 = 1) And e.ColIndex = 1 Then
                    e.Style.Enabled = False
               End If
            End If
        End If
    End Sub
Here is the modified VB sample. Regards, Jay N

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;