Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
88 views
I bound RadGrdid with objectdatasource control. While I filter the record, I found the total record is not correct. For example:
Before filter record, the total record is 32. After filter and bind grid again, the displayed total record is 10. In fact, the total record should be 17. I debug my code and found the GetTotalRecordCount also return 17 instead 10. The following is my code:

aspx:
<telerik:RadPageView ID="RadPageViewRule" runat="server">
                <div style="padding-left: 25px; padding-top: 30px">
                    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanelRule" runat="server" />
                    <telerik:RadGrid runat="server" ID="RadGridRule" AutoGenerateColumns="False" CellSpacing="0"
                        Width="850px" GridLines="None" DataSourceID="ObjectDataSourceRule" AllowPaging="true"
                        AllowFilteringByColumn="true" ShowStatusBar="false">
                        <ClientSettings EnableRowHoverStyle="true">
                            <Selecting AllowRowSelect="true" />
                        </ClientSettings>
                        <MasterTableView DataKeyNames="RuleId" CommandItemDisplay="Top">
                            <Columns>
                                <telerik:GridTemplateColumn ItemStyle-HorizontalAlign="Center" AllowFiltering="false"
                                    HeaderStyle-Width="20px" HeaderText="Action">
                                    <ItemTemplate>
                                        <asp:ImageButton runat="server" ImageUrl="~/Resource/Images/edit.png" ID="ImageButtonEdit" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="S/N" HeaderStyle-Width="20px" AllowFiltering="false"
                                    ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <%# Container.DataSetIndex+1 %>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn HeaderText="PV Type" HeaderStyle-Width="100px" DataField="RuleType"
                                    UniqueName="RuleType">
                                    <FilterTemplate>
                                        <telerik:RadComboBox runat="server" Width="100px" ID="RadComboBoxRuleTypeFilter"
                                            OnClientSelectedIndexChanged="FieldRuleTypeIndexChanged">
                                        </telerik:RadComboBox>
                                        <telerik:RadScriptBlock ID="RadScriptBlockRuleType" runat="server">
                                            <script type="text/javascript">
                                                function FieldRuleTypeIndexChanged(sender, args) {
                                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                                    tableView.filter("RuleType", args.get_item().get_value(), "EqualTo");
                                                }
                                            </script>
                                        </telerik:RadScriptBlock>
                                    </FilterTemplate>
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn HeaderText="Function Name" DataField="FunctionId" UniqueName="FunctionId"
                                    HeaderStyle-Width="150px">
                                    <FilterTemplate>
                                        <telerik:RadComboBox runat="server" Width="150px" ID="RadComboBoxFunctionFilter"
                                            OnClientSelectedIndexChanged="FieldFunctionNameIndexChanged">
                                        </telerik:RadComboBox>
                                        <telerik:RadScriptBlock ID="RadScriptBlockFunctionName" runat="server">
                                            <script type="text/javascript">
                                                function FieldFunctionNameIndexChanged(sender, args) {
                                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                                    tableView.filter("FunctionId", args.get_item().get_value(), "EqualTo");


                                                }
                                            </script>
                                        </telerik:RadScriptBlock>
                                    </FilterTemplate>
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="RuleExpression" HeaderStyle-Width="370px" AllowFiltering="false"
                                    HeaderText="Rule Expression" HtmlEncode="true">
                                </telerik:GridBoundColumn>
                                <telerik:GridButtonColumn ConfirmText="Do you confirm to delete the record?" ConfirmDialogType="RadWindow"
                                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" ConfirmDialogHeight="150px"
                                    HeaderText="Delete" ConfirmDialogWidth="320px" ItemStyle-Width="30px">
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridButtonColumn>
                            </Columns>
                        </MasterTableView>
                        <ClientSettings>
                            <Selecting AllowRowSelect="true" />
                        </ClientSettings>
                        <PagerStyle AlwaysVisible="true" />
                    </telerik:RadGrid>
                    </telerik:RadAjaxLoadingPanel>
                    <asp:ObjectDataSource ID="ObjectDataSourceRule" runat="server" EnablePaging="true"
                        OnSelecting="ObjectDataSourceRule_Selecting" SelectCountMethod="GetTotalRecord"
                        SelectMethod="GetRuleData" TypeName="BTSIS.Business.MaintainRuleBC">
                        <SelectParameters>
                            <asp:Parameter Name="filterExpressions" Type="String" ConvertEmptyStringToNull="true" />
                        </SelectParameters>
                    </asp:ObjectDataSource>


CS code:
   protected void ObjectDataSourceRule_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
        {
            if (e.ExecutingSelectCount) return;
            
            string expression = RadGridRule.MasterTableView.FilterExpression;


            if (!expression.Contains("RuleType") && expression.Contains("FunctionId"))
            {
                expression = string.Empty;
            }


            RadGridRule.MasterTableView.FilterExpression = expression;
            e.InputParameters["filterExpressions"] = expression;


            if (e.Arguments.MaximumRows == int.MaxValue) e.Arguments.MaximumRows = this.RadGridRule.MasterTableView.PageSize;            
        }
