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

Radgrid Filter Issue

4 Answers 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rms
Top achievements
Rank 1
rms asked on 04 Mar 2011, 06:10 PM
Hi,

I am using a radgrid on my page. I was getting "Invalid postback or callback argument." error when I click on the filter because I was binding the datasource of the grid in page_load event. So i bind Radgrid to the datasource in Radgrig1_NeedDataSource event. Evrything is working fine there is no error but my filter stopped working. nothing happens when i click on the filter. Can any one please help?

RMS

4 Answers, 1 is accepted

Sort by
0
rms
Top achievements
Rank 1
answered on 07 Mar 2011, 01:30 AM
for more information I am getting 'Sys' is not defined error on my web page. This seems to be an AJAX error. I think this is the reason why my filter is not working. Its working when I run the application in the server (in Visual studio). But its not working when i open it in a browser outside the server. Any idea whats the reason?

RMS
0
Pavlina
Telerik team
answered on 07 Mar 2011, 03:33 PM
Hello,

Regards,
Pavlina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
rms
Top achievements
Rank 1
answered on 07 Mar 2011, 04:40 PM
Pavlina,

Thanks for the reply. My code is pretty simple. 
ASPX CODE

<telerik:RadGrid ID="RadGrid1" runat="server"
                AllowSorting="True" AutoGenerateDeleteColumn="True"
                AutoGenerateEditColumn="True"  GridLines="None" DataSourceID="SqlDataSource1"
                Skin="Office2007" AllowAutomaticDeletes="True"
                AllowAutomaticInserts="True" AllowAutomaticUpdates="True" OnNeedDataSource="RadGrid1_NeedDataSource"
                AllowFilteringByColumn="True"  >
                <HeaderContextMenu EnableTheming="True">
                    <CollapseAnimation Duration="200" Type="OutQuint" />
                </HeaderContextMenu>
                <AlternatingItemStyle BackColor="#FFFFCC" />
                <MasterTableView AutoGenerateColumns="False" DataKeyNames="CompanyID,UserID"
                    DataSourceID="SqlDataSource1">
                    <RowIndicatorColumn>
                        <HeaderStyle Width="30px" />
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn>
                        <HeaderStyle Width="30px" />
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridBoundColumn DataField="CompanyID" HeaderText="CompanyID"
                            ReadOnly="True" SortExpression="CompanyID" UniqueName="CompanyID">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="UserID" HeaderText="UserID" ReadOnly="True"
                            SortExpression="UserID" UniqueName="UserID">
                        </telerik:GridBoundColumn>
                      
                    </Columns>
                </MasterTableView>
                <ClientSettings>
                    <Scrolling AllowScroll="True" EnableVirtualScrollPaging="True"
                        UseStaticHeaders="True" />
                </ClientSettings>
                <FilterMenu EnableTheming="True">
                    <CollapseAnimation Duration="200" Type="OutQuint" />
                </FilterMenu>
            </telerik:RadGrid>

VB.NET CODE

Protected Sub RadGrid1_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs)
If Session("CompanyID") = "XYZ" Then
Me.SqlDataSource1.SelectCommand = "SELECT [CompanyID], [UserID] FROM [table1] "
End If
Me.SqlDataSource1.DataBind()
Me.RadGrid1.DataBind()
End Sub

 

I think this is a javascript error. This application was developed in .net 2.0 and upgraded to .net 4.0 and also the telerik controls were upgraded. This must be some ASP.NET Ajax issue I am having due to this upgrade. because this filter was working before the upgrade.
RMS

0
rms
Top achievements
Rank 1
answered on 07 Mar 2011, 09:01 PM
Found the solution. I can't believe this was the issue....
I upgraded my project from 2.0 to 4.0 but did not upgrade Telerik Controls with newest version. I thought I did but apparently my project still has old Telerik.web.UI dll. ( When I opened the project I got a message on top if I want to upgrade Telerik controls. I clicked yes. I thought that would do the job. Looks like it did not! ) I ran the upgrade wizard everything works fine now.

RMS
Tags
Grid
Asked by
rms
Top achievements
Rank 1
Answers by
rms
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or