Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
161 views
I have a user control containing a radGrid.  The RadGrid supports sorting.  The user control is added to my web form via code.  I am able to sort the grid one time.  Subsequent sorts cause the following error to occur:

An error has occurred because a control with id 'ctl00$ContentPlaceHolder1$pnlStatesInfo$i0$i0$ctl01$rgClassCode$ctl00$ctl02$ctl00$ctl01' could not be located or a different control is assigned to the same ID after postback. If the ID is not assigned, explicitly set the ID property of controls that raise postback events to avoid this error.

The control identified in the error is the control that displays the sort ascending and sort descending icons.  My user controls are recreated and reloaded at each postback.  Is there a way to declare a static id for this control or do I need to be storing my created user controls in viewstate and not recreating them on each postback?  is there some other way to handle this?

Thanks!

Sean M. Severson
M
Top achievements
Rank 1
 answered on 07 Nov 2013
9 answers
348 views
I am trying to setup a default EqualTo filter on one of the string columns of a RadGrid on initial load. TI am binding the grid using the NeedDataSource event in the code behind.

The column i am trying to filter with is below
<telerik:GridBoundColumn DataField="Data.SubCategoryName" DataType="System.String" UniqueName="SubCategoryName" HeaderText="IMDIS Category" ReadOnly="true" ItemStyle-Width="250" HeaderStyle-HorizontalAlign="Center">
                    <FilterTemplate>
                        <telerik:RadComboBox ID="RC1" runat="server" DataValueField="SubCategoryName" AppendDataBoundItems="true" DataTextField="SubCategoryName" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("SubCategoryName").CurrentFilterValue %>'
                            OnClientSelectedIndexChanged="categoryIndexChanged" DataSourceID="EntityDataSource1" Width="310">
                            <Items>
                                <telerik:RadComboBoxItem Text="All" />
                            </Items>
                        </telerik:RadComboBox>
                        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                            <script type="text/javascript">
                                function categoryIndexChanged(sender, args) {
                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                    tableView.filter("SubCategoryName", args.get_item().get_value(), "EqualTo");
                                }
                            </script>
                        </telerik:RadScriptBlock>
                    </FilterTemplate>
                </telerik:GridBoundColumn>

in my code behind,
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            if (!Page.IsPostBack && InitialFilter != null)
            {
                RadGrid1.MasterTableView.FilterExpression = "([" + InitialFilter.ColumnName + "])=\"" + InitialFilter.Value + "\") ";
                GridColumn col = RadGrid1.MasterTableView.GetColumnSafe(InitialFilter.ColumnName);
                col.CurrentFilterFunction = InitialFilter.Operator;
                col.CurrentFilterValue = InitialFilter.Value;
            }
            RadGrid1.DataSource = DataSource;
        }
 
public OnLoadFilter InitialFilter { get; set; }
 
        public class OnLoadFilter
        {
            public string ColumnName { get; set; }
            public GridKnownFunction Operator { get; set; }
            public string Value { get; set; }
        }

InitialFilter is a property set in the Page_Load event, it's an object containing the three properties used to filter.
I am following the example from http://www.telerik.com/help/aspnet-ajax/grid-applying-default-filter-on-initial-load.html but i keep getting this  a ParseException saying Expression expected.
If i set EnableLinqExpressions to false, it renders but filtering does not work.
following instructions from http://www.telerik.com/help/aspnet-ajax/grid-operate-with-filter-expression-manually.html, I tried to statically set the filter 
RadGrid1.MasterTableView.FilterExpression = "([SubCategoryName]=\"Cars\") ";

again to luck.

I am using .Net 4.0 with the the 2013.2.717.40 version of the telerik controls for asp.net ajax.
 can someone advise?
thanks

Princy
Top achievements
Rank 2
 answered on 07 Nov 2013
1 answer
88 views
Hi Everyone,

I'm new to telerik and I'm trying to have the loading animation(rotating circle) while the server is retrieving information to populate a radgrid or when the server is busy and I try the below example:
http://demos.telerik.com/aspnet-ajax/ajax/examples/panel/firstlook/defaultcs.aspx
 and update the Sqldatasource to query my own SQL table but the rotating circle is not working. I used the exact coding from the above link, only change was the sqldatasource and it is not working.  Any idea why it is not working?

Anthony
Shinu
Top achievements
Rank 2
 answered on 07 Nov 2013
1 answer
373 views
Hi there,

I'm using the RadTreeView with the ExpandMode of SeverSideCallBack.

Here's the situation:

TreeView opens a RadWindow which than closes and fires off my RadWindowClose event.

In that event, i look for parent nodes that have expanded child nodes of specific type (i.e:. File). I then clear the child nodes, toggle and expand the node again.

Example:

Root Node
-Folder
-SubFolder
-File
-File

Problem is. I clear SubFolder Node and execute expand()
I then do the same on Folder because it has a File Node

I get into the situation where SubFolder hasn't expanded yet and i'm telling Folder to expand causing all sorts of weird jscript errors

Any ideas.




EmpowerIT
Top achievements
Rank 2
 answered on 07 Nov 2013
2 answers
194 views

Hi,

I'm on the lookout for a tool that can help me lay out forms in a professional, quick and consistent manner.



This DevExpress tool does what I am looking for here.



Does Telerik have any plans to make something similar for the RadControls?

Anyone know any other tool that does the same?









Geir
Top achievements
Rank 1
 answered on 06 Nov 2013
