Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
61 views
I'm having some trouble with filter menus. When I first load the page, I don't have menus when I click the filter buttons.

I then filter using the CurrentFilterFunction="Contains" setting and pressing <tab>, a postback occurs, and now my filter buttons have the column header menus (Sort Ascending..., Group By, Best fit, etc.)

Any ideas why or what I can do to get and keep the proper filter menus?

C#
protected override void OnPreRender(System.EventArgs e)
{
    // ... Control setup unrelated to RadGrid1
  
    // Test filtering
    bool Filter = true;
    if (Filter)
    {
        RadGrid1.AllowFilteringByColumn = Filter;
        RadGrid1.MasterTableView.AllowFilteringByColumn = Filter;
    }
}

// I've also got handlers for these, but they don't setup filtering:

            RadGrid1.PreRender += RadGrid1_PreRender;
            RadGrid1.ItemCreated += RadGrid1_ItemCreated;
            RadGrid1.ItemDataBound += RadGrid1_ItemDataBound;
            RadGrid1.NeedDataSource += RadGrid1_NeedDataSource;
            RadGrid1.GroupsChanging += RadGrid1_GroupsChanging;



ASCX
<telerik:RadGrid EnableViewState="true" ID="RadGrid1" runat="server" AllowSorting="True" AllowPaging="True" GridLines="None" PageSize="25" AutoGenerateColumns = "false"
                    OnExcelMLWorkBookCreated="RadGrid1_ExcelMLWorkBookCreated" OnItemCreated="RadGrid1_ItemCreated" OnHTMLExporting="RadGrid1_HtmlExporting"
                    AllowMultiRowSelection="True" ShowFooter="true" ShowGroupPanel="True" EnableHeaderContextMenu="true"  Skin="Xledger" EnableEmbeddedSkins="false" style="z-index: 0;">
 
                    <PagerStyle AlwaysVisible="true" />
 
                     <ExportSettings IgnorePaging="true" OpenInNewWindow="true">
                        <Pdf PageHeight="210mm" PageWidth="297mm" DefaultFontFamily="Arial Unicode MS" PageTopMargin="45mm" BorderStyle="Medium" BorderColor="#666666"></Pdf>
                    </ExportSettings>
 
                    <ClientSettings AllowColumnsReorder="true" ReorderColumnsOnClient="true" ColumnsReorderMethod="Reorder" AllowDragToGroup="true">
 
                        <Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True" AllowColumnResize="True" AllowResizeToFit="true"></Resizing>
                        <Selecting AllowRowSelect="true" />
                        <Scrolling AllowScroll="false"/><%--<Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" FrozenColumnsCount="2"></Scrolling> --%>
 
                    </ClientSettings>
 
                    <GroupingSettings ShowUnGroupButton="true" RetainGroupFootersVisibility="true"></GroupingSettings>
  
                    <MasterTableView ShowGroupFooter="true" TableLayout="Auto"  Width="100%" AllowMultiColumnSorting="true" AllowGroupCollapse="true" GroupLoadMode="Client" EnableGroupsExpandAll="true">
 
                        <%-- AUTOGROUP BY ACCOUNT GROUP
                         <GroupByExpressions>
                          <telerik:GridGroupByExpression>
                            <SelectFields>
                              <telerik:GridGroupByField FieldName="t_rv_account_group" />
                            </SelectFields>
                            <GroupByFields>
                              <telerik:GridGroupByField FieldName="t_rv_account_group" />
                            </GroupByFields>
                          </telerik:GridGroupByExpression>
                        </GroupByExpressions>
                        --%>
 
                        <Columns>
                            <telerik:GridBoundColumn UniqueName="trvAccountGroup" DataField="t_rv_account_group" DataType="System.String" HeaderText="trvAccountGroup"  AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="trvSysAccount" DataField="t_rv_sys_account" DataType="System.String" HeaderText="trvSysAccount"></telerik:GridBoundColumn>
 
<%-- ... more columns ... --%>
 
 
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>

Kostadin
Telerik team
 answered on 11 Sep 2014
1 answer
107 views
Hello,

I am using RadGrid (version 2014.1.403.45) and I need to export a header to PDF, Excel, and CSV.  For PDF, this is accomplished easily, by using the "Pdf-PageTitle" property on the <ExportSettings>.  Is there something similar for Excel and CSV?  If not, is there a workaround?

Thanks,
Steve
Kostadin
Telerik team
 answered on 11 Sep 2014
1 answer
54 views
Whenever I double click on an appointment that is created it takes me to an appointment that belongs in the same resource grouping but one that was created at an earlier date. Any suggestions?
Boyan Dimitrov
Telerik team
 answered on 11 Sep 2014
2 answers
101 views
We're using the RadTreeView to show a hierarchical structure.

Since our data does not follow the format required, (parentid, id, text), we are creating a datatable on the fly, adding values (and additional attributes) and binding. Now the user can add more information to the tree.

When the user is done, we want to access all the data from the tree, convert it to our format and save it back to the database.

The question is: can I access the datatable as it is? For every edit, I'm adding the required data to the datatable (using node attributes).

If not, what is the best way to get all the data out and write it in my required format?

Thanks in Advance.
Boyan Dimitrov
Telerik team
 answered on 11 Sep 2014
1 answer
94 views
In the AddAjaxSetting(Control ajaxifiedControl, Control updatedControl) method, is it ok for both Control arguments to be the same object? For example:

radAjaxMgr1.AjaxSettings.AddAjaxSetting(myCustomEditor, myCustomEditor);

 myCustomEditor is of the type WebControl. It looks like myCustomEditor is going to respond to some client-side action on itself, but is that allowed by the RadAjaxManager?

Thanks!
Konstantin Dikov
Telerik team
 answered on 11 Sep 2014
10 answers
483 views
Hi,

I'm using a radgrid with a templated edit form and popup edit mode. Most of my validators are requireduiredfieldvalidators but one of my fields need to be validated agains the database. I therefore need to use a CustomValidator which is OK but if I do the validation server side then the error is not shown at the same time as the client side validator errors in the validationsummary.

Therefore I'm trying to call an AJAX method in the custom validator:

ClientValidationFunction="InitiateAsyncRequest('this.id')";

This calls the a server side method:

  public void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)

In this method I would like to perform the validation and then set the IsValid flag on the customervalidator. The problem I am having is finding the CustomValidator control in the AjaxRequest method on the server. The SelectedItems property on the RadGrid is empy and RadGrid.FindControl("Customvalidator1") returns null. Is this possible? Or is there an easier way to do this?

Thanks, Stuart


Maria Ilieva
Telerik team
 answered on 11 Sep 2014
1 answer
75 views
I have a RadGrid which uses InPlace editing, and this grid contains a RadComboBox and a RadTextBox. When the user changes the text choice of the RadTextBox, the value behind the choice is used to retrieve data using AutoPostBack, and the returned data needs to update the text value of the RadTextBox.

Here's what the .aspx code looks like:

<telerik:RadGrid ID="rgvMsgElementToMsgTemplate" runat="server" GridLines="None" AutoGenerateColumns="false" MasterTableView-NoMasterRecordsText="No Records To Display">
    <MasterTableView CommandItemDisplay="Top" NoDetailRecordsText="No Records To Display" EditMode="InPlace">
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                <HeaderStyle Width="50px" />
            </telerik:GridEditCommandColumn>
            <telerik:GridTemplateColumn DataField="TMPLT_NM" HeaderText="Template" UniqueName="TMPLT_NM">
                 <HeaderStyle Width="200px" />
                 <ItemTemplate>
                     <asp:LinkButton ID="lblMessageTemplate" CommandName="EDIT" runat="server" Text='<%#Container.DataItem("TMPLT_NM")%>' />                                                                                   
                 </ItemTemplate>
                 <InsertItemTemplate>
                    <telerik:RadComboBox runat="server" ID="rcbTemplate" DataTextField="TMPLT_NM" DataValueField="AMCAT_ID" Width="190px" DropDownAutoWidth="Enabled"
                        OnSelectedIndexChanged="rcbTemplate_SelectedIndexChanged" AutoPostBack="true"></telerik:RadComboBox>
                    <asp:RequiredFieldValidator ID="rcbTemplateValidator" CssClass="redreq" ControlToValidate="rcbTemplate" InitialValue="-- Select an Item --" runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
                 </InsertItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Version Id" UniqueName="TMPLT_VRS_ID" DataField="TMPLT_VRS_ID">
                <HeaderStyle Width="50px" />
                <ItemTemplate>
                    <%# Eval("TMPLT_VRS_ID")%>
                </ItemTemplate>
                <InsertItemTemplate>
                    <telerik:RadTextBox runat="server" ID="rtbVersion" DataField="TMPLT_VRS_ID" readonly="true" Width="50px"></telerik:RadTextBox>
                </InsertItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

My issue is that inside the SelectedIndexChanged event, I don't know how to access the InsertItem(s) defined in the .aspx from within this event. I have tried to use the NamingContainer, EditItems collection, the GetInsertItems() function, using a Try/DirectCast to FindControl to no avail.


Public Sub rcbTemplate_SelectedIndexChanged(sender As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs)
 
' Somewhere in here I need to get to the each item inside the InPlace edit section of the grid...
 
End Sub

Is this even possible?

Thanks.

Jim











Eyup
Telerik team
 answered on 11 Sep 2014
1 answer
60 views
Hi there,

Is there a way to paste images directly into the Rich text field without having the need to use first the Image manager? My users make this as a key requirement.

Thanks
Ianko
Telerik team
 answered on 11 Sep 2014
1 answer
145 views
2014.2.724.45
When in Grid Init event:
GridID.FilterMenu.Items.Clear()

With filtering active on a column, clicking the filter button generates this javascript error:

Uncaught TypeError: Cannot read property `_linkElement` of undefined

Referring to this code:
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.GridColumn=function(a){Telerik.Web.UI.GridColumn.initializeBase(this,[a]);
.....
var h=this._filterMenu.get_focusedItem()||this._filterMenu.get_items().getItem(0);
if(h._linkElement){h._linkElement.focus();  <-- err line. 6623
}else{if(h._templateElement){h._templateElement.focus();

The line above does not appear in the the version 2014.1.403.45 nor does the same error happen.

I have to add 
<ClientEvents OnFilterMenuShowing="RadGrid_DisableFilterMenu" />

function RadGrid_DisableFilterMenu(sender, args) {
  args.set_cancel(true)
}
Konstantin Dikov
Telerik team
 answered on 11 Sep 2014
1 answer
71 views
I truly believe that if Telerik would provide a full graphical class diagram of the entire RadGrid class, that many of the questions seen in this forum would just disappear. The currently available HTML based API document is a poor representation of the RadGrid class and it is useless for determining how to access subclass elements of the RadGrid.

Is there anyway for Telerik to provide such a diagram?
Kostadin
Telerik team
 answered on 11 Sep 2014
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?