Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
148 views
Hello,

I am trying to evaluate the client-side databinding using WCF and am having a hard time getting the desired results.  It appears that I have everything working correctly, and in Firebug I can see that the data is being returned from my WCF method, but it's not showing up in the grid.  Also, it is returning the correct number of rows(it is showing the correct paging information and total row count) but is ignoring the pagesize property.  Here are some snippets:

<telerik:RadGrid  
            ID="rgTasks"  
            runat="server" 
            AllowPaging="true"  
            ShowHeader="true" 
            ShowStatusBar="true" 
            AutoGenerateColumns="false" 
            Skin="Vista" 
            PageSize="15" 
            AllowSorting="true"
            <MasterTableView  
            DataKeyNames="taskid"  
            AlternatingItemStyle-BackColor="AliceBlue" 
            CommandItemDisplay="Top" 
            NoMasterRecordsText="No tasks found." 
            ClientDataKeyNames="taskid"
                <CommandItemSettings 
                ShowExportToWordButton="true" 
                ShowExportToExcelButton="true" 
                ShowExportToCsvButton="true" 
                ShowExportToPdfButton="true"/> 
                <Columns> 
                    <telerik:GridBoundColumn  
                    DataField="taskid"  
                    HeaderText="Task ID" 
                    DataType="System.Int32"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn  
                    DataField="title"  
                    HeaderText="Title" 
                    DataType="System.String"
                    </telerik:GridBoundColumn> 
                    <%--<telerik:GridTemplateColumn  
                    DataField="description"  
                    SortExpression="description" 
                    HeaderText="Description"
                        <ItemTemplate> 
                            <dp:Label 
                            runat="server" 
                            ID="lblDescription" 
                            Text='<%# FormatTextForGridDisplay(Eval("description").ToString()) %>' 
                            ToolTip='<%# Eval("description") %>'
                            </dp:Label> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn>--%> 
                    <telerik:GridBoundColumn  
                    DataField="assignedto"  
                    HeaderText="Assigned To" 
                    DataType="System.String"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn  
                    DataField="status"  
                    HeaderText="Status" 
                    DataType="System.String"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn  
                    DataField="priority"  
                    HeaderText="Priority" 
                    DataType="System.String"
                    </telerik:GridBoundColumn> 
                    <%--<telerik:GridTemplateColumn  
                    DataField="account"  
                    SortExpression="Account" 
                    HeaderText="account"
                        <ItemTemplate> 
                            <dp:Label 
                            runat="server" 
                            ID="lblAccount" 
                            Text='<%# Eval("description") %>'
                            </dp:Label> 
                        </ItemTemplate> 
                    </telerik:GridTemplateColumn>--%> 
                    <telerik:GridBoundColumn  
                    DataField="startdate"  
                    HeaderText="Start Date" 
                    DataType="System.String"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn  
                    DataField="duedate"  
                    HeaderText="Due Date" 
                    DataType="System.String"
                    </telerik:GridBoundColumn> 
                </Columns> 
                <PagerStyle Mode="NextPrevAndNumeric" /> 
            </MasterTableView> 
            <ClientSettings> 
                <DataBinding  
                SelectMethod="GetTasksForList"  
                SelectCountMethod="GetTasksForListCount" 
                Location="~/Services/Service.svc" 
                StartRowIndexParameterName="startIndex" 
                MaximumRowsParameterName="maxRowCount"
                </DataBinding> 
            </ClientSettings> 
            </telerik:RadGrid> 

Here is the service:
[OperationContract] 
    public TList<Tasks> GetTasksForList(int startIndex, int maxRowCount) 
    { 
        TasksService ts = new TasksService(); 
        TList<Tasks> tlist = ts.GetAll(); 
        return tlist; 
    } 
 
    [OperationContract] 
    public int GetTasksForListCount() 
    { 
        TasksService ts = new TasksService(); 
        return ts.GetAll().Count; 
    } 

Here is my web.config

