Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
51 views
Hi,

I have a radgrid that is bound on the client-side using json response.  I run into a situation where my response can return no data (i.e.
{"d":[]} )  in this case I'd like to write something like 'No data records' to the first row/cell.  
How can I do this using the client-side API?






Thx
Pavlina
Telerik team
 answered on 08 Apr 2011
3 answers
122 views
I'm using a RadAjaxManagerProxy along with a ScriptManagerProxy in a page with four RadGrids, the RadScriptManager and RadAjaxManager are in the master page, and our testers keep generating errors like this every few hours or so:

Thread information:
    Thread ID: 14
    Thread account name: NT AUTHORITY\NETWORK SERVICE
    Is impersonating: False
    Stack trace:    at System.String.ToCharArray()
   at System.Text.Encoding.GetBytes(String s)
   at Telerik.Web.UI.ScriptEntry.GetHashCode(String value)
   at Telerik.Web.UI.ScriptEntry.GetResourceNameHashes(String assemblyName)
   at Telerik.Web.UI.ScriptEntry.Deserialize(String serializedScriptEntries)
   at Telerik.Web.UI.RadScriptManager.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
 
Obviously it's hard to capture any specific event which triggers this, I suspect I'm leaking memory somewhere over time - are there any use patterns which might lead to this?

One thing I notice when looking at the code is I have some script references in the head instead of being sent through the script manager, would the Ajax manager keep re-adding them to the page on every request and eventually lead to the out of memory issue?

Rob
 
Simon
Telerik team
 answered on 08 Apr 2011
1 answer
62 views
I have a grid with AllowFilteringByColumn="true", filtering on all columns is enabled and AutoPostBackOnFilter="false" for all columns. What I would like to do is only apply the filter when a user clicks a button either in a custom CommandTemplate or outside the grid (either one will work fine). There are two problems that are stopping me:

1. How do I fire the filtering from code-behind? I know I can do it client-side but...
2. Any column that has the filter icon will fire the filtering on selecting a value.

If I can do #1, then I can disable the grid's filtering client-side and fire the filtering using the button's click event. If I cannot fire the filtering in code-behind, then is there a way of disabling the firing of a postback on choosing one of the filter choices?
Tsvetina
Telerik team
 answered on 08 Apr 2011
1 answer
93 views
I have a grid akin to the following which has as its DataSourceID a LinqDataSource:

<telerik:RadGrid ID="MyGrid" runat="server"
    AllowAutomaticInserts="false"
    AllowFilteringByColumn="true"
    AllowSorting="true"
    PageSize="15"
    ShowFooter="true"
    EnableLinqExpressions="true"
    OnUpdateCommand="MyGrid_UpdateCommand"
    OnItemDataBound="MyGrid_ItemDataBound"
    DataSourceID="MyLinqDataSource"
    >
    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
    <MasterTableView AutoGenerateColumns="false" EditMode="InPlace"
        AllowFilteringByColumn="true"
        DataKeyNames="Id"
        OverrideDataSourceControlSorting="true"
        Width="1700px" TableLayout="Fixed"
        CommandItemDisplay="Top"
        >
        <CommandItemTemplate>
            <asp:Button ID="SearchButton" runat="server" Text="Search" Width="100px" Height="2em"
                CommandName="<%=RadGrid.FilterCommandName %>" />
        </CommandItemTemplate>
        <Columns>
            ...
        </Columns>
    </MasterTableView>
    <ClientSettings AllowColumnsReorder="true" >
        <Resizing AllowColumnResize="true" AllowResizeToFit="true" EnableRealTimeResize="true" />
    </ClientSettings>
</telerik:RadGrid>

All columns have AutoPostBackOnFilter="false" and have a SortExpression. Whenever I click the button in the CommandItemTemplate I get the following error:

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

For those that answer with "use Advanced Binding", how do I replicate all the functionality of the LinqDataSource in code-behind?
Tsvetina
Telerik team
 answered on 08 Apr 2011
2 answers
82 views
Hi,

Any help on this matter would be greatly appreciated, I have been stuck on it for a good while now.

I have a radtoolbar, I have two events handled:

OnClientButtonClicked="RadToolBar_ClientButtonClicked"
OnButtonClick="RadToolBar_ButtonClick" 

