Hi,
Here is the scenario, 1 have 2 RadGrid on a web page. The first one is linked to a SQLDataSource and nothing on the interface can change the query so i dont have to call Rebind() method. But the second one has a filter combobox control that enable the user to filter the data. So i have a query with some parameters and once the query has changed, i have to call Rebind.
Here's the problem. Both Radgrid has a GridbuttonColumn. When i clicked on the first Grid buttonColumn the event ItemCommand is raised and i can do my stuff. But if i do the same with second grid, ItemCommand event is not fired because of that Rebind method. If i comment my 'RadGrid1.Rebind()' line and test it again ( So i play with the first snapshot of my data ), then the event is fired correctly.
Do i have to do something else after the Rebind method to make the ItemCommand event work properly ?
Thanks for your help !
Here is the scenario, 1 have 2 RadGrid on a web page. The first one is linked to a SQLDataSource and nothing on the interface can change the query so i dont have to call Rebind() method. But the second one has a filter combobox control that enable the user to filter the data. So i have a query with some parameters and once the query has changed, i have to call Rebind.
Here's the problem. Both Radgrid has a GridbuttonColumn. When i clicked on the first Grid buttonColumn the event ItemCommand is raised and i can do my stuff. But if i do the same with second grid, ItemCommand event is not fired because of that Rebind method. If i comment my 'RadGrid1.Rebind()' line and test it again ( So i play with the first snapshot of my data ), then the event is fired correctly.
Do i have to do something else after the Rebind method to make the ItemCommand event work properly ?
Thanks for your help !
5 Answers, 1 is accepted
0

Cori
Top achievements
Rank 2
answered on 09 Dec 2010, 08:11 PM
Hello Sebastien,
Where are you calling the Rebind() method, in the ItemCommand? I don't understand what you're trying to achieve.
Where are you calling the Rebind() method, in the ItemCommand? I don't understand what you're trying to achieve.
0

Sebastien
Top achievements
Rank 1
answered on 09 Dec 2010, 08:25 PM
Hi Cori,
well, i tried a lot of stuff but basically i call the Rebind method in the SelectedIndexChanged of a combo box. This combo box contains some record status so i want to filter the grid depending on what the user has selected. So when i call the rebind method, the RadGrid NeedDataSource event is called so i can do my stuff to rebuild a datatable that i can give as my RadGrid DataSource. All that part works perfectly. But after that when i click on the RadGrid GridbuttonColumn , the ItemCommand is not fired anymore because of that Rebind method that i called earlier.
Again, if i remove my rebind code line, the ItemCommand is fired properly. But you understand that if i do that i cant filter anymore my grid so i need to call the rebind method.
I hope its more clear
Thanks
well, i tried a lot of stuff but basically i call the Rebind method in the SelectedIndexChanged of a combo box. This combo box contains some record status so i want to filter the grid depending on what the user has selected. So when i call the rebind method, the RadGrid NeedDataSource event is called so i can do my stuff to rebuild a datatable that i can give as my RadGrid DataSource. All that part works perfectly. But after that when i click on the RadGrid GridbuttonColumn , the ItemCommand is not fired anymore because of that Rebind method that i called earlier.
Again, if i remove my rebind code line, the ItemCommand is fired properly. But you understand that if i do that i cant filter anymore my grid so i need to call the rebind method.
I hope its more clear
Thanks
0
Hi Sebastien,
Could you paste your aspx and code-behind? Please, use the CODE-FORMATTER tool of the ticket editor for that purpose. No problem can be ascertained or even suspected from the description you have given.
Thanks.
Regards,
Tsvetoslav
the Telerik team
Could you paste your aspx and code-behind? Please, use the CODE-FORMATTER tool of the ticket editor for that purpose. No problem can be ascertained or even suspected from the description you have given.
Thanks.
Regards,
Tsvetoslav
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0

Ernesto
Top achievements
Rank 1
answered on 01 Feb 2011, 11:55 PM
I found this answer to work http://www.telerik.com/community/forums/aspnet/grid/urgent-calling-rebind-doesn-t-call-the-needdatasource.aspx
Basically set the datasource to null before the rebind call. Seems more like a bug to me.
Basically set the datasource to null before the rebind call. Seems more like a bug to me.
0
Hello Sebastien,
I don't see how the indicated forum post is related to the issue you have stumbled upon. Please, give more details. Other than that, I'd really appreciated sending your files - I suspect the problem might be in the way you are data-binding/rebindnig the grid at some point in the page life cycle but where exactly is difficult to say without inspecting your implementation.
Thanks in advance.
Greetings,
Tsvetoslav
the Telerik team
I don't see how the indicated forum post is related to the issue you have stumbled upon. Please, give more details. Other than that, I'd really appreciated sending your files - I suspect the problem might be in the way you are data-binding/rebindnig the grid at some point in the page life cycle but where exactly is difficult to say without inspecting your implementation.
Thanks in advance.
Greetings,
Tsvetoslav
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.