Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
175 views
Hi,

I have two RadGrids bound to two different EntityDataSources.  The 2nd datasource uses WhereParameters and ControlParameters to pass the SelectedValue of the first grid to the datasource of the 2nd grid.  This all works fine, until I enable filtering on the 2nd radgrid.  As soon as I set

 

AllowFilteringByColumn="true"

 

on the MasterTableView of the 2nd grid, I get the following exception:

WhereParameters cannot be specified unless AutoGenerateWhere==true or Where is specified. 
  
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  
Exception Details: System.InvalidOperationException: WhereParameters cannot be specified unless AutoGenerateWhere==true or Where is specified.
  
Source Error: 
  
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
  
Stack Trace: 
  
  
[InvalidOperationException: WhereParameters cannot be specified unless AutoGenerateWhere==true or Where is specified.]
   System.Web.UI.WebControls.EntityDataSource.ValidateUpdatableConditions() +93743
   System.Web.UI.WebControls.EntityDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +166
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +21
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +143
   Telerik.Web.UI.GridTableView.PerformSelect() +38
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
   Telerik.Web.UI.GridTableView.DataBind() +363
   Telerik.Web.UI.RadGrid.DataBind() +173
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66
   System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +75
   System.Web.UI.Control.EnsureChildControls() +102
   System.Web.UI.Control.PreRenderRecursiveInternal() +42
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Control.PreRenderRecursiveInternal() +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496
  
  

Is this a bug or something I am doing incorrectly?

Thanks,

Craig
Teoman
Top achievements
Rank 1
 answered on 20 Feb 2012
0 answers
175 views
Hi folks,
i'm using l'autocomplete in a radcombox with success, but now i've got a problem: when there are many results i must use paging.
I saw this article: http://www.telerik.com/community/forums/aspnet-ajax/combobox/paging-radcombobox-with-previous-next-functionality.aspx  but in my page doesn't work.
Is there any code where i can see?
Thanks in advance.


TheFool
Top achievements
Rank 1
 asked on 20 Feb 2012
1 answer
135 views
Hi All

Scenario:
Page with a Telerik radGrid. A WCF service provides data (JSONP) dat is bound to the Radgrid. Page size is set to 10.

Problem:
The data is correctly loaded into the gridview. When loading 1 record from the wcf service, the paging bar still says: 11 items loaded.
As I understand from debugging, a fixed number equal to the page size of "items" is created in the tabel. Those items are then filled with the data records, an the remaining records are made invisible. That works correct, but the paging still counts those hidden rows...
When I add more than 10 rows, the 12 rows are shown on the first page,while max page size is 10.

Even when I hardcoded bind to an JSON string, the data is shown correct in the grid, but paging is displayed incorrectly.

the code for loading data:

function getData() {             
    var proxy = new window.LiveIdService.ILiveIdService();
    proxy.set_enableJsonp(true);
    proxy.GetUserList(null, updateGrid);
}
 
function updateGrid(result) {
    var tableView = window.$find("<%= RadGrid2.ClientID %>").get_masterTableView();
    tableView.set_dataSource(data.UserList);
    tableView.dataBind();
}

My radGrid

