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

Gridclientselect column

1 Answer 67 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Ayesha
Top achievements
Rank 1
Ayesha asked on 30 Jul 2009, 02:08 PM
Hi, 

I've a radpanel bar and I've 3 radpnelItems with a radgrid in each one.
My question is I need to find out the selected rows in a grid.
I did the foll:

RadGrid m_obRecipientGroupGrid = (RadGrid)m_ctlRecipientPanelBar.FindItemByValue("RadPanelRecipientGroup").FindControl("m_radRecipientGroupGrid");
     
       

         foreach (GridDataItem obItem in m_obRecipientGroupGrid.SelectedItems)
         {
                  int iGroupId = Convert.ToInt32(obItem["GroupId"].Text);
                  objRecipientGroupIdList.Add(iGroupId);
         
         }

Note:;  m_ctlRecipientPanelBar is the name of the panel bar

        m_radRecipientGroupGrid is the name of the radgrid
       

When i checked a checkbox(it automatically means the rows is selected right) and click on save(in my page), I do the above code, but it never goes to this loop though i've selected few checkboxes.

and as a result the list is empty.

But the same logic (like the same code) i did in my radgrid without a radpanel item and it worked. why didn't this when i put the radgrid in a radpanel bar doesn't give me the selected rows.
pls help me. how do i do this???

Note: i also have allowmultirowselect = true.
m_radRecipientGroupGrid .clientsettings.selecting.AllowRowSelect = true;

Pls do help me

1 Answer, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 04 Aug 2009, 07:38 AM
Hello Zaheka,

Basically, in case you locate the grid instance inside the RadPanelBarItem template, the same code implementation which works outside of the panelbar should allow to access the selected grid rows.

Can you please confirm that you do not rebind the grid explicitly (invoking its Rebind() method) in your particular case when wrapped inside the panelbar item? If so, note that you will need to persist the selected items as explained in these help topics:

http://www.telerik.com/help/aspnet-ajax/grid-persist-selected-rows-client-sorting-paging-grouping-filtering.html
http://www.telerik.com/help/aspnet-ajax/grdpersistselectedrowsonsorting.html

Also verify that your code is executed (setting breakpoints in it) and double-check that the same implementation works properly when the grid is directly on the page.

Best regards,
Sebastian
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
PanelBar
Asked by
Ayesha
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Share this question
or