Need to click last record on web page

First need to check on the grid if the 2 highlighted row is blank then click on 3 last record on the Order number column. currently i am using extracting data from web page then taking that variable into another variable stringoutrowcount =(ExtractDataTable.Rows.Count).ToString then passing this variable in click activity.
image

Any help or suggestion will be appreciated …
cheers…

Hey @mittal.abhishek !! Your explanation was not very clear to me, can you elaborate more please?

I am working on the requirement where i need to click last record on the page but logic is already written for that , now i want if the empty row is there in the column then bot should click last record of that column as shown below

image

let me know if u able to understand query…

Ohhhh @mittal.abhishek ! You want the last index of the column that contains value, right? Try this! Remember that the return is an integer!

dt_test.AsEnumerable.Select(Function(r,i) if(String.IsNullOrWhiteSpace(r(0).ToString),-1,i)).Max

Hope it helps!