Home › Forums › WinForms controls › Xceed Grid for WinForms › Horizontal scroll is moving to right
-
AuthorPosts
-
#16472 |
Hi,
I am using xceed grid using master child relationship.
When i click on my load button the data will be fetched from a method and binding to the xceed using master child relation, but the problem is after binding the data to the xceed grid horitontal scroll is moving little bit towards right side, how can i restrict this? Please help me on this.
Thanks in advance…
Imported from legacy forums. Posted by pravi (had 1071 views)
By the default, the grid will not scroll to the right when loading data, whether this is a master detail grid or not. How do you load you data? How is your grid set up? Are you bound to a DataSet that is filled from a DataTable? Or something else?
Imported from legacy forums. Posted by André (had 525 views)
Hi,
In my application I need to use xceed grid using master-child relation and there should be a checkbox in evevery datarow (master grid and child grid or detailgrid) in fist column.
And one more restriction is user should be able to check only one row (if user checks one checkbox then
other checkbox of each datarow (master and detailgrid) should be unchecked).
To implement this I wrote below the code. But on binding the items to my xceed grid horizontal scroll is
moving to the right side slightly and one more is when I check checkbox taking some time to select(check).
Please suggest me on this… Thanks in advance.
Private Sub bindDatatoXceedGrid(ByVal ds As DataSet)
xgcDirect.DataRows.Clear()
xgcDirect.Columns.Clear()
xgcDirect.GroupTemplates.Clear()
xgcDirect.BeginInit()
xgcDirect.SingleClickEdit = True
xgcDirect.FixedColumnSplitter.Visible = False
xgcDirect.DataRowTemplate.CanBeSelected = False
xgcDirect.DataRowTemplate.FitHeightToEditors = True
xgcDirect.SynchronizeDetailGrids = True
xgcDirect.Columns.Add(columnDescription)
xgcDirect.Columns(“Selected”).CellEditorManager = simpleCheckBox
SetGridStyle(xgcDirect)
vistastyle()
xgcDirect.Title = “Master 1572”
xgcDirect.DetailGridTemplates.Clear()
If FrmDirect_ChkShwMasterSub1572.Checked And ds.Tables.Contains(“MasterSub”) Then
Dim data_relationPISub As New DataRelation(“PISub”, ds.Tables(“Master”).Columns(“Form ID”), ds.Tables(“MasterSub”).Columns(“Form ID”))
If Not ds.Relations.Contains(“PISub”) Then
ds.Relations.Add(data_relationPISub)
End If
Dim detailGridTemplateInv As New DetailGrid()
Dim detailcolumnDescription As New Column(“Selected”, GetType(Boolean))
detailGridTemplateInv.Columns.Add(detailcolumnDescription)
Dim detailsimpleCheckBox As New CheckBoxEditor
detailGridTemplateInv.Columns(“Selected”).CellEditorManager = detailsimpleCheckBox
AddHandler detailGridTemplateInv.AddingDataRow, AddressOf Me.grid_AddingDataRow
detailGridTemplateInv.SetDataBinding(ds, “Master.PISub”)
detailGridTemplateInv.Collapsed = True
detailGridTemplateInv.HeaderRows.Add(New ColumnManagerRow())
xgcDirect.DetailGridTemplates.Add(detailGridTemplateInv)
detailGridTemplateInv.Columns(i).ReadOnly = True
Next
End If
End Sub
e.DataRow.Cells(“Selected”).Value = False
Dim tmpObj As Object
tmpObj = e.DataRow.Cells(“Selected”).CellEditorControl
End Sub
AddHandler DirectCast(e.Control, Xceed.Editors.WinCheckBox).CheckedChanged, AddressOf selected_checked
End Sub
Private Sub CellEditorManager_DeactivatingControl(ByVal sender As Object, ByVal e As CellEditorEventArgs)
RemoveHandler DirectCast(e.Control, Xceed.Editors.WinCheckBox).CheckedChanged, AddressOf selected_checked
End Sub
If bSelectChanged Then
For i As Integer = 0 To xgcDirect.DataRows.Count – 1
bSelectChanged = False
xgcDirect.DataRows(i).Cells(“Selected”).Value = False
For j As Integer = 0 To xgcDirect.DataRows(i).DetailGrids.Count – 1
For k As Integer = 0 To xgcDirect.DataRows(i).DetailGrids(j).DataRows.Count – 1
xgcDirect.DataRows(i).DetailGrids(j).DataRows(k).Cells(“Selected”).Value = False
Next
Next
Next
bSelectChanged = True
End If
End Sub
Imported from legacy forums. Posted by pravi (had 594 views)
This is just to let you know we reproduced the issue, and we are investigating it.
Imported from legacy forums. Posted by André (had 364 views)
Thanks…
Imported from legacy forums. Posted by pravi (had 478 views)
The problem is with unbound columns, which seems to be not correctly calculated in the paint algorithm. It is difficult to provide a more complete answer at this point, apart than to say that this is a bug, and that we will certainly work to correct this in a future version, though we can’t provide a time frame at this moment.
In the meantime, there is a simple workaround. Simply do the following after then EndInit, or the SetDataBinding if there is no EndInit, and after the DataSet to which the grid is bound is filled with the data :
Imported from legacy forums. Posted by André (had 237 views)
Ok
Thanks.
Imported from legacy forums. Posted by pravi (had 1197 views)
-
AuthorPosts
- You must be logged in to reply to this topic.