<telerik:RadGrid ID="RadGrid2" runat="server" GridLines="None"
    AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
     Skin="LiveID" EnableEmbeddedSkins="False"   ><%-- OnItemCommand="gridUsers_ItemCommand" OnDataBound="gridUsers_DataBound"--%>
     <PagerStyle Mode="NextPrevAndNumeric"
                FirstPageToolTip="<%$ Resources: NextPreviousPagerField.FirstPageText %>"
                PageSizeLabelText="<%$ Resources: lblPageSize %>"
                LastPageTooltip="<%$ Resources:NextPreviousPagerField.LastPageText %>"
                PagerTextFormat="<%$ Resources: lblPagerTextFormat %>"
                />
    <ClientSettings EnableRowHoverStyle="true" >
        <ClientEvents OnCommand="function(){}" OnGridCreated="FillWithData" />
    </ClientSettings>
 
    <MasterTableView DataKeyNames="Id" ShowHeadersWhenNoRecords="True" EnableNoRecordsTemplate="true"  PageSize="10" CommandItemDisplay="Bottom">
             
        <CommandItemSettings AddNewRecordText="<%$ Resources: InsertButtonResource1.Text %>" ShowRefreshButton="false" />
        <Columns>
            <telerik:GridHyperLinkColumn DataTextField="FirstName" DataNavigateUrlFields="Id"
                                         UniqueName="FirstName" HeaderText="<%$ Resources: lblFirstName.Text %>" DataNavigateUrlFormatString="~/Pages/Users/UserFile.aspx?id={0}" />
            <telerik:GridHyperLinkColumn DataTextField="FirstName" DataNavigateUrlFields="Id"
                                         UniqueName="LastName" HeaderText="<%$ Resources: lblLastName.Text %>" DataNavigateUrlFormatString="~/Pages/Users/UserFile.aspx?id={0}" />
            <telerik:GridBoundColumn DataField="OrganisationNames" HeaderText="<%$ Resources: lblAccounts.Text%>" DataType="System.String" />
             
              <telerik:GridTemplateColumn DataField="OrganisationTypes" UniqueName="AccountType" HeaderStyle-Width="170" ItemStyle-VerticalAlign="Top">
                <HeaderTemplate>
                    <asp:LinkButton ID="lblAccountTypeHeader" runat="server" Text="<%$ Resources: lblAccountType.Text%>" CssClass="filter-text"
                        CommandName="Sort" CommandArgument="AccountType" Enabled="false"></asp:LinkButton>
                    <asp:LinkButton ID="lnkFilterAccountType" runat="server" CausesValidation="false" OnClientClick="openAccountTypeFilter(); return false;" class="action rounded filter">
                        <asp:Image ID="imgFilterAccountType" runat="server" ImageUrl="~/Resources/Images/funnel.png" />
                    </asp:LinkButton>
                </HeaderTemplate>
                  <ItemTemplate><asp:Label ID="OrganisationTypes" runat="server" /></ItemTemplate>
            </telerik:GridTemplateColumn>    
             <telerik:GridTemplateColumn UniqueName="Actions" HeaderText="" ItemStyle-VerticalAlign="Top" HeaderStyle-Width="30">
                <ItemTemplate>
                    <asp:LinkButton ID="lnkDeleteAccount" runat="server"
                    CommandName="Delete" CausesValidation="false"
                    OnClientClick="openConfirmationDialogUserList(this); return false;"
                    CommandArgument='<%# Eval("ID") %>'> 
                        <asp:Image ID="imgDeleteAccount" runat="server" ImageUrl="~/Resources/Images/delete.png" />
                    </asp:LinkButton>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
        <NoRecordsTemplate><asp:Literal ID="txtNoRecords" runat="server" Text="<%$ Resources: NoUsersLink %>"></asp:Literal></NoRecordsTemplate>
        <CommandItemTemplate>
        </CommandItemTemplate>
    </MasterTableView>
    <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
</telerik:RadGrid>


I hope this is sufficient info to help me fix this paging problem, if not please let me know.

Thanks for your time

Wim Devos
Maria Ilieva
Telerik team
 answered on 20 Feb 2012
1 answer
79 views
Hi All,

I am just testing radmenu as per the sample code provided by telerik
http://www.telerik.com/help/aspnet-ajax/menu-datatable-view.html 
 
i have copied each and every line from the above url, but when i say RadMenu1.DataSource = CreateTestTable();
it throws error saying Object reference not set to an instance of an object.

i have pasted my code below for your reference.

<telerik:RadMenu runat="server" ID="RadMenu1"  Style="z-index: 3" EnableRoundedCorners="true"   
EnableShadows="true" EnableTextHTMLEncoding="true" >
</telerik:RadMenu>
       
protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
           FillRadMenu();
        }
     }
 
protected void FillRadMenu()
    {
       RadMenu1.DataSource = CreateTestTable();
       RadMenu1.DataFieldID = "ID";
       RadMenu1.DataFieldParentID = "ParentID";
       RadMenu1.DataTextField = "Text";
       RadMenu1.DataValueField = "ID";
       RadMenu1.DataNavigateUrlField = "URL";
       RadMenu1.DataBind(); 
    }
 
  private DataTable CreateTestTable()
    {
        DataTable table = new DataTable();
        table.Columns.Add("ID");
        table.Columns.Add("ParentID");
        table.Columns.Add("Text");
        table.Columns.Add("URL");
        table.Columns.Add("Tooltip");
        table.Rows.Add(new string[] { "1", null, "root 1", "root1.aspx", "root 1 tooltip" });
        table.Rows.Add(new string[] { "2", null, "root 2", "root2.aspx", "root 1 tooltip" });
        table.Rows.Add(new string[] { "3", "1", "child 1.1", "child11.aspx", "child 1.1 tooltip" });
        table.Rows.Add(new string[] { "4", "1", "child 1.2", "child12.aspx", "child 1.2 tooltip" });
        table.Rows.Add(new string[] { "5", "1", "child 1.3", "child13.aspx", "child 1.3 tooltip" });
        table.Rows.Add(new string[] { "6", "5", "child 1.3.1", "child131.aspx", "child 1.3.1 tooltip" });
        table.Rows.Add(new string[] { "7", "5", "child 1.3.2", "child132.aspx", "child 1.3.2 tooltip" });
        table.Rows.Add(new string[] { "8", "5", "child 1.3.3", "child133.aspx", "child 1.3.3 tooltip" });
        return table;
    }


your help greatly appreciated..awaiting your reponses..

