Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
346 views
Hi,
I have a Radgrid which i bound with a data table. The data is shown properly in the grid. Now when i click on Page values of grid, everything works fine. Now if I sort the column the Grid shows No Records for display. If I sort the Grid First, sorting happens but after Page click, the Grid again shows No Records for display.

So each action works fine individually but not if one action is done after another i.e. Paging-->Sorting or Sorting-->Paging, Grid shows No Record for display.
In Code behind, the Grid Datasource always shows Data.

Need help on urgent basis.

regards,

PN

Code:
ASPX PAGE:  
---------------  
 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
                <AjaxSettings> 
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                        <UpdatedControls> 
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                        </UpdatedControls> 
                    </telerik:AjaxSetting> 
                </AjaxSettings> 
            </telerik:RadAjaxManager> 
            <telerik:RadGrid ID="RadGrid1" Skin="Office2007" Width="97%" AllowSorting="True" 
             PageSize="15" ShowFooter="True" AllowPaging="True" AllowMultiRowSelection="True" runat="server" Gridlines="None"   
             OnNeedDataSource="RadGrid1_NeedDataSource">  
              <MasterTableView Width="100%" /> 
              <PagerStyle Mode="NextPrevAndNumeric" /> 
            </telerik:RadGrid> 
--------------------------------------------------------------------------  
 
Code Behind:  
--------------  
  protected void Page_Load(object sender, EventArgs e)  
        {  
 
        }  
        protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
        {  
            DataTable dt=null;  
            dt=GetDataTable();  
            if(dt!=null)  
            RadGrid1.DataSource = dt;  
 
        }  
        private DataTable GetDataTable()  
        {  
            DataTable dt = null;  
            DataSet dsResults = Utility.SearchCategoryCards("Digital", Session["UserCompanyCode"].ToString());  
            if (dsResults != null && dsResults.Tables.Count > 0 && dsResults.Tables[0].Rows.Count > 0)  
            {  
                dt = dsResults.Tables[0]; ;  
                return dt;  
            }  
            else  
            {  
                return dt;  
            }  
        } 
Angie
Top achievements
Rank 1
 answered on 31 Jul 2008
1 answer
132 views
When a user clicks a button on my web page I want to create an instance of a Web User Control in my code behind, set the data source for a Rad Grid that is in the Web User Control, and then add the Web User Control to the controls collection on my page.  When I try to set the datasource for the grid, I get a NullReferenceException.  From what I can tell the grid is null.  The scenario works when the user control already exists on the web page, but not when I create the web user control in code.

I have a sample project if that will help.
Paul Bishop
Top achievements
Rank 1
 answered on 31 Jul 2008
10 answers
548 views

Hi,

I am using pager Mode="NextPrevNumericAndAdvanced" with PageSize

="10".

issue is:
enter 10 in change page size textbox and click on Change, OK data is visible
Click on Change again without doing anything else.

result: grid is empty.

What is noticed:
PageSizeChanged event does not fire on 2nd attempt.

Note: This behavior observed only for value 10.

Regards,
Vaibhav

 

Vladimir
Top achievements
Rank 1
 answered on 31 Jul 2008
7 answers
190 views
I have a RADGRID set up to display data from a SQLDataSource that calls a stored procedure.   During the coarse of work... the user may want to update data and have it reflected in the grid.  I have my update/refrsh button do a RADGRID1.reBind() but it doesnt seem to make the call to the stored procedure to get the new set of data.

Is there a thread already out there about this that someone could link me to? or perhaps throw some options my way. 

The grid is on a webform that is AJAX enabled.  works fine displaying the resulting data from the stored proc.  Just doesnt refresh with new data when forced to rebind.

thanks
Vladimir
Top achievements
Rank 1
 answered on 31 Jul 2008
1 answer
126 views
I've tried to follow all of th eonline examples, but one thing consistently fails: I cannot access any RadControls via the given Javascript.

I have a grid that I want to update from an open RadWindow. I am using the following example: 
http://www.telerik.com/DEMOS/ASPNET/Controls/Examples/Integration/GridAndWindow/DefaultCS.aspx?product=window

Here is my javascript:

function ShowForm(site, form, rowIndex) {

if (form == 'refViewer') {

var grid = window["<%= radData.ClientID %>"];
alert(grid);
alert(grid.MasterTableView);

// var rowControl = grid.MasterTableView.Rows[rowIndex].Control;
// grid.MasterTableView.SelectRow(rowControl, true);

}

window.radopen(site, form);

return false;
}

I find the grid no problem. But it fails on the grid.MasterTableView. I have yet, in any online example, been able to get the given Javascript to function. I have had to modify it myself to get it to work. In this case, I can manually find the mastertable by $get('radData_ctl00') but then it fails on the SelectRow method.

