Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
230 views
Hi,

I am having a very strange problem and I'm not sure what is causing it.

I have built a WSS 3.0 web part that implements a Rad Scheduler (2009.1.527.35). I have implemented custom Object Data Sources exactly as described here: http://www.telerik.com/help/aspnet-ajax/schedule_databindingusingthedatasourceproperty.html

When I deploy the web part, the browser displays a 403 error. To get around this error I can do the following:

1. Open web.config
2. Change something - it can be anything, even just deleting a random character
3. Save the file
4. Site will error out - if I've deleted something important in the web.config
5. Undo changes to web.config - resave
6. Site will come back up and the web part will display

At this point everything will work fine with the scheduler control. All methods in the object data sources will work properly.

If at any time there is an IISRESET run on the server or if I recycle the app pool for this site, the page will go back to the 403 error.

I have narrowed it down to when the object data source is being bound to the scheduler control in my CreateChildControls() method that is causing the issue. I tried moving that code out of the CreateChildControls() and moving it to the RenderWebPart(), but I get a different error, "DataKeyField, DataSubjectField, DataStartField and DataEndField are required for databinding". Which makes sense.

I have also tried to add the object data sources in both OnInit() and CreateChildControls() and the 403 error appears the same for both variations.

From what I can gather, it seems the scheduler control is trying to databind during the CreateChildControls() method and somehow it doesn't have permission to access the object data sources. To ensure it wasn't any custom code in my object data sources, I created a test Select method with no code and bound to that. I had the same problem. Now I also know the 403 is getting thrown before any of my object data source code is actually hit.

I'm not sure if it matters that I am adding the object data sources dynamically to the page or not? Or whether it matters that I am adding those and the scheduler to the page at the same time?

I'm also not sure if I need to add something to my object data source classes to make them accessable from the web part. I tried the AllowPartiallyTrustedCallersAttribute without success.

Here's the setup of my solution:
1. All files are under 1 project - so when I build, I get 1 assembly
2. All classes are using the same namespace (custom)
3. 1 class file that handles the web part code - inherits from Microsoft.SharePoint.WebPartPages.WebPart
4. 1 class file that handles all my custom toolpane options - inherits from Microsoft.SharePoint.WebPartPages.ToolPart
5. All other class files have no inheritance

Another thought I have is that because my custom data source classes have no inheritence to anything in SharePoint, when they are first loaded SharePoint doesn't know they exist under the context? But I did put the proper SafeControl entry in the web.config for the entire namespace (which includes my custom classes). So that one seems unlikely.

I have also followed all the online documentation on adding the telerik customizations to the web.config. I have set my SP trust level to "Full" and I even tried creating a custom CAS file, specifying my DLL. Neither of those solve my problem. My SP site is running under Basic authentication. (I tried integrated, without success)

Has anyone ever tried building a web part using RadScheduler and Object Data Sources? Any ideas or possible solutions to try are appreciated.

Thanks.
Dimitar Milushev
Telerik team
 answered on 24 Jun 2009
12 answers
1.1K+ views
We just upgraded to the ASPNET AJAX Q1 2009 Controls and now our RadComboBoxes are wrapping text not on spaces (like they did before the upgrade), but are wrapping on whatever letter happens to be at the end of the row (as determined by the width set on the RadComboBox). 

For example, the first line is: "Adjust Current Year Excess/Revoked Contribut"
2nd line (wrapped text from above line is) "ions"

Is there a setting we can use that will wrap text on a space instead of in the middle of a word?
Kamachi Ravichandran
Top achievements
Rank 1
 answered on 24 Jun 2009
1 answer
312 views
hi,

I need to be able to extract the SQL FilterExpression from a radgrid on the client-side.  On clicking a button, I have a javascript function which should get the filter expression as an SQL string and then send it to a new window through a URL.

The new window then takes the FilterExpression from the URL and applies it to a new radgrid on the server side. This is for a "print friendly" version of the grid.

My javascription function is called from a client-side button click handler and looks like:

 

function PrintRadGrid() {

 


var
ClientsGrid = $find("<%=ClientsGrid.ClientID %>");

 

 

 

 

 

 

var f = ClientsGrid.get_masterTableView().get_filterExpressions().toString();

 

 

 

var previewWnd = window.open('print/Clients.aspx?Filter=' + escape(f), '', '', false);

 


previewWnd.print();

 

 

 

 

 

}

Problem is that the filter variable is always blank and I cannot get the SQL expression I need.

Any ideas?

