Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
170
a bug??
posted

hi guys,

Please create a new windows project. In the new form, please put a wingrid and a button. In button_click event, please use below lines. This will bind a table, which has a releation to itself, to the grid. The codes below are quite straight forward. However, when the user clicks the rows in 2nd band, application is frozen. Any reasons? or it is a bug of UltraWinGrid?

Thanks!

 Dim ds As New DataSet

ds.Tables.Add(

"Parent")

 

With ds.Tables("Parent").Columns

.Add(

"ID", GetType(Integer))

.Add(

"ParentID", GetType(Integer))

 

End With

ds.Tables(

"Parent").Rows.Add(New Object() {100, DBNull.Value})

ds.Tables(

"Parent").Rows.Add(New Object() {200, 100})

ds.Tables(

"Parent").Rows.Add(New Object() {300, 100})

ds.Relations.Add(

"test", ds.Tables(0).Columns(0), ds.Tables(0).Columns(1))

ds.Tables(0).DefaultView.RowFilter = "isnull(ParentID,0)=0"

UltraGrid1.DataSource = ds.Tables(0)

 

 

Parents
No Data
Reply
  • 20872
    Suggested Answer
    Offline posted

    Hello fei_css,

    I have been able to reproduce the mentioned behavior. I believe that this happens becasue by default the MaxBandDepth property is set to 100, and in scenarios like yours with self relating data the desired operation would take a very long time to complete. My advise would be setting the following prior setting the DataSource of your UltraGrid:

    UltraGrid1.DisplayLayout.MaxBandDepth = 5

    Please let me know if you need any other assistance.

     

Children
No Data