I want to collapse/Expand rows in read only grid by based on particular field and how can it will implemented
Discussion posts and replies are publicly visible
Generally speaking there isn't any official out-of-box way to do this. If you're good at code-level control of grids, though, you can use various means (my suggestion would be RichTextIcons paired with DynamicLinks) to sorta "fake collapse" individual rows, which you could basically just use to show more or less bulk of information in that row (but not hide it entirely, as having a "show again" icon would still require at least an icon-width item to be displayed on that row).
If you can provide any additional detail about what you're hoping for, it might help get more detailed feedback.
for example we have Type as Test1, Test2, Test3 and in Test 1 we have 5 rows and Test 2 and 3 some other numbers when I collapse test 1 then only all that 5 rows should visible
This can be tricky since you basically have to arrange all data you want into your grid in a flat array but where your grid can tell what rows are child data and which parent any child data row belongs to. Also it won't work *great* if you want actual paging to work, but if your aim is to display *all* rows at all times (assuming you have a relatively low number of rows conducive to just always showing all of them), it's doable.