<system.serviceModel> 
        <behaviors> 
            <endpointBehaviors> 
                <behavior name="ServiceAspNetAjaxBehavior"
                    <enableWebScript/> 
                </behavior> 
            </endpointBehaviors> 
            <serviceBehaviors> 
                <behavior name="metadataAndDebug"
                    <serviceMetadata httpGetEnabled="true" httpGetUrl="" /> 
                    <serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" /> 
                </behavior> 
            </serviceBehaviors> 
        </behaviors> 
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> 
        <services> 
            <service name="Service"
                <endpoint address="" behaviorConfiguration="ServiceAspNetAjaxBehavior" binding="webHttpBinding" contract="Service"/> 
                <endpoint address="mex" binding="mexHttpBinding" contract="Service"   /> 
            </service> 
        </services> 
    </system.serviceModel> 



Thanks!!



Vlad
Telerik team
 answered on 16 Nov 2009
1 answer
105 views
Am I right that filters set on a client-side databound radgrid are not preserved during a postback?

Currently I have my own buttons to set a filter on the grid. When I press one of the buttons, this client-side function is called:
function actionFilter(obj, value) 
    var tableview = grid.get_masterTableView(); 
    tableview.filter('Action', value, 'EqualTo'); 
     

I have one column which causes a postback. After the postback, the filter is gone and all records are shown. So if I want to preserve the filter, I have to save it programmatically?
Princy
Top achievements
Rank 2
 answered on 16 Nov 2009
2 answers
150 views
Hello,
I have a NextPrevAndNumeric pager in a grid and I wanted to localize the text for the label that says "Page size:", but I cannot seem to find out how to do this.

Is it in PagerStyle?  Somewhere else?  Does this have to be done using a FindControl of the label on the ItemCreated event (I am already creating the grid programatically on Page_Init).

dqAnswer.PagerStyle.PrevPageToolTip 
dqAnswer.PagerStyle.NextPageToolTip 
dqAnswer.PagerStyle.PagerTextFormat 


Princy
Top achievements
Rank 2
 answered on 16 Nov 2009
1 answer
91 views
Hi,

I have grid with tabstrip. tabstrip is inside NestedViewTemplate. When i expand one of row i want close previous expanded row.
How can i do this. Is there any gridproperty set it

lakmal
Princy
Top achievements
Rank 2
 answered on 16 Nov 2009
1 answer
83 views
Hello,

A site I am working on has people to copying and pasting articles into the Editor.  I'm trying to make it so people can simply paste a whole article from Word or the like and each paragraph in Word will be wrapped with paragraph tags in the HTML.  I essentially have it set up how I want it (with NewLineBR="false" and stripping some other stuff out), except the last paragraph doesn't get wrapped in the paragraph tags.  The person can hit Enter every time after the last paragraph (which does wrap it in the paragraph tags), but I can't expect everyone to do that.

This also happens when they aren't pasting the content in.  If they type out (rather than paste) a summary, for example, the last paragraph is not wrapped in paragraph tags.  Again, if the person hits Enter then it wraps it with the paragraph tags.

Basically, here's what people currently have to do:
  • Paste the article in from Word
  • Hit Enter to correctly wrap the last paragraph in paragraph tags
  • Submit

I'm looking to trim out the part where people have hit enter after pasting in their article.  Here's how I have one of the Editors set up:

<telerik:RadEditor StripFormattingOptions="MSWordRemoveAll, css, span" OnClientPasteHtml="StripCharacters" OnClientLoad="DeveloperDescriptionCounter" SkinID="DeveloperDescription" runat="server" ID="editor" AllowScripts="false" NewLineBr="false" ToolsFile="~/App_Data/Editor/EditorToolbar.xml" CssClass="description"
    <Content></Content
</telerik:RadEditor> 

I'm not sure if that helps at all, but I figured it wouldn't hurt to include it.  I should probably re-mention that every paragraph, except for the last one, works fine.

Thanks,
Nathan
Nathan
Top achievements
Rank 1
 answered on 16 Nov 2009
1 answer
101 views
Is there any way to have the markup for Telerik controls like the RADGrid not be reformatted by Visual Studio? It seems to be removing whitespace to conserve space but this is really annoying when trying to view and edit the aspx.

Bob
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 16 Nov 2009
1 answer
95 views
Hello,

Is there some documentation on the new buttons and the events associated with them?  Any tutorials on how to get exporting working from the ground up with the new buttons?  That would be very helpful right now.  I'm looking at videos created last year on grid exporting and I don't want to add this feature to the project until I know what I'm doing and if this old video still matches up with the newer releases.