Angel Petrov
Telerik team
 answered on 11 Oct 2012
1 answer
69 views

So far I've not seen this problem anywhere else, and all of the other developers who have a lot more experience with this than I have never seen it either.

I have a grid on a .aspx page, that has data associated with it.  When the page loads there is a VERY small area for the data grid lines(turns out it is 10px).  When I right-click and "refresh" the page, the grid is correctly showing (170px).  The area for the grid appears to be rendering fine, and actually the grid area itself appears to be the correct size, just the data lines (and a miniture scrollbar) show on the initial load, the page refresh shows it just fine. When I debug the page, the correct data is in the grid.

Here is the radWindow definition for the page: 

<rad:RadWindow ID="ctlEmailSubmittals" runat="server" ClientCallBackFunction="RadWindowCallBack"  

Height="700px" Left="" Modal="true" SkinsPath="~/RadControls/Window/Skins"  

Title="Submittal Generated" Top="" VisibleStatusbar="False" Width="1200px"  

Behavior="Close" /> 


And the html:

<form i

d="form1" runat="server"

 

<rad:RadAjaxManager ID="ctlAjaxMgr" runat="server">   

 

<AjaxSettings>  

 

<rad:AjaxSetting AjaxControlID="ctlAjaxMgr">  

 

<UpdatedControls>  

 

<rad:AjaxUpdatedControl ControlID="rgEmailAddresses" />  

 

</UpdatedControls>  

 

</rad:AjaxSetting>  

 

<rad:AjaxSetting AjaxControlID="rgEmailAddresses">  

 

<UpdatedControls>  

 

<rad:AjaxUpdatedControl ControlID="rgEmailAddresses" />  

 

</UpdatedControls>  

 

</rad:AjaxSetting>  

 

<rad:AjaxSetting AjaxControlID="ctlABLDirtyFlagLite" />  

 

</AjaxSettings> 

 

<ClientEvents OnRequestStart="DoRequestStartEvents();" OnResponseEnd="DoResponseEndEvents();" />  

 

</rad:RadAjaxManager>  


...some other html for other parts of the page:
then the grid definition: 

<tr>  

 

<td> 

 

<span>TO:</span>  

 

<rad:RadGrid ID="rgEmailAddresses" runat="server" AutoGenerateColumns="False" Skin="ABL_Std"  

 

DataSourceID="odsContacts" AllowMultiRowSelection="True" Height="170px">  

<MasterTableView CommandItemDisplay="Top" TableLayout="Fixed">  

 

<RowIndicatorColumn Visible="False">  

 

</RowIndicatorColumn>  

 

<Columns>  

 

<rad:GridTemplateColumn UniqueName="SELECT">  

 

<HeaderStyle Width="22px" />  

 

<HeaderTemplate>  

 

<asp:CheckBox ID="chkHeaderSelect" runat="server" onclick="SelectAllCheckedChanged();" />  

 

</HeaderTemplate>  

 

<ItemTemplate>  

 

<asp:CheckBox ID="chkSelect" runat="server" onclick="SingleCheckboxCheckedChanged();" /> 

 

</ItemTemplate>  

 

</rad:GridTemplateColumn>  

 

<rad:GridBoundColumn DataField="COMPANY_TYPE" DataType="System.String" HeaderText="Company Type"  

 

ReadOnly="True" SortExpression="COMPANY_TYPE" UniqueName="company_type">  

 

<HeaderStyle Width="142px" />  

 

</rad:GridBoundColumn>  

 

<rad:GridBoundColumn DataField="COMPANY" DataType="System.String" HeaderText="Company"  

 

ReadOnly="True" UniqueName="company">  

 

<HeaderStyle Width="170px" />  

 

</rad:GridBoundColumn>  

 

<rad:GridBoundColumn DataField="COMPANY_CONTACT_DATA" DataType="System.String" HeaderText="Contact"  

 

ReadOnly="True" UniqueName="company_contact_data">  

 

<HeaderStyle Width="145px" />  

 

</rad:GridBoundColumn>  

 

<rad:GridBoundColumn DataField="CONTACT_EMAIL_ADDRESS" DataType="System.String" HeaderText="Email Address"  

 

ReadOnly="True" UniqueName="contact_email_address"

 

<HeaderStyle Width="175px" />  

 

</rad:GridBoundColumn>  

 

</Columns>  

 

<CommandItemTemplate>  

 

<div>  

 

<a href="javascript:void(0);" onclick="AddSelectedEmails();">Add Emails</a>  

 

</div> 

 

</CommandItemTemplate>  

 

<NoRecordsTemplate>  

 

<asp:Label ID="label1" Text="No records to display." runat="server"></asp:Label>  

 

</NoRecordsTemplate>  

 

</MasterTableView>  

 

<ClientSettings> 

 

<Selecting AllowRowSelect="False" /> 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="170px" />  

</ClientSettings>  

 

</rad:RadGrid>  

 

</td>  

 

</tr> 


Anyone have any idea of what may be going on?  Been fighting this one for a couple of days now.

Thanks.
Rich
Pavlina
Telerik team
 answered on 11 Oct 2012