6 answers
468 views
Hi,

I am new to treeview. I want to have a treeview with nodes as hyperlinks

example:
            Italian
                |-- Pizza(as hyperlink with navigate url pointing to some aspx page)
                |-- Pasta(as hyperlink with navigate url pointing to some aspx page)
           Indian
            |-- item1(as hyperlink with navigate url pointing to some aspx page)
            |-- item2(as hyperlink with navigate url pointing to some aspx page)
         Mexican
            |-- item1(as hyperlink with navigate url pointing to some aspx page)

Thanks
Gabe
Top achievements
Rank 1
 answered on 06 Nov 2013
2 answers
320 views
Hello All,

First Issue
 I am trying to use RadGrid and the data source for this comes from a webapi. I have successfully added the data to the RadGrid. But, the issues is that there are over 10,000 records the api returns and takes 20-30 min to load the RadGrid. To make things easy on data binding and loading, I have tried to create dynamic RadGrid. The idea is to call the api and return only 50 records on every page change. The pagination wont show because, I am retrieving only  50 records every time. So the first page shows up with 50 records and I cannot paginate as there are no pages showing up.

2nd issue
 
I need to add a search box and allow searching for a record. I could achieve this when I created radgrid using ASPX. But, dynamic creation of radgrid, I have to call the api's every time and load the grid again and then search for the data which (according to me) is inefficient. The same with export to CSV. I have to recreate the radgrid every time.


Are there any better ways to do this without dynamic radgrid, and still be able to paginate and call the api when ever the next page is clicked. I am using C#. I understand it will be hard for you all to picture what I am  trying to say, but, I really appreciate any help or suggestions or questions that guide me in the right direction.

Thank you in advance
Smart
Top achievements
Rank 1
 answered on 06 Nov 2013
1 answer
82 views

I have the below code to attempt to ajaxify my grid and subsequent detail panel. It works but the trouble is when I click my "select" link on a row, the style doesn't change to selected row as I have not re-drawn the grid (grid not part of the updated controls list).  I do this intentionally because I don't want to reload the entire grid if no data has changed (it is simply a row selection).  The grid also has sorting enabled which does not function unless I add the grid to the updated control list. So the question is, how to I retain server sorting control but also allow simple row selection without having to pull the whole grid down again?

Thanks



<AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="rgMemberList">
                    <UpdatedControls>
                      <telerik:AjaxUpdatedControl ControlID="pnlMemberDetail" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>

Viktor Tachev
Telerik team
 answered on 06 Nov 2013
1 answer
120 views
Hi,
I am binding a radgrid in a Usercontrol. I am Loading the User control in the PageLoad. Any Paging event is not called [Item Command is not executed ], Other events Like  sorting, rebind, export all performed item command event is called. Help me to overcome this issue.





Thanks
Viktor Tachev
Telerik team
 answered on 06 Nov 2013
2 answers
100 views
Please help me with this:

I have this problem between the old version and new version (2012.3.1038.40 vs 2013.3.1015.40)

I am using customized column editor (I want a drop-down, rather a free-style type field), pelase see the code in the end.

my question is, the following code works perfectly with version 2012.3.1038.40 (I know it is an old version)
but after I referred to the new Telerik.Web.UI with version 2013.3.1015.40, I got exception as below

[NullReferenceException: Object reference not set to an instance of an object.]
Telerik.Web.UI.GridTextBoxColumnEditor.CreateControls() +264
Telerik.Web.UI.GridColumnEditorBase.EnsureControlsCreated() +56
Telerik.Web.UI.GridColumnEditorBase.InitializeInControl(Control containerControl) +77
...
...

by setting debug line in customized editor class, I found out that with the new version, AddControlsToContainer() never get called

If I switch back the old DLL version, everything is just working fine.

we are desperately looking for help!!!
Just cannot upgrade any newer version

Thanks in advance


//Here is the event to create my own column editor
//
protected void RadGridMHomeMCM_CreateColumnEditor(object sender, GridCreateColumnEditorEventArgs e)
{
    if (e.Column is GridBoundColumn && e.Column.UniqueName.StartsWith("CAP"))
    {
        e.ColumnEditor = new ClsCustomDropDownList();
    }
}

//Here is my column editor class
//
private class ClsCustomDropDownList : GridTextBoxColumnEditor
{
    private RadComboBox ddlEditor;

    protected override void CreateControls()
    {
        this.ddlEditor = new RadComboBox();
        this.ddlEditor.Items.Add(new RadComboBoxItem("Yes", "Yes"));
        this.ddlEditor.Items.Add(new RadComboBoxItem("No", "No"));
    } 

    protected override void LoadControlsFromContainer()
    {
        this.ddlEditor = this.ContainerControl.Controls[0] as RadComboBox;
    }

    public override bool IsInitialized
    {
        get { return this.ddlEditor != null; }
    }

    public override string Text
    {
         get { return this.ddlEditor.Text; }
         set { this.ddlEditor.Text = value; }
    }

    protected override void AddControlsToContainer()
    {
         ddlEditor = new RadComboBox();
         ddlEditor.Items.Add(new RadComboBoxItem("Yes", "Yes"));
         ddlEditor.Items.Add(new RadComboBoxItem("No", "No"));

         this.EnsureControlsCreated(); 
         this.ContainerControl.Controls.Add(this.ddlEditor);
    }

}
Peter
Top achievements
Rank 1
 answered on 06 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?