Thanks for any help,
Heath
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 16 Nov 2009
0 answers
87 views
I have tried to get flash embeded in a master page and working but can't. When embeded in a plain aspx page the thing works flawlessly using <object> </object> tag. Any help to resolve this is welcomed.
bigrich legend
Top achievements
Rank 1
 asked on 16 Nov 2009
2 answers
133 views
  I have a page that supports dragging and dropping rows between two RadGrids.  Initially, this worked as expected, but I've now added a GridTemplateColumn to the tables, and now when I try to drag, it just selects the text within the column.  If I grab the row at the far left edge, it still selects the row and drags normally.

  Is there a way in this case to make the template column work the same way as other columns?

Thanks,
  Andrew
Andrew
Top achievements
Rank 1
 answered on 16 Nov 2009
0 answers
75 views
Hello,

I came in difficulties including mediaplayer in FireFox, I need to be able to click on start/stop buttons so I included javascript for this:

            <object id="Player" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"   
            standby="Loading Microsoft Windows Media Player components...">  
                <param name="URL" value=""/>  
                <param name="rate" value="1"/>  
                <param name="balance" value="0"/>  
                <param name="currentPosition" value="0"/>  
                <param name="defaultFrame" value=""/>  
                <param name="playCount" value="1"/>  
                <param name="autoStart" value="-1"/>  
                <param name="currentMarker" value="0"/>  
                <param name="invokeURLs" value="-1"/>  
                <param name="baseURL" value=""/>  
                <param name="volume" value="50"/>  
                <param name="mute" value="0"/>  
                <param name="uiMode" value="full"/>  
                <param name="stretchToFit" value="1"/>  
                <param name="windowlessVideo" value="0"/>  
                <param name="enabled" value="-1"/>  
                <param name="enableContextMenu" value="-1"/>  
                <param name="fullScreen" value="0"/>  
                <param name="SAMIStyle" value=""/>  
                <param name="SAMILang" value=""/>  
                <param name="SAMIFilename" value=""/>  
                <param name="captioningID" value=""/>  
                <param name="enableErrorDialogs" value="0"/>  
                <param name="_cx" value="11377"/>  
                <param name="_cy" value="11377"/>  
            </object> 
            <br /> 
            <br /> 
            <input onclick="PauseMe()" type="button" value="Pause" id="btnPause" />   
            <input onclick="StopMe()" type="button" value="Stop" id="btnStop" /> 
            <input onclick="FullScreen()" type="button" value="Full screen" id="FSBUTTON" /> 
            <br /> 
            <br /> 
            <div id="divState">Playstate:  
            </div> 
            <br /> 
            <br /> 
            <div id="divStatus">Status:  
            </div> 
            <br /> 
            <asp:Label id="Label2" Text="FULLSCREEN" runat="server" /><br /> 
    </div> 
</div> 
<telerik:RadCodeBlock id="CodeBlock1" runat="server">  
<script type="text/javascript">  
var g_bPaused = false; // To track pause button state;  
 
// Initialized states.  
function InitMDP()  
{  
    try  
    {  
        document.getElementById("btnPause").disabled = true;  
        document.getElementById("btnStop").disabled = true;  
        if (document.getElementById("Player").object.enabled )  
        {  
        document.getElementById("Player").uiMode = "none";  
        }  
        }  
    catch(ex) {  
        alert(ex);  
        if ( document.getElementById("Panel1") )  
            document.getElementById("Panel1").display=true;  
    }  
}  
 

I get an exception in InitMDP "Player" 'has not this property' (but it works in IE), even trying to delay its execution in codebehind using

        protected override void OnPreRender(EventArgs e)  
        {  
            string scriptString             = "InitMDP();";  
            if ( HasAjaxManager )  
            {  
                // We must execute this on end of page loading by browser  
                AjaxManager.ResponseScripts.Add(scriptString);  
            }  
            base.OnPreRender(e);  
        }  
 

I don't understand, am I stopped by some FF feature ?


Thanks for idea.

CS





CSurieux
Top achievements
Rank 2
 asked on 15 Nov 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?