Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

WebGrid: Returning data from a single row

Last post 09-05-2008 10:51 by PsychoTeddy. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-29-2008 13:34

    • jlhuber
    • Not Ranked
    • Joined on 01-12-2008
    • Points 40

    WebGrid: Returning data from a single row

    Hi,

    I'm using WebGrid and want to be able to get cell data from a user selected row.  I've done this with a WinGrid, but I am now stumped.  I am using a double click event.

    When I double click a row I get unpredictable results.  Sometimes I get the row I clicked, other times I get a different row.  Sometimes the different row is the first row in the grid, but other times it is close to the one I clicked.  In my testing, I've tried accessing the selected row and the active row.  I am assuming that it should be "selected row."
     
    My WebGrid is load on demand and accumulative.  Of course, I'd want this to work for a full grid and a filtered grid.  Do you have any ideas?
     
    Thanks
    J
     
    ________________________________
     
    This is the row click code:
     
     Private Sub UltraWebgrid1_DblClick(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.ClickEventArgs) Handles UltraWebGrid1.DblClick
            '  I'd like to get the data in cell 1 of the clicked row
            Dim str1, str2 As String
            str1 = UltraWebGrid1.DisplayLayout.ActiveRow.Cells(1).Value 
            str2 = UltraWebGrid1.DisplayLayout.SelectedRows.Item(0).Cells(1).Value
        End Sub
     
     
    • Post Points: 35
  • 09-05-2008 8:54 In reply to

    Re: WebGrid: Returning data from a single row

    Hi,

    You can use the OnSelectedRowsChange server-side event. I hope this helps.

     Thanks,

    Angel 

    • Post Points: 5
  • 09-05-2008 10:51 In reply to

    Re: WebGrid: Returning data from a single row

    You can get all of those references from the arguments that are being passed to the handler, so you can get (Coded in C#):

    //You get the reference to the cell being dobule clicked (or the row, if you're handling such an event), then the row, and then you have access to all the cells in that row.

    void UltraWebGrid1_CellDblClick(object sender, Infragistics.WebUI.UltraWebGrid.CellEventArgs e)

    {

    e.Cell.Row.Cells[index];

    "Programming is an art form that fights back" _ Se habla español.
    • Post Points: 5
Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems