in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Accessing rows other than the "current row"

Last post 04-17-2008 2:20 PM by alarion. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-17-2008 11:46 AM

    Accessing rows other than the "current row"

    I need to find a way to access the row that the mouse is over. Specifically, I need to get at the data for the row that is firing FetchCellTips. My issue is, when the user mouses over a specific column on a row, we need to build a dynamic tooltip. While the FetchCellTipsEventArgs gives me a row and column index, the row index appears to be worthless.


    Why in the heck do your controls not have a .Rows collection?! How do you propose I access a row other than the currently selected row, without accessing the datasource (because if you sort the list, the row numbers are not synced up anymore)?

  • 04-17-2008 1:44 PM In reply to

    Re: Accessing rows other than the "current row"

    Hello,
     
    I am still not sure what the problem you are experiencing. Because, I can set my custom tooltip,
    using the e.row and e.colindex of the FetchCellTips event even if sort the list on a column. Could
    you provide us a sample what exactly is happening and how you are using the Custom tooltip.
     
    If you wish to access a particular value in the C1List, you can try the given code in FetchCellTips.
     

    Private Sub C1List1_FetchCellTips(ByVal sender As Object, ByVal e As C1.Win.C1List.FetchCellTipsEventArgs) Handles C1List1.FetchCellTips

            e.CellTip = Me.C1List1.Columns(1).CellValue(e.Row)

    End Sub

    I tried the above code even after sorting a column. Celltips were displaying correct data. Please
    provide a sample so that we can review this further.
     
    Regards,
     
    Allen Smith
    <alarion> wrote in message news:203996@10.0.1.98...

    I need to find a way to access the row that the mouse is over. Specifically, I need to get at the data for the row that is firing FetchCellTips. My issue is, when the user mouses over a specific column on a row, we need to build a dynamic tooltip. While the FetchCellTipsEventArgs gives me a row and column index, the row index appears to be worthless.


    Why in the heck do your controls not have a .Rows collection?! How do you propose I access a row other than the currently selected row, without accessing the datasource (because if you sort the list, the row numbers are not synced up anymore)?



    http://helpcentral.componentone.com/cs/forums/p/74996/203996.aspx#203996

  • 04-17-2008 2:20 PM In reply to

    Re: Accessing rows other than the "current row"

    Apparently, my problem is the unvconventional way C1 has implemented rows and columns in terms of obtaining values of display columns. Every other control or matrix based object I have ever used does the opposite (row then column, not column then row). It's how you guys do it, but it's not developer-friendly whatsoever. I reckon you have your reasons for implementing controls in this fashion and it's not for me to question that. Anyhow, I think this will work for me.

     As for the sorting issue - bind your list to a dataset, then sort, then select a row. The row index is not the same row index as the underlying datasource (since the datasource is not sorted along with the display). At least, from our experience this is how it behaves. It's not a bug or anything with C1 controls - just a lack of understanding of how to access data using row indexes.

    thank you for your reply, it answered my question :)

    C1_JohnAd:

    Hello,
     
    I am still not sure what the problem you are experiencing. Because, I can set my custom tooltip,
    using the e.row and e.colindex of the FetchCellTips event even if sort the list on a column. Could
    you provide us a sample what exactly is happening and how you are using the Custom tooltip.
     
    If you wish to access a particular value in the C1List, you can try the given code in FetchCellTips.
     

    Private Sub C1List1_FetchCellTips(ByVal sender As Object, ByVal e As C1.Win.C1List.FetchCellTipsEventArgs) Handles C1List1.FetchCellTips

            e.CellTip = Me.C1List1.Columns(1).CellValue(e.Row)

    End Sub

    I tried the above code even after sorting a column. Celltips were displaying correct data. Please
    provide a sample so that we can review this further.
     
    Regards,
     
    Allen Smith

     

     

Page 1 of 1 (3 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.