How to get first & Last visible Row in VB?

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default How to get first & Last visible Row in VB?

    In C#,I know the way to get:
    void EnsureRowVisible(DataGrid grd, int Row)
    {
    int FirstVisibleRow = (int)grd.GetType().GetField("m_irowVisibleFirst",
    BindingFlags.NonPublic|BindingFlags.GetField
    |BindingFlags.Instance).GetValue(grid);
    int LastVisibleRow = (int)grd.GetType().GetField("m_irowVisibleLast",
    BindingFlags.NonPublic|BindingFlags.GetField|Bindi ngFlags.Instance).GetValue
    (grid);
    //grid is the visible datagrid control
    }

    But,how it be done in the Vb.Net ?


    Thunder Guest

  2. Similar Questions and Discussions

    1. Edits not visible
      I successfully edited and published a page from my online website. The internal browser continues to load the old page. When viewing the site via...
    2. ItemTemplate visible
      Hi there! This works fine: <asp:Panel Runat=server Visible=<%# DataBinder.Eval (Container.DataItem,"Active") %>>b</asp:Panel> With this the...
    3. class is not visible
      Hi, I want to use a user control on my page. I want to reference to the control class from the page’s code-behind. I registered the control:...
    4. Non-visible control
      I want to create a custom webcontrol similar to the SqlConnection control, in that it is not actually drawn on the form. When you drop the control...
    5. Text not visible
      You're the man Mel Brown! The reset character and reset paragraph fixed it. Thanks so much for your time-I really appreciate the fix! Thanks...
  3. #2

    Cool Re: How to get first & Last visible Row in VB?

    dim Trow as integer
    dim Crow as integer
    trow = grid1.FirstDisplayedScrollingRowIndex
    crow = grid1.currentrow.index
    ....
    do changes to the grid....refresh data etc...
    ...
    ' Now reset the position
    grid1.currentcell = grid1.item(0,crow)
    grid1.FirstDisplayedScrollingRowIndex = trow

    The postions remains as it was earlier.
    Ramnath Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139