RadGrid sortring issue

14 posts, 0 answers
  1. franchute
    franchute avatar
    28 posts
    Member since:
    Jan 2008

    Posted 14 Jan 2008 Link to this post

    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
  2. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 15 Jan 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. franchute
    franchute avatar
    28 posts
    Member since:
    Jan 2008

    Posted 15 Jan 2008 Link to this post

    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.

  5. Ves
    Admin
    Ves avatar
    2879 posts

    Posted 16 Jan 2008 Link to this post

    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
  6. Swati
    Swati avatar
    4 posts
    Member since:
    Sep 2011

    Posted 15 Sep 2011 Link to this post

    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?
  7. Swati
    Swati avatar
    6 posts
    Member since:
    Aug 2011

    Posted 17 Sep 2011 Link to this post

    I am facing similar issue....please help.
  8. Madhuri
    Madhuri avatar
    11 posts
    Member since:
    Feb 2012

    Posted 23 Feb 2012 Link to this post

    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

  9. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 23 Feb 2012 Link to this post

    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.
  10. Madhuri
    Madhuri avatar
    11 posts
    Member since:
    Feb 2012

    Posted 27 Feb 2012 Link to this post

    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>
  11. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Feb 2012 Link to this post

    Hello Madhuri,

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

    -Shinu.
  12. Madhuri
    Madhuri avatar
    11 posts
    Member since:
    Feb 2012

    Posted 27 Feb 2012 Link to this post

    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.
  13. Antonio Stoilkov
    Admin
    Antonio Stoilkov avatar
    530 posts

    Posted 02 Mar 2012 Link to this post

    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.
  14. Madhuri
    Madhuri avatar
    11 posts
    Member since:
    Feb 2012

    Posted 03 Jan in reply to Antonio Stoilkov Link to this post

    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.

  15. Kostadin
    Admin
    Kostadin avatar
    1711 posts

    Posted 07 Jan Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017