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

RadGrid sortring issue

13 Answers 463 Views
Grid
This is a migrated thread and some comments may be shown as answers.
franchute
Top achievements
Rank 1
franchute asked on 14 Jan 2008, 04:28 PM
Hi, I'm having a problem with my RadGrid control when trying to sort by column
I have a simple Radgrid control which retrieves the data from an ObjectdataSource and once I pick one of the column header the following error is arised ...

Destination array is not long enough to copy all the items in the collection. Check array index and length

However, this issue is appearing when I pick two of the six columns I have in the grid, I mean, the sorting is working fine when selecting the other four columns.

Here is my source code


<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting=True DataSourceID="ODSCompaniesDataSource"
        GridLines="None" Skin="Default2006" AutoGenerateColumns="False" OnEditCommand="EditCommand" OnSortCommand="RadGrid1_SortCommand" ShowGroupPanel="True" >
<ExportSettings>
<Pdf FontType="Subset" PaperSize="Letter"></Pdf>

<Excel Format="Html"></Excel>
</ExportSettings>

<MasterTableView CommandItemDisplay="None" Frame="Border" Dir="LTR" DataSourceID="ODSCompaniesDataSource" CurrentResetPageIndexAction="SetPageIndexToFirst" TableLayout="Auto">
<EditFormSettings>
<EditColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"></EditColumn>
</EditFormSettings>


<ExpandCollapseColumn Visible="False" Resizable="False" CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>

<RowIndicatorColumn Visible="False" CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
    <HeaderStyle BackColor="#5959EE" />

    <Columns>
        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" Visible=False DataField="company_id" HeaderText="Company Id"
            FilterListOptions="VaryByDataType" ForceExtractValue="None" UniqueName="company_id">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="company_name"
            FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="Company Name"
            UniqueName="company_name">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Company_Account_Number"
            FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="Account Number"
            UniqueName="Company_Account_Number">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Country_Name"
            FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="Country"
            UniqueName="Country_Name">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="user_preasigned_lasc_id"
            FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="Preassigned LASC"
            UniqueName="user_preasigned_lasc_id">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="region_name"
            FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="Region"
            UniqueName="region_name">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Status" FilterListOptions="VaryByDataType"
            ForceExtractValue="None" HeaderText="Status" UniqueName="Status">
        </telerik:GridBoundColumn>
        <telerik:GridEditCommandColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
            UniqueName="AutoGeneratedEditColumn" EditText="View" HeaderText="View Profile">
            <HeaderStyle Width="30px" />
        </telerik:GridEditCommandColumn>
       
       
    </Columns>
    <PagerStyle Mode="NumericPages" />
</MasterTableView>
        <GroupPanel ID="GroupPanel" Style="width: 100%;">
        </GroupPanel>
        <ClientSettings AllowDragToGroup="True">
        </ClientSettings>
</telerik:RadGrid>


Thanks in advance,

François

13 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 15 Jan 2008, 09:45 AM
Hello franchute,

You can find a custom build of RadControls "Prometheus" with this issue fixed attached to this forum thread. Let me note, that the official service pack release is expected later today and it will include that fix too.


All the best,
Ves
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
franchute
Top achievements
Rank 1
answered on 15 Jan 2008, 12:24 PM
Hi, thanks for your answer.
I've downloaded the hotfix version you mentioned previously. After that, I manually replaced the DLL files but now I'm having a compilation error because, as far as I can see, the Telerix.Web.UI requires the System.Web.Extensions 3.5.0.0 version instead of the 1.0.61025.0 I'm currently using.
Do you have any idea how to fix this issue using the 1.061025.0 version of the web extensions ?

Thanks,

François.

0
Ves
Telerik team
answered on 16 Jan 2008, 09:30 AM
Hello François,

You can now download the official Service Pack release of RadControls "Prometheus" that will not suffer the initial error "Destination array ...". In the package you will find bin folder, where assemblies require System.Web.Extensions v.1.061025.0 and bin35 folder where assemblies require System.Web.Extensions v.3.5. So it is bin folder that you need.

Hope this helps.

Kind regards,
Ves
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Swati
Top achievements
Rank 1
answered on 15 Sep 2011, 01:56 PM
Hi,
I am using a telerik radgrid. I am getting a gap next to the column when I drag it to re-size its width.The grid design is done by using header templates inside the grid template column.The re-size of the column is done after the filtering.That gap itself is showing the tool tip "Drag to resize".That gap is not added anywhere in the design page.
Also when I filter any column it narrows down its width to some fixed value.Do you have any idea how to fix this issue?
0
Swati
Top achievements
Rank 1
answered on 17 Sep 2011, 07:36 AM
I am facing similar issue....please help.
0
Madhuri
Top achievements
Rank 1
answered on 23 Feb 2012, 07:38 AM
Hi,
        
        http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/threelevel/defaultvb.aspx