Is there some reference I am missing? I have the Q2 version of the controls, so I had hoped my problems from Q1 would go away.

Thanks!

Sean

Sean
Top achievements
Rank 2
 answered on 31 Jul 2008
2 answers
403 views

Here is my aspx:

                    <telerik:RadComboBox ID="RadComboBox1" Runat="server" 
                        DataSourceID="SqlDataSource1" DataTextField="addr_line_1"   
                        DataValueField="address_id" Skin="Sunset" Width="250px"   
                        OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged" AutoPostBack="True">  
                        <CollapseAnimation Duration="200" Type="OutQuint" /> 
                    </telerik:RadComboBox> 

And here is my code behind(c#):

    protected void RadComboBox1_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)  
    {  
        if (RadComboBox1.SelectedItem != null)  
            lblAddrLine1.Visible = true;  
        lblAddrLine1.Text = String.Format("Address Line 1: '{0}'", RadComboBox1.SelectedItem.Text);  
 
    } 

   
I get this error in IE7:

Line:  605
Char:  13
Error:  Sys.WebForms.PageRequestManagerServerErrorException:  An unknown error occurred while processing the request on the server.  The status code returned from the server was:  500
Code: 0
URL:  this is the url of my site

Any ideas what could be causing this?

Thanks,
Greg

Chris
Top achievements
Rank 1
 answered on 31 Jul 2008
2 answers
99 views
Hi.  I am successfully setting the header text for a column in the code behind, like so:

protected void RadGrid_Subs_ItemDataBound(object sender, GridItemEventArgs e)  
        {  
            if (e.Item is GridHeaderItem)  
            {  
                GridHeaderItem header = (GridHeaderItem)e.Item;  
                header["linklabel"].Text = headerText;  
                  
            }  
        }   

The column code is this (the sortexpression is static):
<telerik:GridTemplateColumn SortExpression="linklabel" UniqueName="linklabel" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" > 
                    <ItemTemplate> 
                        <%# BuildLink(DataBinder.Eval(Container.DataItem, "linkID"), DataBinder.Eval(Container.DataItem, "linkLabel"), DataBinder.Eval(Container.DataItem, "forumID"), DataBinder.Eval(Container.DataItem, "isCase"))%> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 

The column header is not sortable.  If I hardcode the headertext, the sorting works fine.  Am I missing a step?

Thanks.
Angie
Top achievements
Rank 1
 answered on 31 Jul 2008
2 answers
348 views
Hi,
My users are changing the grid client-side (sort, filter, column order, etc).
What i would like to do is be able to save the grid layout, so when the page is reloaded, i can load these settings, so the grid looks the same as when the user left it. Is this possible ?
To xml or database ???

Thanks in advance
Mark
Mike
Top achievements
Rank 1
 answered on 31 Jul 2008
1 answer
121 views
I'm sucessfully using RadGrid and other Rad products in WSS 3.0 but can't get the scheduler to work.

Here's my test code trying to use a List as the datasource:

            <telerik:RadScheduler runat="server" ID="RadScheduler1" 
            Width="750px" Skin="Inox" 
            SelectedDate="2007-03-30" DayStartTime="08:00:00" DayEndTime="18:00:00"                    
            DataSourceID="spdsCalendar" DataKeyField="ID" DataSubjectField="Title" 
            DataStartField="MovementFromDate" DataEndField="MovementToDate" 
            SelectedView="WeekView">  
        </telerik:RadScheduler> 
        <sharepoint:SPDataSource DataSourceMode="List" 
            Scope="Default"   
            IncludeHidden="true"   
            ID="spdsCalendar" runat="server">  
            <SelectParameters> 
                <asp:Parameter Name="WebUrl" DefaultValue="/webname/" /> 
                <asp:Parameter Name="ListName" DefaultValue="mylist" /> 
            </SelectParameters> 
        </sharepoint:SPDataSource> 

This is in a custom user control within a web part. The user control runs fine without Scheduler, but when I put this code in a get a 'File not Found'.

I noticed there were some Telerik references in web.config SafeControls so I added the following:

<SafeControl Assembly="Telerik.Web.UI, Version=2008.1.619.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI.Scheduler" TypeName="*" Safe="True" />

This didn't make any difference as I still get the error. Would the reference to the Skin be causing this? I presume the skin details are somehow built into the main Telerik dll.

cheers,

Steve
Steve
Top achievements
Rank 1
 answered on 31 Jul 2008
5 answers
221 views
Hello,

I have a tooltip that gets invoked on RadGrid mouse over.  However, It is running twice on mouseover.  How can I stop this?  The radgrid is not in an UPDATE PANEL.

tx.
AV
Sophy
Telerik team
 answered on 31 Jul 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?