This is a migrated thread and some comments may be shown as answers.

Searching text inside the Telerik Grid

2 Answers 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Meenakshi
Top achievements
Rank 1
Meenakshi asked on 05 Jun 2012, 06:02 AM
Hi all, 

My requirement was to search a text the user gives inside the Grid and select that particular row. The user can also do find next in the grid. I was able to identify all the rows in which that particular text is there. And I am able to select each row as well and show it to the end user. But the problem is, it is a hierarchy grid. So assume that the row is present in the second level of grid. Then the row gets highlighted. But the second level is not expanded. The user has to expand and find out where the text is. Instead of this, is there any alternative approach that I can take. 

Sample Code:

 $.each(($("#ctl00_ContentPlaceHolder_SpreadSheet1").find(":contains('EXPNUM CHICKEN BRST AIRLINE CUT')")), function () {
        if ((this.nodeName == "TR") && (($(this).is('.rgRow')) || ($(this).is('.rgAltRow')))) {
            $find("ctl00_ContentPlaceHolder_SpreadSheet1")._spreadSheet().searchResults.push(this);
         this.focus();
           this._selected = true;
            this.click();
           this.setActive = true;
        }

($("#ctl00_ContentPlaceHolder_SpreadSheet1").find(":contains('EXPNUM CHICKEN BRST AIRLINE CUT')")) 

The above statement gives me all the results in an array. From that array, I am trying to filter only the rows and raising the click event. But the parent level of that particular row has to get expanded. So that the user can see the highlighted row. 

Regards,
Meenakshi Sekar. 

2 Answers, 1 is accepted

Sort by
0
Meenakshi
Top achievements
Rank 1
answered on 05 Jun 2012, 09:26 AM
irrespective of doing the implementation

  this.focus();
           this._selected = true;
            this.click();
           this.setActive = true; 


the focus doesn't go to that particular row. I have to scroll through the browser and expand all the levels to see the selected row. which is really a pain for the end user. 

Please give a solution for this at the earliest. 

Regards,
Meenakshi Sekar. 
0
Meenakshi
Top achievements
Rank 1
answered on 06 Jun 2012, 10:36 AM
Any update on this? We have a release this week. 

Now I am able to take the focus to that particular row. But i need all the parent levels for that particular row has to get expanded. Only then the focus goes to that particular row. 

My question is, how to expand the parent rows of that particular row. 

Regards,
Meenakshi Sekar. 
Tags
Grid
Asked by
Meenakshi
Top achievements
Rank 1
Answers by
Meenakshi
Top achievements
Rank 1
Share this question
or