I Implemented rad child grid same as you told in the above Link. but I want it by Programatically I.e  you are using sql data source control to insert,Edit,Delete Operations, but in my Example I am Using RadGrid1_NeedDataSource for binding Parent Grid and RadGrid1_DetailTableDataBind Event For binding  Child Grids. and I am using Stored Procedures to insert, Update and Delete so How I Use this Stored Procedures to insert Record With in the Grid.
I don't How to Get the TextBox values when we Adding the New Record . Please Help Me.


Thanks in Advance
With Regard
Maduri.G

0
Shinu
Top achievements
Rank 2
answered on 23 Feb 2012, 08:38 AM
Hello Madhuri,

Try the following code.
VB:
Protected Sub RadGrid1_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs)
    If TypeOf e.Item Is GridEditFormInsertItem AndAlso e.Item.OwnerTableView.IsItemInserted AndAlso e.Item.OwnerTableView.Name = "DetailTable3" Then
        Dim EditItem As GridEditFormInsertItem = DirectCast(e.Item, GridEditFormInsertItem)
        Dim txtbx As TextBox = DirectCast(EditItem("UniqueName").Controls(0), TextBox)
    End If
End Sub

-Shinu.
0
Madhuri
Top achievements
Rank 1
answered on 27 Feb 2012, 12:39 PM
Hi Shinu ,
Thank you for your Reply and it's working fine.
but I have another problem,  when I click On Insert button then if country name is empty, then I want show  a alert Message Like Enter Country Name. 
I wrote the Following Code in div tag but it is not working. and Please tell me how to find a control of child grid  using javascript because this grid has a child grids.

thanks in advance

<script language=
"javascript" type="text/javascript">
          function ValidateLoginID() {
              debugger;
              var master = $find("<%=RadGridCountry.ClientID %>").get_masterTableView();
              var row = master.get_dataItems()[0];
              var txtCityName = row.findElement("txtCityName"); //accessing TextBox
             if (txtCityName.value == '') {
                  alert("Enter the City Name")
                  document.getElementById('txtCityName').focus();
                  return false;
              }
              if (txtCityName.value != '') {
                  var HiphenStr = txtCityName.value;
                  var last_char = HiphenStr.indexOf("-");
                  if (last_char >= 0) {
                      alert("Invalid charater(-) found in CityName");
                      document.getElementById('txtCityName').focus();
                      return false;
                  }
              }
              var ddlState = document.getElementById('ddlState');
              if (ddlState.value.trim() == '') {
                  alert("Select the State");
                  document.getElementById('ddlState').focus();
                  return false;
              }
          }
      </script>
0
Shinu
Top achievements
Rank 2
answered on 27 Feb 2012, 01:21 PM
Hello Madhuri,

Try the following Javascript.
Javascript:
var grid = $find("<%=RadGridCountry.ClientID %>");
var detail= grid.get_detailTables()[0].get_dataItems()[0].findElement("TextBox1");

-Shinu.
0
Madhuri
Top achievements
Rank 1
answered on 28 Feb 2012, 05:12 AM
hi shinu,
        once again thanks for your quick response.I tried but it is not working.can you please tell me how can I get the value of statename textbox and countryname textbox using javascript.
0
Antonio Stoilkov
Telerik team
answered on 02 Mar 2012, 07:39 AM
Hello Madhuri,

You could achieve your scenario by following the code below. The main idea is to access the edit items in the grid and get the edit form item, find the naming container prefix and search for the textbox value.
var editFormItem = $find("RadGridCountry").get_editItems()[0].get_editFormItem();
var tableId = editFormItem.getElementsByTagName("table")[0].id;
var namingContainer = tableId.substring(0, tableId.lastIndexOf("_"));
var cityNameValue = document.getElementById(String.format("{0}_{1}", namingContainer, "txtCityName")).value;
var countryNameValue = document.getElementById(String.format("{0}_{1}", namingContainer, "txtCounryName")).value;

Greetings,
Antonio Stoilkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Madhuri
Top achievements
Rank 1
answered on 03 Jan 2016, 05:34 PM

Hello team,

i want to know some information about radcombobox. is it possible to implement OnClientItemsRequesting event to search the data based on user input. because we are getting performance problem for item requested event when we are writing on server data. so we want to show the list of values based on user input that too using javascript. can u please help me out how to handle this. and also i want to know what is maximum no. of items that can able to fill to the rad combobox.

 

Thanks,

Madhuri.

0
Kostadin
Telerik team
answered on 07 Jan 2016, 06:00 AM
Hello Madhuri,

A possible solution is to use Load on Demand mode to populate the ComboBox with data. Please check out the following live example.

Regards,
Kostadin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
franchute
Top achievements
Rank 1
Answers by
Ves
Telerik team
franchute
Top achievements
Rank 1
Swati
Top achievements
Rank 1
Swati
Top achievements
Rank 1
Madhuri
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Antonio Stoilkov
Telerik team
Kostadin
Telerik team
Share this question
or