Depending on the outcome of the RadToolBar_ClientButtonClicked method (javascript) I would like to/not to handle the OnButtonClick event using the RadToolBar_ButtonClick (c#) - that is, if the client-side method returns false I would like the server-side method to just not execute (I don't even want an alternative method to run, just want it to do nothing).

I have tried the following..

OnClientButtonClicked="return RadToolBar_ClientButtonClicked()"
and
OnClientButtonClicked="return RadToolBar_ClientButtonClicked();"

...but on doing this the page simply does not load (remains blank white).

Thanks a LOT!!!

Dan
Daniel
Top achievements
Rank 1
 answered on 08 Apr 2011
0 answers
61 views

Hello
Im trying to filter the radgrid with filtertemplate. the code look's like this

<telerik:GridTemplateColumn DataField="Obraz" Resizable="false" Visible="false" UniqueName="TemplateColumn"
  AllowFiltering="true">
 <FilterTemplate>
 <telerik:RadComboBox ID="RadComboBoxCountry"  DataTextField="Text"
 DataValueField="Obraz" Height="100px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("TemplateColumn").CurrentFilterValue %>'
 runat="server" OnClientSelectedIndexChanged="CountryIndexChanged">
 <Items>
 <telerik:RadComboBoxItem Text="Bez filtra" value="1"/>
  <telerik:RadComboBoxItem Text="Pojedynczy skan" value="~/Ikony/Gify/Skan.png"/>
  <telerik:RadComboBoxItem Text="Multi skan" value="~/Ikony/Gify/SkanMulti.png"/>
  <telerik:RadComboBoxItem Text="Brak skanu" value="~/Ikony/Gify/BrakSkanu.png"/>
   <telerik:RadComboBoxItem Text="Bez filtra1" value=""/>
    </Items>
   </telerik:RadComboBox>
   <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">
  <script type="text/javascript">
  function CountryIndexChanged(sender, args) {
   var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
    tableView.filter("Obraz", args.get_item().get_value(), "EqualTo");
     }
   </script>
 </telerik:RadScriptBlock>
 </FilterTemplate>
<ItemTemplate>
 <asp:Image ID="Image1" runat="server" ImageUrl="<%# bind('Obraz') %>" ForeColor="White" />
 </ItemTemplate>
 <HeaderStyle Width="199px" />
<ItemStyle Width="199px" />
 </telerik:GridTemplateColumn>

and when I change the item of combox nothig happens the items are not filterd, what can be wrong?
Tomasz
Top achievements
Rank 1
 asked on 08 Apr 2011
1 answer
63 views
Hi,
Is any way to merge two RadWindows into one RadWindow?
On the left: 1. RadWindow and on the right: 2. RadWindow.

Best reagards.
Shinu
Top achievements
Rank 2
 answered on 08 Apr 2011
25 answers
752 views
I see your demo of the new AsyncUpload control claims:

RadAsyncUpload provides client-side event called OnClientValidationFailed. It is fired when the selected file has invalid extension or its size is higher than the MaxFileSize property.

The demo, however, is validating file size on the server. Is there still a problem with client-side filesize validation, or is the demo just not configured to use it?

Thanks,

Craig
Peter Filipov
Telerik team
 answered on 08 Apr 2011
1 answer
65 views
I am using a SharePoint 2007 PublishingPage to display a RadHtmlField as follows:

<

 

telerik:RadHtmlField ID="RadHtmlField1" FieldName="Content" runat="server" ToolsFile="/_wpresources/RadEditorSharePoint/5.8.6.0__1f131a624888eeed/Resources/QAAInternetToolsFile.xml" ConfigFile="/_wpresources/RadEditorSharePoint/5.8.6.0__1f131a624888eeed/Resources/QAAInternetConfigFile.xml"></telerik:RadHtmlField>

 

I wish to use Image Manager to insert images from both the SiteCollection and the current website. Looking at the documentation my ConfigFile.xml should look like this:

<configuration>
 <property name="ToolbarMode">Default</property>
 <property name="ToolsWidth">680px</property>
  <property name="ImagesPaths">
           <item>PublishingImages</item>
           <item>/SiteCollectionImages</item>
  </property>
</configuration>

When I click ImageManager it shows both folder locations defaulting to the current website image folder which is good. When I click on the second folder it displays the site collections images which is also fine. But, if I then click on the first folder again it will not change - it stays fixed on the site collection folder.

This looks like a bug. Is there a way around it?

Stanimir
Telerik team
 answered on 08 Apr 2011
4 answers
150 views

When there is a single column relating two tables defining GridRelationFields is straight forward:

GridRelationFields rf = new GridRelationFields();
rf.MasterKeyField = "col1";
rf.DetailKeyField = "col1";
tvProtocols.ParentTableRelation.Add(rf); 

However, how do you define a GridRelationFields when the keys are compound, such as:

GridRelationFields rf = new GridRelationFields();
rf.MasterKeyField = "col1,col2,col3";
rf.DetailKeyField = "col1,col2,col3";
tvProtocols.ParentTableRelation.Add(rf); 

This is not uncommon.

Must I create an autoincremented column in the parent table and then rely only upon that in the child table?

Mira
Telerik team
 answered on 08 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?