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
530
Setting the ActiveRow based on the LisObject where Listobject exists in a generic List Datasource
posted

Hi!

So, here's what I look forward to accomplish without taking a performance hit!

I have a wingrid dynamically bound to a generic List of our business objects. I have a panel on my winform where I can create a new object, add the new object to the existing collection, then bind the collection to the wingrid.

Where I am stuck is that when I do the above, I have my new object, and using this new object, I have to set the ACTIVEROW of the wingrid so as to highlight the row that I just created.

What I have tried so far:

Looping through the wingrid rows sort of works (row.listobject) but the app is taking a huge performance hit as there can be about 50-60 rows in the grid and our clients are not liking it. There should be an easier way to do this!

Any help would be greatly appreciated!

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    I can't see why 50 or 60 rows would cause any kind of performance hit. That should be nearly instantaneous. In fact, you could probably loop through several thousand rows in the grid without seeing any noticeable performance problems.

    The only other way to do this would be to use the grid.Rows.GetRowWithListIndex method. But this assumes you know the index of the row in the CurrencyManager.

Children
No Data