I have a text box above the ultra grid. Initially grid will be filled up with some data(Names of the account holders). When I type the words in the text box, I should show the contains words only in the grid. Rest of the data should be hidden or deleted(Whichever is most efficient way).
Ex.
Lets say, Grid is filled with the following names
Inragistics
Uthay
Verdana
Steve
When i type the word 't', grid should now show only
as Verdana doesnt contains the word 't'. This should be eliminated
When i type the word 'te', grid should now show only
as Steve only contains the word 'te'. Others should be eliminated.
How can i achive this. Note: I cannot compromise the design. Need to achieve it thru seperate textbox only.
Hi,
The code here will hide the rows, not remove them from the data source.
It sounds like you may be running into a bug where the grid has enough room to show all of the rows, but some of them are still scrolled out of view. There was a bug in the grid that would sometimes cause that, but as far as I know, all such issues were fixed a while ago.
What version of the grid are you using?
I have attached a small sample project here which works fine for me. It's basically the same code Hady posted, but I modified it a bit to make it neater, and I removed the blanket try...catch block - I'm not a fan of just catching exceptions without knowing what they are and why they are happening. I also don't see the point of calling ExpandAll on a flat grid.
It hides, But not removes the rows.
I am still not able to hide the empty rows. For just 5 sorted out rows, I get scroll bar, and the 95th record is still displayed in the bottom of the grid. Need to scroll down to see the result.
hi
for the first point (Banker) that's weird. it's working fine with me.
check the spelling (are you adding an additional space bar or something?)
for the second point try this:
ultraGrid1.DisplayLayout.Override.RowFilterAction = Infragistics.Win.UltraWinGrid.RowFilterAction.HideFilteredOutRows;
I guess, Rows are not aligning well. Say, Result set shows 4 rows, But scroll is enabled. When we scroll down , I am able to see the remaining rows. Rows are being hidden. But still shows empty rows. We need to remove the empties and show the results together. Isn't it?