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

check radgrid row visibility at client

10 Answers 256 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gilberto
Top achievements
Rank 1
Gilberto asked on 04 May 2009, 05:16 AM
I'd like to check the row visibility of a radgrid's row at client.

I always get false in display variable in code below, even using masterTableView.get_dataItems()[i].style.display, then i get always none

obs: any rows could be hidden at client side.

var radGrid = $find('<%= RadGridFuncionalidades.ClientID %>'); 
                if (radGrid != null) { 
                    var masterTableView = radGrid.get_masterTableView(); 
                    for (var i = 0; i < masterTableView.get_dataItems().length; i++) { 
                        // debugger 
                        var gridItemElement = masterTableView.get_dataItems()[i].get_element(); 
                        var display = masterTableView.get_dataItems()[i].get_display(); 

Any suggestions?

10 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 07 May 2009, 01:55 PM
Hi Gilberto,

Could you please elaborate a bit more on the details. What is the way you hide the rows.
In order to progress in the resolution of this matter It will be best if you send us the problematic page, so we can replicate the issue.

Looking forward for your reply.

Sincerely yours,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Gilberto
Top achievements
Rank 1
answered on 08 May 2009, 02:29 PM
Well i am hiding some rows at client, using method below, and when i check the row visibility i always get false/none as mentioned.

 var radGrid = $find('<%= RadGridFuncionalidades.ClientID %>');
                if (radGrid != null) {
                    var masterTableView = radGrid.get_masterTableView();
                    for (var i = 0; i < masterTableView.get_dataItems().length; i++) {
                        var gridItemElement = masterTableView.get_dataItems()[i].get_element();
                        var grid_id_modulo = gridItemElement.cells[1].innerText;
                        if (grid_id_modulo == id_modulo) {
                            masterTableView.showItem(i);
                        } else {
                            masterTableView.hideItem(i);

Thanks in advance
0
Pavlina
Telerik team
answered on 12 May 2009, 11:57 AM
Hi Gilberto,

I am sending you a small runnable application which handles the desired functionality. Give it a try and let me know if you have other questions or problems.

Best wishes,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Gilberto
Top achievements
Rank 1
answered on 14 May 2009, 09:01 PM
Thank you very much Pavlina.

Your answer was exactly what i was looking for.

My mistake was to use :

var display = masterTableView.get_dataItems()[i].get_display(); 

instead of:

var display = masterTableView.get_dataItems()[i].get_visible(); 

Thanks again

Gilberto
0
Mike McGovern
Top achievements
Rank 1
answered on 05 Jun 2009, 09:46 PM
i was using build version 2008.2.1001.20 and then upgraded to build version 2008.3.1125.20. both build versions give me this result:

if i use the get_display() property, it always returns false.
if i use the get_visible() property, it always returns true.

i am using a simple example very near the one provided above. i am also showing and hiding rows using the method showItem(index) or hideItem(index).

all of this is within a user control and the javascript is wrapped in a RadScriptBlock. (I could not use a RadCodeBlock because when the OnGridCreated client event fired, it did not find the javascript function in the user control. The RadScriptBlock did). 

any hints?
0
Pavlina
Telerik team
answered on 08 Jun 2009, 10:21 AM
Hi Johnathan,

Unfortunately the provided information is not enough to determine the exact source of the issue you are facing. At this point I will ask you to open a formal support ticket and send us a simple runnable application with reproduced this erroneous behavior. Thus I could do all my best to find a quick resolution of this problem.

Greetings,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mike McGovern
Top achievements
Rank 1
answered on 15 Jun 2009, 06:56 PM
it turns out that if i call "set_visible()" passing true/false as an argument to the method before calling "showItem()" or "hideItem()", the functionality works as expected when later verifying the row property "get_visible()".
0
Pavlina
Telerik team
answered on 16 Jun 2009, 03:49 PM
Hello Johnathan,

What exactly do you mean by the functionality works as expected when later verifying the row property "get_visible()".
Could you please elaborate a bit more in the details.

Sincerely yours,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Sabro
Top achievements
Rank 1
answered on 13 Jul 2009, 04:44 AM
Hi.....

           I have small problem i have used Rad Grid for bank accounts there are 100 records , fields in grid are showing bank account numbers and bank Bank, so when i double click any record so the edit page is opened i the id is available in database so on edit page the account number textbox will be disable,
thnx
plz need urgent response
Arif Cdigital
0
Pavlina
Telerik team
answered on 15 Jul 2009, 12:59 PM
Hi Arif,

In order to achieve the desired functionality I suggest that you handles on ItemDataBound event and get the needed textbox. After that check if the id is available and if so set the textbox as read only.
For more information about how to access the textbox, please refer to the following article:
Accessing cells and rows

Sincerely yours,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Gilberto
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Gilberto
Top achievements
Rank 1
Mike McGovern
Top achievements
Rank 1
Sabro
Top achievements
Rank 1
Share this question
or