Regards,
Praveen 
Kate
Telerik team
 answered on 20 Feb 2012
2 answers
110 views
Hi ,
i want to save excel radgrid exporting file in server disk without proposing it for download . any idea ?
Sofiene
Top achievements
Rank 1
 answered on 20 Feb 2012
6 answers
513 views
Do you please have an example or instructions for how I can send the uploaded fiel as an attachment instead of just uploading it to a file on the server?

Thank you very much

B.
$uren
Top achievements
Rank 1
 answered on 20 Feb 2012
1 answer
77 views
Dear Telerik,

  I want change the TextBox  "txtCPICur" value,when change RadComboBox selectvalue,but I can't get this Textbox in Grid EditForm,
  How can get it ?
  Please help...... 

<EditFormSettings EditFormType="Template">
                                    <FormTemplate>
                                        <div class="form">
  
                                                        <telerik:RadComboBox ID="rcbMaster" HighlightTemplatedItems="true" AutoPostBack="True"
                                                            Filter="Contains" EmptyMessage="Search for Tariff Master..." OnSelectedIndexChanged="rcbMaster_SelectedIndexChanged"
                                                            runat="server">
                                                        </telerik:RadComboBox>
                                    <asp:TextBox ID="txtCPICur" Enabled="false" CssClass="text_box" runat="server"></asp:TextBox>
                      </div>
                                    </FormTemplate>
</EditFormSettings>
Shinu
Top achievements
Rank 2
 answered on 20 Feb 2012
2 answers
93 views

Team

 

I am using rad combobox in my application for searching.

Whenever user type something in combobox it shows me related data.

I have used OnItemsRequested event for this.

I am having requirement that result drop down won’t show up until I type 3 charactors in combobox

I am using OnClientItemsRequesting event as follow to suppressed OnItemsRequested event.

 

  function onItemsRequesting(sender, eventArgs) {

            if (eventArgs.get_text().length < 3) {

                sender.hideDropDown();

                eventArgs.set_cancel(true);

            }

            else {

                sender._loadingMessage = "Searching for " + eventArgs.get_text() + "...";

            }

         }

I am using telerik V2011.3.1115.40

Initially combo doesn’t contain any items. It is working fine first time but whenever I remove the characters & number of characters  become to 2 & press another letter even then it shows me previous result for few seconds & then shows proper result. Is there any reason for this?

Can you please let me know how to remove all the items of the radcombobox in OnClientItemsRequesting event?

It might resolve the problem.

If you have any other resolution for this please let me know.

Sampada
Top achievements
Rank 1
 answered on 20 Feb 2012
1 answer
212 views
We have a problem with RadAjaxManagerProxy with user controls. We changed the physical ASPX pages into ASCX controls and we load them from a single Default.aspx page. We use RadGrid together with RadComboBox controls to implement filtering and data loading into the grid.

When the pages containing the grid were hosted in a single ASPX page, they worked ok.

When the pages were converted into ASCX controls, we had to put a RadAjaxManagerProxy in them to refer to the master RadAjaxManager inside the master page. However, we have issues when the controls are interacted with.

One concrete example of the error we face is this one:

  • We have a User Control (First.ascx) with a RadGrid and a second ASCX nested inside. Both controls are set as updated by a RadAjaxManagerProxy.
  • This second ASCX control (Filter.ascx) has a RadComboBox and the control class exposes a public property to let the parent control get its filtered value. This control also has a RadAjaxManagerProxy, updating the combo boxes.
  • A Default.aspx page loads the first control and displays it OK (the grid and the nested user control). When we change the combo box value (this is inside the second user control), the loading panel is displayed (as expected) but it never ends. The server-side event for the RadComboBox is correctly processed and ends but the loading panel still shows the loading animation.
  • When the First.ascx was First.aspx (with the same markup and codebehind), the Filter.ascx behave correctly. The error began when we changed it into ASCX.

The other error we face is when we export a RadGrid contents as an Excel file with ExportToExcel method, the method executes but no result is shown to the browser. When the ASCX control having the grid with RadAjaxManagerProxy was a standalone ASPX page with RadAjaxManager, the export was done well.

It seems that somehow the RadAjaxManager doesn't get notified when the postback ends.
Tsvetina
Telerik team
 answered on 20 Feb 2012
5 answers
112 views
I am trying to set up my grid so that when a user clicks "Edit" on a row, the same position of the row is retained when the grid is reloaded in edit mode.

I tried implementing the code from http://www.telerik.com/help/aspnet-ajax/grid-scroll-to-selected-item.html, but when I did so, my grid ended up only two rows high.

I would like the height of the grid to be variable, based on however high the total number of rows are.  How can I keep my grid the entire height of the page and still be able to retain the scrolling position on edit?

Thank you.


Pavlina
Telerik team
 answered on 20 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?