Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
577 views

I have a RadGrid where I do not use an ObjectDataSource but set its DataSource programmatically with a DataSet. I have turned on both sorting and paging and have experienced a problem. When I page through the results, everything is fine. However, if I click on a column to sort the data and then click on a page number, I receive the following error:

index 10 is either above negative or above rows count radcontrol

"10" is the page size of my RadGrid.

I have used paging and sorting together in a regular GridView where an ObjectDataSource was not used, and I had to add custom coding to handle the sorting and paging events. Is there anything special I have to do when using sorting and paging with the RadGrid and a programmatic datasource? If so, do you have any example code. I couldn't find anything in the documentation about this.

Because I am using a programmatic data source, I have to reload the data each time a grid page is changed or sort is called. But I am not doing anything more than that at this time. Do I need to reset the CurrentPageIndex or other properties so that the sorting doesn't conflict with the paging? Also, the sorting and paging are not being done by a postback but through Ajax. Is there something on the client side that might explain this problem? (By the way, how can I turn off Ajax and just have the sorting and paging occur through postbacks? I can't seem to find the EnableAjax property in the RadGrid control.)

Any help would be greatly appreciated.

Here is a snippet of the code:

 

<telerik:RadGrid runat="server" ID="grdSchool" AllowPaging="True" AutoGenerateColumns="False"

 

 

GridLines="None" Skin="aspire" EnableEmbeddedSkins="false" PageSize="10" Width="100%"

 

 

OnItemDataBound="grdSchool_ItemDataBound" OnItemCommand="grdSchool_ItemCommand"

 

 

AllowSorting="True" OnSortCommand="grdSchool_OnSort" OnDeleteCommand="grdSchool_DeleteCommand"

 

 

OnPageIndexChanged="grdSchool_PageChanged" PagerStyle-Mode=NextPrevAndNumeric>

 

 

<MasterTableView>

 

etc.

The grdSchool_OnSort and grdSchool_PageChanged methods simply get the data from the session, set the DataSource, and then rebind.



Sebastian
Telerik team
 answered on 08 Apr 2009
1 answer
62 views
Hello,

A co-worker had an issue with the menu designer control; the designer feature that builds the menu sorted the list of menu items out of order, and some of the items didn't get rendered in the markup.  Is this an issue that's been fixed in a subsequent release?

Thanks.
Atanas Korchev
Telerik team
 answered on 08 Apr 2009
1 answer
129 views
Hi,
  I am using the RadGrid with pop-up edit mode.  When I click cancel, the default behavior is for the grid to perform a rebind.  However, is there a way to avoid this rebind and simply close the pop-up window.

Thank you.
Nikolay Rusev
Telerik team
 answered on 08 Apr 2009
3 answers
159 views
Hi, I keep having to write bits of javascript that use the following:
 
document.getElementById("<%=somecontrolfield.ClientID%>");

Now, this should be ok, BUT it appears that master pages do not like it at all. I get a runtime error saying "could not find somefield" if I try to use the above in content pages.

In the meantime I have reverted to doing this:

 document.getElementById("ct100_ContentPlaceHolder1_somedetailsview_somecontrolfield");

Now this works, but it could obviously get broken if the masterpage changes and I would rather use the first code. Is this possible with content/master pages? I can't find an answer and seem to be needing one quite a lot for radajax things like radwindow etc.

Thanks,
Matt
Iana Tsolova
Telerik team
 answered on 08 Apr 2009
0 answers
79 views
hi,

In a user control i'm defined a cancel button using "owner.Localization" in client side for  Advanced Edit Template. while clicking Cancel button in the edit template, the user control is postbacks only, how can i Cancel the Edit template
Balaji
Top achievements
Rank 1
 asked on 08 Apr 2009
6 answers
146 views
Hello,

I would like to adjust as much as possible cells height. How can I do this?

Thank you.
Patxi
Top achievements
Rank 1
 answered on 08 Apr 2009
3 answers
99 views
Hi all,

        I need to have a google like filtering to only one column in my project. I have gone through the things provided in page http://www.telerik.com/support/kb/aspnet-ajax/grid/google-suggest-style-filtering-in-radgrid.aspx. Here the example shows RadGrid binding at server side(code behind). As i am binding RadGrid using GridBoundColumns client side binding. Can you please suggest me how to use this custom Google like filtering at client side to only one column which will be helpful to me.


Thanks,
Nagarjun S.
nagarjun
Top achievements
Rank 1
 answered on 08 Apr 2009
1 answer
85 views
Is there a way for the Rad Grid Column Header to display on top of the rows and show the data rows below it and keep the form to the bottom of the page.

IE:

Currently this is how it behaves:

Column 1 Column 2 Column 3
ABC         ABC         ABC           Edit
123          123          123            Edit

If I click on Edit on the 1st Row then the detail Records are displayed as:

Column 1 Column 2 Column 3
text = ABC
text = ABC
text = ABC

123          123          123            Edit

We are requesting the control to keep the header rows and the columns together like so:

text = ABC
text = ABC
text = ABC

Column 1 Column 2 Column 3
123          123          123            Edit

Shinu
Top achievements
Rank 2
 answered on 08 Apr 2009
0 answers
97 views
Hi

Is is possible to have the text of a node wrap? effeectivly making it a multiline text value

Andy

Dont worry guys, I've found this http://www.telerik.com/help/aspnet-ajax/tree_tree_wrap_nodes.html

A
Andy Green
Top achievements
Rank 2
 asked on 08 Apr 2009
8 answers
510 views
Tried to resize grid when browser resizes but no change in height. Doing the following:
javascript:
window.onresize = ResizePage;

function ResizePage()
{
    ResizeGrid();
}

function ResizeGrid()
{   
    var gridClient = $find("<%= grdVouchers.ClientID %>");

    if (gridClient != null)
    {
        var gridHeight = document.documentElement.clientHeight - 96;
        var scrollArea = gridClient.GridDataDiv;
        var heightBefore = scrollArea.style.height;

        if (gridHeight > 122)
            scrollArea.style.height = gridHeight + "px";
        else
            scrollArea.style.height = "122px";
        var heightAfter = scrollArea.style.height;
        alert("resize:" + heightBefore + ":" + heightAfter);
    }
}
...
aspx tags:
...
<telerik:RadGrid ID="grdVouchers"
    runat="server"
    Skin="Office2007"
    OnNeedDataSource="grdVouchers_NeedDataSource"
    OnDetailTableDataBind="grdVouchers_DetailTableDataBind"
    OnItemCommand="grdVouchers_ItemCommand"
    AllowFilteringByColumn="True"
    AllowPaging="True"
    AllowCustomPaging="true"
    GridLines="None"
    PageSize="12"
    AutoGenerateColumns="False"
    Width="100%"
    Height="480px"
    CellPadding="0">
    <ClientSettings
            AllowColumnsReorder="True"
            ColumnsReorderMethod="Reorder">
        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        <Selecting AllowRowSelect="True" />
        <ClientEvents
            OnColumnContextMenu="ColumnContextMenu"
            OnGridCreated="GridCreated"
            OnRowDblClick="RowDblClick"
            OnRowContextMenu="RowContextMenu"
            OnColumnResized="ColumnResized"
            OnColumnSwapping="ColumnSwapping" />
        <Resizing AllowColumnResize="True"
            EnableRealTimeResize="False"/>
        <ClientMessages DragToGroupOrReorder="Drag column to reorder" />
    </ClientSettings>
...
senthil
Top achievements
Rank 1
 answered on 08 Apr 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?