Ordinal row positions in DataGrid/DataSet
Posted on 2005-05-17
I don't see properties for either the datagrid or dataset that indicates how to get .Count or ordinal position.
I'm binding a DataSet to a DataGrid and need to start working with the ordinal row positions in a couple differnt contexts. For example, i have a column holding numeric values and want to find which row number a given value is found in. And then I'd want to know total number of rows. Then I'd be able to produce, for example, "Row 3 of 40" output.
Also, and this is probably more complex...I have a templete column that holds links to script that 'moves up' and 'moves down'. The script will update the chosen record so the id field is incremented or decrimented.
I need a way to disable (or prefereably not display) the 'move up' link when outputting the first row of the datagrid - likewise disable the 'move down' link when rendering the bottom link.
Understanding that this may not be possible to proccess in the HTML portion of the page I'd need to see how to obtain those values and then append them to the querystring being constructed the same way I'm appending the 'myIdentity' field from the databinder.