Hi
I have a RadGgrid witht he following template section:
<telerik:GridTemplateColumn HeaderText="Arrival" SortExpression="LocationArrival" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" AllowFiltering="false" UniqueName="LocationArrival">
<ItemTemplate>
<asp:CheckBox ID="chkActivityArrival" runat="server" AutoPostBack="True" visible="false" OnCheckedChanged="chkActivityArrival_CheckedChanged"/>
</ItemTemplate>
</telerik:GridTemplateColumn>
However when I click the checkbox the function chkActivityArrival_CheckedChanged on the server isn't being hit. The controls visibility is controlled in the code behind.
I have the same code n other grids and they work OK, what would be causing this..
Andy
8 Answers, 1 is accepted
Further to this, the problem is that the Grid_Load event is being fired. Not sure why as I hace checked the config and the running of similar grids that work ok.
On the working grinds the PageLoad is run, here I have if not page.ispostback so nothing is done, they then jump to the required routines to run.
On the problem grid after PageLoad it runs the Grid_Load.
Andy
More info
I have a comment in my code of the working grid:
Protected Sub rdGrid_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rdGrid.NeedDataSource
'if enableviewstate is set to false this will always fire just after page load before anything else.
If Page.IsPostBack Then
GridLoad()
End If
End Sub
I have the Grid EnableViewState="true" on th working and non working grids, but one is firing needdatasource and one isn't
Andy
I have found what is going on but not why.
I have a function that runs on page load GetSelections() this loads up from the profile system user preferences its these preferences that are then used to load data into the grid.
These are the page load functions that run with the ActivityGrid Load beiong the routine that gets data and binds it to the grid.
The problem is the Grouping
Local_ActivityGrouping = Profile("SiteGroupPreferences_" + SiteGroup_ID.ToString + ".ActivityGrouping")
'If Local_ActivityGrouping Then
' rdActivity.MasterTableView.GroupByExpressions.Add(New GridGroupByExpression(rdActivity.MasterTableView.GetColumnSafe("Activity")))
'Else
' rdActivity.MasterTableView.GroupByExpressions.Clear()
'End If
Why would presetting the grid groupby cause a NeedDataSource to be called when clicking on a checkbox within the grid.
Andy
Note that each operation such as Filtering, Paging, Grouping, Sorting, etc. fires NeedDataSource event since those operations require fetching the data from the datasource. You can examine the following help article for more information.
Regards,
Kostadin
Telerik
Hi Kostadin
Read that several times, the problem is the Grouping being set in code, why once you group why does it still fire the needdatasource.
If I remove the grouping its fine.
Andy
I am afraid I was unable to replicate the issue on my side. Generally NeedDataSource event will be fired only if you have changed the data or the grid structure. I prepared a small sample which demonstrates that the NeedDataSource is not fired after I checked/unchecked the CheckBox control. Please give it a try and let me know about the result.
Regards,
Kostadin
Telerik
Thanks Kostadin
I think I may have lead you down the wrong path here. I have been looking at this for a few days now, and the problem seems to be coming from the RadComboBox with checkboxes when a few are selected. I have a radCombo box with check boxes in my criteria for filtering the grid data.
If I select all it always fails but if I select 1 or 2 such that the message n item checked doesn't show the correct event is fired on the server. IE it doesn't run the needdatasource.
Is there an issue with the checkboxes in a combo box?
Andy
I have already provided an answer regarding this issue in the official support ticket you have opened. In order to avoid duplicate posts I recommend that we continue our conversation there. Once the problem is resolved you can share your findings with he community thus helping other members resolve similar cases.
Regards,
Angel Petrov
Telerik