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,
Are you aware that the grid has built-in functionality for a filter row which will do this in the grid by just setting a few properties?
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridOverride ov = layout.Override; ov.FilterUIType = FilterUIType.FilterRow; ov.AllowRowFiltering = DefaultableBoolean.True; ov.FilterOperatorDefaultValue = FilterOperatorDefaultValue.Contains; }
Hello Mike, I am going to apply the Hady solution. I know that the solution given by you is available. But the design should not be compromised. Requirements were finalized. So please let me know if we can use any other better solution for this.
I am using Version 9
The sample you have given is working fine. But when i use the same code in my project, the grid rows are not properly aligning.
uthay said:in my project, the grid rows are not properly aligning.
I don't know what you mean but this. Perhaps you could post a screen shot.
Initially i have 250 records(rows) in the grid, When i search for the word 'Bank' and i remove the word 'Bank' from the textbox by long pressing the backspace key, I should read all the 250 records. But i get only 200 odd records
Also, When i type the word 'Bank De', I am shown only one row (Now scroll bar is enabled and when we scroll down we can see another row). Actuall it should show two rows. When i append 'p', that is 'Bank Dep', Now the grid shows two rows together without any empty rows.
I have fixed this. Thanks for all your help. I had set some properties while initializing grid in the below event. So only it got messed up
ultraGrid1.FilterRow +=
(ultraGrid1_FilterRow);