1 answer
107 views
HI!!

I have this version Telerik.Web.UI_2012_2_724_Dev_hotfix, but I couldn't found icons of buttons.

I created a custom control to transfer from RadListBox to RadgRid

I need use Icons of transfer (radlistbox) button. See attach : captura

Where i can found this icons?

regards

Nencho
Telerik team
 answered on 11 Oct 2012
2 answers
623 views
Hi,

I am using Telerik Controls v 2011.3.1115.35 on a .net 3.5 framework.  I am trying to set the text of the Notification via javascript in this code:

var notification = $find(Notification_ClientID);
var message = "Error";
notification.set_title("Error Notification");
notification.set_text(message);
notification.show();

The title is set, the notification displays, but not the text.  I read that there was a bug in this previously, but I believe I have the latest version...can I get some help with this?

Thank you.

Vanessa
Robert Bross
Top achievements
Rank 1
 answered on 11 Oct 2012
2 answers
50 views
Help, I am struggling trying to pass a list object from a WCF project to an array on a .aspx file.  I need to be able to send a table or array of data using JSONP or JSON and I am unsuccessful in doing so with a list object.  I was able to successfully send one record of information easily, but sending a list of more then one is proving to be a hard time.  Please tell me how I can do this.  Thanks!
Slav
Telerik team
 answered on 11 Oct 2012
13 answers
944 views
When I have a rad window open if I click the title bar of the window so that the window itself has the focus, then I hit enter, the window closes.  This is very annoying and I need to stop it from happening, but I can't seem to stop it completely.  I can stop it from happening when the user has the focus on a control on the window's form, but not the rad window itself.

Thanks
Waseem
Top achievements
Rank 1
 answered on 11 Oct 2012
0 answers
62 views

 

I have a telerik radstrip with two radtabs on my page which is linked to a radmultipage with two pages and the each of the pages have a radgrid on it. I hide/show the radstrip on a button click.

sometimes the radtab style changes unexpectedly and showing it as bulleted rather than tabs as in attached image.

when the page loads first time I do not show the tab. Clicking on the button shows the tab and it is showing up properly as in attached image 1. Then I hide the tab by clicking the button again and make some drop down selection and then click the button again to show the tab. This time my selection causes the grids on the tab to show some data. But now the tab style is changed unexpectedly as in attached image 2.

please help.

shaji kunjumon
Top achievements
Rank 1
 asked on 11 Oct 2012
1 answer
84 views
Hi,

I was wondering if it is possible to disable the delete/rename options of the context menu only on the condition where the directory contains files.


Many Thanks
Daniel
Top achievements
Rank 1
 answered on 11 Oct 2012
1 answer
80 views
Is it possible to embed an HTML link into an Appointment within Scheduler?
Plamen
Telerik team
 answered on 11 Oct 2012
7 answers
398 views
All,

I ran across this control as I was digging through the fabulous and voluminous documenation of the Telerik controls and am trying to get this to work on the asp:DropDownList control because we are using RadControls on our new development and it'll take time (and budget) to go back and change the older pages over. 

What seems awesome is that it appears that one could use the RadFormDecorator and at least trick the user into thinking all the controls are the same.

But, what I'm running into is that the asp:DropDownList doesn't seem to be decorated, but if I use the HTML to create a drop down list (SELECT), it works.

I also noticed that the RadFormDecorator wasn't applying the designated theme against RadControls either...
Is there something I'm missing?
EDITED TO ADD:
I forgot to mention that the application ultimately will only be run in IE8/9, but it's behaving the same way in Firefox
Thanks,
Ray

Here is my code
<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeBehind="ActivityProperties.aspx.cs" Inherits="BAC.IRIS.UI.Web.ActivityProperties" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<head id="Head1" runat="server">
    <title></title>
</head>
<body style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px;">
    <form id="Telerik" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="All" 
        EnableRoundedCorners="true" Skin="Black" />
    <h4>Test</h4>
    <table id="LeftColumn" cellpadding="3" cellspacing="0" width="100%" >
       <tr>
            <td align="left" valign="top">
                <asp:Label ID="lblActivityIDDesc" runat="server" Text="Activity ID:  "/>
            </td>
            <td>
                   
            </td>
            <td align="left">
                <telerik:RadTextBox ID="radActivityID" runat="server" ReadOnly="true"/>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                <asp:Label ID="Label1" runat="server" Text="Activity Type:  "  />
                <asp:Label ID="Label2" runat="server" Text="*"  />
            </td>
            <td>
                   
            </td>
            <td align="left" valign="top">
                <asp:DropDownList ID="ddlActivityType" runat="server">
                    <asp:ListItem Text="Test Item" Value="1" />
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                <asp:Label ID="Label3" runat="server" Text="Activity Type:  "  />
                <asp:Label ID="Label4" runat="server" Text="*"  />
            </td>
            <td>
                   
            </td>
            <td align="left" valign="top">
                <select id="select1" name="ddlTest">
                <option value="1">Test Item</option></select>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
Bozhidar
Telerik team
 answered on 11 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?