Thanks!

Veli
Telerik team
 answered on 24 Jun 2009
2 answers
81 views
Hi

I am using radtabstrib and adding tabs and page views dynamically, page views itself has user controls inside, so I am recreating all this on each postback, however everything works perfect until I put radgrid inside the user control (it works ok with regular GridView) the error is the following.
The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.

The exception throws as soon as I try to add user control with rad grid inside, into the page view
private void RecreateTabsPageViews() 
    { 
        if (Session["TabPageViewsContents"] == nullreturn
        List<Control> PageViewsList = (List<Control>)Session["TabPageViewsContents"]; 
        int index = 0; 
        foreach (Control c in PageViewsList) 
        { 
            CenterTabStribMultiPage.PageViews[index].Controls.Add(c); 
            index++; 
        } 
    } 

Please advice.
Thanks
Sebastian
Telerik team
 answered on 24 Jun 2009
1 answer
152 views
Hi,

I followed the listview demo:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/listview/defaultcs.aspx

to produce a listview display of thumbnail images via asp.net Image control:

                        <telerik:RadGrid ID="RadGrid1" DataSourceID="EntityDataSource1" AllowFilteringByColumn="false" 
                            runat="server" GridLines="None" AllowPaging="true" AllowSorting="false" OnPreRender="RadGrid1_PreRender" 
                            PageSize="6">  
                            <PagerStyle Mode="NextPrevAndNumeric" />  
                            <MasterTableView TableLayout="Auto" ShowHeader="false">  
                                <ItemTemplate>  
                                    <%# (((GridItem)Container).ItemIndex != 0)? "</td></tr></table>" : "" %>  
                                    <asp:Panel ID="ItemContainer" CssClass='<%# (((GridItem)Container).ItemType == GridItemType.Item)? "item" : "alternatingItem" %>' runat="server">  
                                        <asp:Image ID="Image1" runat="server" ImageUrl=<%# Eval("Path")%> Height="40" Width="40" ImageAlign="Middle" />  
                                    </asp:Panel>  
                                </ItemTemplate>  
                            </MasterTableView>  
                            <GroupingSettings CaseSensitive="false" />  
                            <ClientSettings AllowColumnsReorder="true" AllowDragToGroup="true" ReorderColumnsOnClient="true" AllowRowsDragDrop="true">  
                                <Selecting AllowRowSelect="true" />  
                                <Scrolling AllowScroll="true" UseStaticHeaders="true" />  
                            </ClientSettings>  
                        </telerik:RadGrid> 

It worked as expected, however, when I place lines number 14-17 to produce the drag and drop effect, the drag and drop functionality works per row, which as per demo, all data items, (in my case asp.net image controls) are just one row, thus, when dragging, I'm dragging every thumbnail displayed in one go - which is not the desired effect.

Hope you can explain how can I achieve drag&drop per data item (w/c in this case is the Image Control binded by Eval("Path") ), in a ListView Style (w/c displays items horizontally).

Many Thanks,
Henry Wu
Veli
Telerik team
 answered on 24 Jun 2009
1 answer
123 views
Hey Telerik guys !!

Hope everyone is fine there !

Guys  !

Iam again in a problem , an Iam quite sure you guys will help me.

Guys, Im facing an issue with RAD GRID when it works on to CLIENT SIDE EVENTS. Below is the problem which Im having :-

I have a 10 check box controls & an RAD GRID(GRAY SKIN) with 13 cloumns , out of which 10 columns of the RAD GRID are to be shown & are to be hidden according to the check & uncheck event of the CHECK BOX CONTROLS. ( 3 COLUMNS of the RAD GRID are always to be shown.)
I have implemented the RESIZING & DRAGING on to the RAD GRID
My problem is that : Whenever I check & uncheck the CHECK BOX control it correctly display the CHECKED CHECK BOX as an COLUMN of the GRID , but when we SWAP that particular COLUMN with the other COLUMN & then UNCHECK the CHECK BOX to hide that CHECKED COLUMN , it losses it s INDEX as it HIDE the SWAPPED COLUMN & which is creating an problem.

i.e. RAD GRID columns does not maintain their INDEXES on SWAPPPING/DRAGING.

 I dont want it to be happen. I have used the JAVASCRIPT to show/hide the columns of the RAD GRID on the checked & the unchecked event of the CHECK BOXES.

Its not working for me .

If you guys want me to send the screen shot , I will send it to you.

Please help .

Thanks

Ajay
Sebastian
Telerik team
 answered on 24 Jun 2009
1 answer
156 views
I am trying to rebind (refresh) a scheduler when a RadWindow gets closed, the same way I do a RadGrid but it isn't working for the scheduler.  What am I doing wrong?

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
            <script type="text/javascript"
                function ShowApp(record) { 
                    window.radopen("AppWindow.aspx?record=" + record, "UserListDialog"); 
                    return false; 
                } 
 
                function closeAppWindow() { 
                    $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(); 
                }  
                 
            </script> 
        </telerik:RadCodeBlock>  
 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
    <Windows> 
                    <telerik:RadWindow Skin="Sunset"  ID="UserListDialog" runat="server" Title="Dealership Application" Height="850px" 
                        Width="850px" Left="10px" ReloadOnShow="true" Modal="true"  ShowContentDuringLoad="False" OnClientClose="closeAppWindow"/> 
                </Windows> 
    </telerik:RadWindowManager> 
                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
                </telerik:RadAjaxManager> 

Code Behind:
Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As ObjectByVal e As AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest 
        scheduler_Events.Rebind() 
    End Sub 

Peter
Telerik team
 answered on 24 Jun 2009
1 answer
89 views
Hi folks !

Hope you all are doing great !!

Hey Telerik Guys ,

I need you guys to help me sort out my problem. I have a project to deliever by the end of this month & Iam really frustated with whats your RAD GRID is behaving.

Guys , my actual problem is described below :-

I have a RAD GRID with GRAY SKIN which is bind to the Object Data Source. I have enabled the following properties of the grid :-

1. MOVABLE(DRAGABLE) COLUMNS
2. RESIZING OF COLUMNS & ROWS

I have fixed the HEIGHT of the GRID to 98% & assigned with to the BOUND column manually.

Now , when I resize the COLUMN HEADERS of the RAD GRID , the whole alignment of the PAGE (PAGE STRUCTURE ) gets disturbed.

(i.e. If we have the DIV SECTION on to the page all the DIV SECTION gets dis-aligned from their position only if we try to RESIZE THE HEADER COLUMN of the GRID.)

Please help me out to solve the problem.

Looking forword to hear at earliest possible.
Thanks

Ajay
Sebastian
Telerik team
 answered on 24 Jun 2009
1 answer
192 views
Hi,

I created a new skin with the visual stil builder for the RadGrid. Everything works fine, except the styling of the filter items is not right.
When I click the filter icon, the items slide open ("equals, starts with, ..."), but there is no styling on it.

I see that in the generated css file, there is no styling for the "rmItem", "rmText", ...
Is it normal that this isn't generated? And if it is normal, how can I solve it then?

Thanks in Advance
Alex Gyoshev
Telerik team
 answered on 24 Jun 2009
1 answer
104 views
Hello,

This is third time, I am posting my problem on the forum and yet now replied.

I have a simple RadComboBox Filter template, but when I select an option from filter, it produces following error.

Sys.WebForms.PageRequestManagerServerErrorException: Selection out of range parameter name: value

I need urgent help please. - Thanks alot

<tlk:GridCalculatedColumn meta:resourcekey="BuildingItemTypeColumn"   
                    UniqueName="BuildingItemType"   
                    DataFields="BuildingItemTypeCode,BuildingItemTypeDescription"   
                    Expression="{0} + &quot; - &quot; + {1}" DataFormatString="<nobr>{0}</nobr>">                      
                            
                        <FilterTemplate> 
                            <tlk:RadComboBox ID="TypeList" Height="100px" AppendDataBoundItems="true"   
                                runat="server" OnClientSelectedIndexChanged="TypeIndexChanged"  SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("BuildingItemType").CurrentFilterValue %>' 
                                >                                  
                                <Items> 
                                    <tlk:RadComboBoxItem Text="All" /> 
                                </Items> 
                            </tlk:RadComboBox> 
                            <tlk:RadScriptBlock ID="RadScript2" runat="server">  
 
                                <script type="text/javascript">  
                                    function TypeIndexChanged(sender, args) {  
                                          
                                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");  
                                        tableView.filter("BuildingItemType", args.get_item().get_value(), "Contains");  
                                   }  
                                </script> 
 
                            </tlk:RadScriptBlock> 
                        </FilterTemplate>                      
                        <HeaderStyle Width="200" /> 
                        <ItemStyle Wrap="false" /> 
                    </tlk:GridCalculatedColumn> 
Sebastian
Telerik team
 answered on 24 Jun 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
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
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?