开发者

NETCF DataGrid scroll row into view?

开发者 https://www.devze.com 2022-12-14 19:06 出处:网络
Quick question regarding the Compact Framework DataGrid. How can I scroll a particul开发者_如何转开发ar row into view? We have an application that displays scans in a datagrid. If the user scans a ne

Quick question regarding the Compact Framework DataGrid. How can I scroll a particul开发者_如何转开发ar row into view? We have an application that displays scans in a datagrid. If the user scans a new item I add it to the grid, but if they scan an existing item, I'd like to scroll that item into view. Is there any way to do this?

I tried using the following methods:

grid.CurrentRowIndex = findRowIdxByScan()

and

grid.Select(findRowIdxByScan())

I am definitely finding the row index, which I verified with a step-through, but it doesn't seem to actually scroll the row into view.


I know this question is ancient now and the answer has already been marked, but for those who do not want to purchase a third party product to fix this issue, I ran into the same problem recently and this worked for me on the plain old CF Datagrid:

dataGrid.Select(highlightIndex);
dataGrid.CurrentRowIndex = highlightIndex;

For some reason, it does not scroll into view if you use just one or the other, but together the desired row is selected and scrolled into view.

Hope that helps.


Well, it isn't really an answer to the problem itself, but a workaround: I used the grid control from Resco.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号