Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
111 views
Hi Experts,

We have a Grid that we bind using the Simple Object collection.
The Format of the Object is such that:
ParentObject
            ChildObjectCollection
                        ChildObjectProperty

Hence when we bind our grid we provide the collection of ParentObject to it.
We have a GridBoundColumn there with following settings:
    .UniqueName = "MyColumn"

    .DataField =

"ChildObject(0).sFullName"  or "ChildObject.(0).sFullName" 

 

    .DataType =

GetType(String)

This work perfectly fine and we are able to see the data as required.
But the issue is that when we are  trying to filter on this column its not responding at all and seems like its not able to find the column itself.Hence the grid is still intact with same number of rows.
We have also set the EnableLinqExpressions = false, hence filtering operation is more close to SQL version.
I also tried setting the FilterExpression manually before the NeedDataSource Event and check that expression is still there.But still same result.
Please let me know if you have ideas.
Thanks for  your help in advance

Regards,
Aayam Singh

 

Tsvetoslav
Telerik team
 answered on 05 May 2010
1 answer
73 views
Hi
I'm having trouble getting the right data in my radgrid. I am working with an asp.net webapplication with C# and a WCF webservice. This webservice returns me a list of values which I have to put in class so I can show them in my radgrid. The problem is that the radgrid gets the wrong attributes. Can somebody take a look at this code and tell me what I'm doing wrong? Here's my code:

codebehind (c#):
foreach (string key in keys) { 
if (lijst.TryGetValue(key, out value)) { 
        properties.Add(new VO_ObjectPropertyHelper(key,value[0],value[1])); 
      } 
 
rgProperties.DataSource = properties; 
rgProperties.MasterTableView.DataSource = properties; 
 

VO_ObjectHelper class:
public partial class VO_ObjectPropertyHelper { 
        public string propID { getset; } 
        public string name { getset; } 
        public string value { getset; } 
 
        public VO_ObjectPropertyHelper(string _propID, string _name, string _value) { 
            this.propID = _propID; 
            this.name = _name; 
            this.value = _value; 
        } 
    } 


webpage:
<telerik:RadGrid ID="rgProperties" runat="server" AutoGenerateColumns="False" GridLines="None" AllowSorting="True" ShowHeader="false" Skin="Vista"
    <mastertableview> 
        <RowIndicatorColumn> 
            <HeaderStyle Width="20px"></HeaderStyle> 
        </RowIndicatorColumn> 
        <ExpandCollapseColumn> 
            <HeaderStyle Width="20px"></HeaderStyle> 
        </ExpandCollapseColumn> 
        <Columns> 
            <telerik:GridBoundColumn DataField="name" HeaderText="Meter Eigenschappen" SortExpression="name" UniqueName="name" >                
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="value" HeaderText="" SortExpression="value" UniqueName="value"
            </telerik:GridBoundColumn> 
        </Columns> 
    </mastertableview> 
</telerik:RadGrid> 
 
Ronald Kamp
Top achievements
Rank 1
 answered on 05 May 2010
1 answer
128 views

The following UserControl, OpportunityList.ascx, using the Ajaxed RadGrid refreshes the whole page the first time in when you click the Next button in the paging navigation bar.  Subsequently, it works properly refereshing only the control itself.  Is there a fix for this?


[By the way we bind the data to the radGrid in the UserControl's Page_PreRender event, otherwise we get the error 
Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.   If there is a better way to work around this error, please let us know.]

_______________________________________________________________________________________
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OpportunityList.ascx.cs" Inherits="Deloitte.Ca.OnePortal.UserControls.OpportunityList, Deloitte.Ca.OnePortal.UserControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=97bcd997dcc9fbb7" %>
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>
<%@ Register Assembly="Telerik.Web.UI, Version=2010.1.415.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Label ID="lblError" runat="server"></asp:Label>
<telerik:RadAjaxManager ID="radAjaxManager" runat="server">
  <AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="rgdOpportunityList">
      <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="rgdOpportunityList" LoadingPanelID="radAjaxLoadingPanel" />
      </UpdatedControls>
    </telerik:AjaxSetting>
  </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="radAjaxLoadingPanel" runat="server" Skin="Default">
</telerik:RadAjaxLoadingPanel>

<telerik:RadGrid ID="rgdOpportunityList" runat="server" Width="100%"
AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" PageSize="3"
GridLines="None" Skin="Windows7">
  <MasterTableView OverrideDataSourceControlSorting="true">
    <RowIndicatorColumn>
      <HeaderStyle Width="20px"></HeaderStyle>
    </RowIndicatorColumn>
    <ExpandCollapseColumn>
      <HeaderStyle Width="20px"></HeaderStyle>
    </ExpandCollapseColumn>
  </MasterTableView>
</telerik:RadGrid>

Pavlina
Telerik team
 answered on 05 May 2010
9 answers
836 views

Hi,
I have checkboxes in rad combobox.
My first checkbox has the value All.
What I want is, I would like to select checkboxes for all when 'All' is selected,and if any one checkbox is deselected, then the check of 'All' should be deselected.

Below is the aspx code of rad combobox.
I want to achieve this through javascript.

<

radC:RadComboBox runat="server" ID="RadComboBox1" AllowCustomText="True" HighlightTemplatedItems="True"

 

 

Skin="WebBlue" SkinsPath="~/RadControls/ComboBox/Skins" UseEmbeddedScripts="False"

 

 

OnClientDropDownOpening="OnClientDropDownOpening" OnClientDropDownClosing="OnClientDropDownClosing"

 

 

OnClientSelectedIndexChanging="onSelectedIndexChanging" OnClientBlur="OnClientBlur"

 

 

DropDownWidth="140px" Height="110px" Width="120px">

 

 

<ItemTemplate>

 

 

<asp:CheckBox runat="server" ID="chk" onclick="checkboxClick();" Text='<%# DataBinder.Eval(Container, "Text") %>' />

 

 

</ItemTemplate>

 

 

<Items>

 

 

<radC:RadComboBoxItem Text="All" Value="0" ID="chbSelectAll" onclick="javascript:SelectAll();" runat="server" />

 

 

<radC:RadComboBoxItem Text="Unassigned" Value="1" runat="server" />

 

 

<radC:RadComboBoxItem Text="Assigned" Value="2" runat="server" />

 

 

<radC:RadComboBoxItem Text="Reassigned" Value="4" runat="server" />

 

 

<radC:RadComboBoxItem Text="Posted" Value="5" runat="server" />

 

 

</Items>

 

 

</radC:RadComboBox>

Moderators/Admin please help.

 

Manish
Top achievements
Rank 1
 answered on 05 May 2010
1 answer
114 views
I use the PanelBar for navigation to other pages, which triggers a postback - thereby resetting the state of the PanelBar. I would like the PanelBar to persist the collapse/expand state of its items regardless of postbacks. I have tried the various fixes such as setting the PreventCollapse property on Items, trapping expand events client-side, etc but been unsuccessful in retaining state. It appears the only way to persist state is to write some sort of custom state handler that uses a hidden input field? Any advice would be appreciated.

Thanks!
Justin

btw: I am using the PanelBar in Sharepoint.
Nikolay Tsenkov
Telerik team
 answered on 05 May 2010
1 answer
100 views
Hi,

I'm attempting to use related Combo box's here is my code
var cboUsers; 
        var chkNewUser; 
        function pageLoad() { 
            cboUsers = $telerik.findComboBox('<%= Page.FindControlRecursive("cboUsers").ClientID %>'); 
            chkNewUser = $telerik.$('#<%= Page.FindControlRecursive("chkNewUser").ClientID %>'); 
        } 
 
        function cboUser_Load(sender) { 
            debugger
            var cboCompany = $telerik.findComboBox('<%= Page.FindControlRecursive("cboCompanies").ClientID %>'); 
            var cboUser = $telerik.toComboBox(sender); 
            var selectedValue = cboCompany.get_value(); 
            cboUser.set_text("Loading..."); 
            cboUser.clearSelection(); 
 
            if (selectedValue != "") { 
                cboUser.requestItems(selectedValue, false); 
                 
            } 
        } 
 
        function cboUser_IndexChanged(sender, args) { 
            debugger
            var item = args.get_item(); 
             
            var cnHidVal = $telerik.$('#'+'<%= Page.FindControlRecursive("selectedUser").ClientID %>'); 
 
            cnHidVal.val(item.get_value()); 
 
        } 
 
        function LoadUsers(combo, eventArgs) { 
            var cboCompany = $telerik.toComboBox(combo); 
            var item = eventArgs.get_item(); 
            cboUsers = $telerik.findComboBox('<%= Page.FindControlRecursive("cboUsers").ClientID %>'); 
            cboUsers.set_text("Loading..."); 
            cboUsers.clearSelection(); 
            if (item.get_index() != -1) { 
                cboUsers.requestItems(item.get_value(), false); 
            } 
        } 
 
        function companyDropDownClosed(sender, args) { 
            var cboCompanybox = $telerik.toComboBox(sender); 
 
            var selectIndex = cboCompanybox.get_selectedIndex(); 
            cboUsers = $telerik.findComboBox('<%= Page.FindControlRecursive("cboUsers").ClientID %>'); 
 
            if (selectIndex == -1) { 
                cboUsers.clearSelection(); 
                cboUsers.clearItems(); 
            } 
 
        } 
 
        function cboUserItemsRequest(sender, args) { 
            var userCbo = $telerik.toComboBox(sender); 
            userCbo.trackChanges(); 
 
            if (userCbo.get_items().get_count() == 0) { 
                chkNewUser.trigger('click'); 
                userCbo.disable(); 
                userCbo.commitChanges(); 
                return
            } 
            else { 
 
                userCbo.enable(); 
                var comboItem = new Telerik.Web.UI.RadComboBoxItem(); 
                comboItem.set_text(""); 
                comboItem.set_value(""); 
                var items = userCbo.get_items() 
                items.insert(0, comboItem); 
                userCbo.commitChanges(); 
                if (chkNewUser.attr("checked")) 
                    chkNewUser.trigger('click'); 
            } 
 
        var cnHidVal = $telerik.$('#' + '<%= Page.FindControlRecursive("selectedUser").ClientID %>'); 
        if (cnHidVal.val() != "") { 
            for (i = 0; i < userCbo.get_items().get_count(); i++) { 
                var item = userCbo.get_items().getItem(i); 
                if (item.get_value() == cnHidVal.val()) { 
                    item.select(); 
                } 
 
            } 
        } 
Then on the server side i have an Custom Validator which does the following
protected void cboUsers_Validate(object sender, ServerValidateEventArgs args) 
        {  
            var newUserchecked = (System.Web.UI.WebControls.CheckBox)Page.FindControlRecursive("chkNewUser"); 
            RadComboBox cboUsers = (RadComboBox)Page.FindControlRecursive("cboUsers"); 
            args.IsValid = (newUserchecked.Checked) || (cboUsers.SelectedValue != "-1" && !newUserchecked.Checked); 
        } 
HTML Code here
<telerik:RadComboBox runat="server" OnClientLoad="cboUser_Load" OnClientItemsRequested="cboUserItemsRequest" OnClientSelectedIndexChanged="cboUser_IndexChanged" 
                                                        OnItemsRequested="cboUsers_ItemsRequested" Width="100%" ID="cboUsers" /> 
                                                    <asp:CustomValidator OnServerValidate="cboUsers_Validate" ErrorMessage="Please Select a User" ControlToValidate="cboUsers" 
                                                        EnableClientScript="false" Display="None" runat="server" /> 
BUT on the server side code SelectedValue is "" i have got a work around which is to put the selected value into a hidden input field but i shouldn't have too.


Kalina
Telerik team
 answered on 05 May 2010
4 answers
149 views
Good Day

i am using  the Schedule to display appointments, i have the Following Data Example

ID           Description     StartDate                              EndDate
84337    CMG211C1    2010-05-03 00:00:00.000    2010-05-03 00:00:00.000
84338    CMG211C1    2010-05-03 00:00:00.000    2010-05-03 00:00:00.000
84339    CMG211C1    2010-05-03 00:00:00.000    2010-05-03 00:00:00.000
84340    CMG211C1    2010-05-03 00:00:00.000    2010-05-03 00:00:00.000
84341    CMG211C1    2010-05-03 00:00:00.000    2010-05-03 00:00:00.000
84342    CMG211C1    2010-05-03 00:00:00.000    2010-05-03 00:00:00.000
84343    CMG211C1    2010-05-03 00:00:00.000    2010-05-03 00:00:00.000
84344    CMG211C1    2010-05-03 00:00:00.000    2010-05-03 00:00:00.000
84345    CMG211C1    2010-05-03 00:00:00.000    2010-05-03 00:00:00.000
84346    CMH103Y1    2010-05-03 00:00:00.000    2010-05-03 00:00:00.000
84347    CMH103Y1    2010-05-03 00:00:00.000    2010-05-03 00:00:00.000
84348    CMH103Y1    2010-05-03 00:00:00.000    2010-05-03 00:00:00.000
84349    CMH103Y1    2010-05-03 00:00:00.000    2010-05-03 00:00:00.000

The Description is used as the Subject name and the start date is that and i id is obvious. When i run my Schedul , it does not bring me any appointments on the Viewer

Thanks

Vuyiswa
Top achievements
Rank 2
 answered on 05 May 2010
1 answer
117 views
hi guys. i need chek box in gridview that when chaked recorde delete.
and i need to access to all textbox in my grid

any guys can help me?


tnx
Princy
Top achievements
Rank 2
 answered on 05 May 2010
1 answer
122 views
When I want to export the data to excel,and I want to export all the data and I set the IgnorePaging Property to true,
but it doesn't work. I can only export the current page's data.How I can export all the pages's data ?

<asp:Button ID="Button1" runat="server" CssClass="button-ts" OnClick="Export" Text="To Excel" />

<
telerik:RadGrid ID="rgridview" runat="server" OnPageIndexChanged="rgridview_PageIndexChanged" 
                                                        OnPageSizeChanged="rgridview_PageSizeChanged" OnSortCommand="rgridview_SortCommand" 
                                                        OnItemDataBound="rgridview_ItemDataBound" Skin="Vista" AlternatingItemStyle-BackColor="#efefef"
                                                        <HeaderStyle BackColor="#efefef" /> 
                                                        <PagerStyle Mode="NumericPages" /> 
                                                        <MasterTableView AutoGenerateColumns="False" DataKeyNames="InvitedPeapleName" AllowPaging="True" 
                                                            EnableViewState="true" AllowSorting="True" PageSize="20" TableLayout="Fixed" 
                                                            Width="950px" ForeColor="Black"
                                                            <NoRecordsTemplate> 
                                                                "没有符合条件的数据! 
                                                            </NoRecordsTemplate> 
                                                            <Columns> 
                                                                <telerik:GridBoundColumn DataField="InvitedPeapleName" HeaderText="被邀请人" SortExpression="InvitedPeapleName" 
                                                                    UniqueName="InvitedPeapleName"
                                                                    <HeaderStyle Wrap="False" Width="48px" /> 
                                                                    <ItemStyle Wrap="False" /> 
                                                                </telerik:GridBoundColumn> 
                                                                <telerik:GridBoundColumn DataField="Department" HeaderText="部门" SortExpression="Department" 
                                                                    UniqueName="Department"
                                                                    <HeaderStyle Wrap="False" Width="80px" /> 
                                                                    <ItemStyle Wrap="False" /> 
                                                                </telerik:GridBoundColumn> 
                                                                <telerik:GridBoundColumn DataField="ActivityName" HeaderText="活动名称" SortExpression="ActivityName" 
                                                                    AllowSorting="false" UniqueName="ActivityName"
                                                                    <HeaderStyle Wrap="False" Width="60px" /> 
                                                                    <ItemStyle Wrap="False" /> 
                                                                </telerik:GridBoundColumn> 
                                                                <telerik:GridBoundColumn DataField="ActivityDate" DataType="System.DateTime" HeaderText="活动时间" 
                                                                    SortExpression="ActivityDate" UniqueName="ActivityDate" DataFormatString="{0:yyyy-MM-dd HH:mm}"
                                                                    <HeaderStyle Width="80px" /> 
                                                                </telerik:GridBoundColumn> 
                                                                <telerik:GridBoundColumn DataField="ActivtiyPlace" HeaderText="活动地点" SortExpression="ActivtiyPlace" 
                                                                    AllowSorting="false" UniqueName="ActivtiyPlace"
                                                                    <HeaderStyle Wrap="False" Width="60px" /> 
                                                                    <ItemStyle Wrap="False" /> 
                                                                </telerik:GridBoundColumn> 
                                                                <telerik:GridBoundColumn DataField="ActivityContent" HeaderText="活动内容" SortExpression="ActivityContent" 
                                                                    AllowSorting="false" UniqueName="ActivityContent"
                                                                    <HeaderStyle Wrap="False" Width="60px" /> 
                                                                    <ItemStyle Wrap="False" /> 
                                                                </telerik:GridBoundColumn> 
                                                                <telerik:GridBoundColumn DataField="ActivityPartner" HeaderText="对方单位" SortExpression="ActivityPartner" 
                                                                    UniqueName="ActivityPartner"
                                                                    <HeaderStyle Wrap="False" Width="50px" /> 
                                                                    <ItemStyle Wrap="False" /> 
                                                                </telerik:GridBoundColumn> 
                                                                <telerik:GridBoundColumn DataField="Reasons" HeaderText="说明" SortExpression="Reasons" 
                                                                    AllowSorting="false" UniqueName="Reasons"
                                                                    <HeaderStyle Wrap="False" Width="80px" /> 
                                                                    <ItemStyle Wrap="False" /> 
                                                                </telerik:GridBoundColumn> 
                                                                <telerik:GridBoundColumn DataField="JoinOrNo" HeaderText="是否参加" SortExpression="JoinOrNo" 
                                                                    UniqueName="JoinOrNo"
                                                                    <HeaderStyle Wrap="False" Width="40px" /> 
                                                                    <ItemStyle Wrap="False" /> 
                                                                </telerik:GridBoundColumn> 
                                                            </Columns> 
                                                            <PagerTemplate> 
                                                                <div style="float: left;"
                                                                    共<%# DataBinder.Eval(Container, "Paging.DataSourceCount")%>条 &nbsp&nbsp每页<%# DataBinder.Eval(Container,"Paging.PageSize") %>条 
                                                                    &nbsp&nbsp当前第<%# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %> 
                                                                    页/共<%# DataBinder.Eval(Container, "Paging.PageCount")%>页 
                                                                    <asp:Button ID="Button1" runat="server" OnClientClick="changePage('first'); return false;" 
                                                                        CommandName="Page" CommandArgument="First" Text="首页" CssClass="PagerButton FirstPage" /> 
                                                                    <asp:Button ID="Button2" runat="server" OnClientClick="changePage('prev'); return false;" 
                                                                        CommandName="Page" CommandArgument="Prev" Text="上一页" CssClass="PagerButton PrevPage" /> 
                                                                    <asp:Button ID="Button3" runat="server" OnClientClick="changePage('next'); return false;" 
                                                                        CommandName="Page" CommandArgument="Next" Text="下一页" CssClass="PagerButton NextPage" /> 
                                                                    <asp:Button ID="Button4" runat="server" OnClientClick="changePage('last'); return false;" 
                                                                        CommandName="Page" CommandArgument="Last" Text="尾页" CssClass="PagerButton LastPage" /> 
                                                                    转到第 
                                                                    <telerik:RadNumericTextBox ID="RadNumericTextBox1" Width="25px" Value='<%# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>' 
                                                                        runat="server"
                                                                        <ClientEvents OnValueChanged="RadNumericTextBox1_ValueChanged" /> 
                                                                        <NumberFormat DecimalDigits="0" /> 
                                                                    </telerik:RadNumericTextBox> 
                                                                    页 
                                                                </div> 
                                                            </PagerTemplate> 
                                                        </MasterTableView> 
                                                        <ClientSettings> 
                                                            <Selecting AllowRowSelect="True" /> 
                                                        </ClientSettings> 
                                                    </telerik:RadGrid>

 protected void Export(object sender, EventArgs e) 
    { 
         
        rgridview.ExportSettings.ExportOnlyData = true
        rgridview.ExportSettings.IgnorePaging =true
        rgridview.ExportSettings.OpenInNewWindow = false
        rgridview.MasterTableView.ExportToExcel(); 
    } 



liu qingshui
Top achievements
Rank 1
 answered on 05 May 2010
0 answers
127 views
Hi,

We have a application with rad grid and using RTL support which is not working properly. Scenarios is as follows

1. RadGrid in ascx page
2. Aspx page with placeholder, dynamically loading ascx page using load control method opened in a popup window using radwindow.

When it first time loads the RTL works, but when we click next page, the numeric pagination will show at left side instead of right and also the all the buttons are not in order.

If we use the ascx directly in aspx page instead of dynamic loading then everything works fine.

We have attached the screenshot for your reference.

Appreciate your quick response.

regards,
hari.
Soma Sekhar Vedantam
Top achievements
Rank 1
 asked on 05 May 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?