Telerik Forums
UI for ASP.NET AJAX Forum
11 answers
500 views

Hi,

I have requirement where on 1 main aspx page i have 3 user controls(ascx).

Each ascx has a radgrid.I need to save state of each grid in database individually on gridbutton click.

Tried- I have created a custom storage provider and implemented methods SaveStateToStorage and LoadStateFromStorage.

Now if I apply persistencemanger on any ascx and call .savestate it goes to SaveStateToStorage  and all works fine.

But if I move persistencemanger  to aspx and apply persistencemangerproxy on ascx nothing works.

Sample code-

on aspx-  <telerik:RadPersistenceManager  ID="mainPersistenceManager" runat="server">   </telerik:RadPersistenceManager>

on aspx.vb- pageload event -  mainPersistenceManager.StorageProvider = New SettingsStorageProvider() 'This is my custom storage provider

on ascx- <telerik:RadPersistenceManagerProxy  ID="PersistenceManagerProxy1" runat="server" UniqueKey ="1">

        <PersistenceSettings>
            <telerik:PersistenceSetting ControlID="radgrid1" />
        </PersistenceSettings>
    </telerik:RadPersistenceManagerProxy>

on ascx.vb- on button click event-

 Dim ascxPersistenceManager As RadPersistenceManager

 ascxPersistenceManager = RadPersistenceManager.GetCurrent(Page)
       ascxPersistenceManager.PersistenceSettings.AddSetting("radgrid1")
        SettingsStorageProvider.StorageProviderKey = Key
        ascxPersistenceManager .SaveState()

 

Now on button click i get exception that it could not find control with id=radgrid1

but if i comment this line "ascxPersistenceManager.PersistenceSettings.AddSetting("radgrid1")"

somehow it calls "LoadStateFromStorage" of my custom storage provider rather than "SaveStateToStorage" method.

 

Incase when i dont use proxy and put persistencemanger in ascx only it hits correct method but not in case of proxy.

Please help 

 

Thanks,

Ankita

Vessy
Telerik team
 answered on 11 Apr 2018
1 answer
282 views

I have a radgrid with filtering enabled. Clicking an item in the grid does a Response.Redirect to another page to open the item details page.  When I click browser's Back button, the grid is displayed with all the filtering cleared.  Is there a way to preserve filtering?

Attila Antal
Telerik team
 answered on 11 Apr 2018
3 answers
270 views

I have a hierarchical parent-child grid where only the child rows can be edited.

When any parent row is expanded I need to have the child rows immediately placed in edit mode.  They also need to retain their values for posting if the parent row is subsequently collapsed, so that all child rows can be enumerated for posting the results.  How would I accomplish that?

Following is the markup for the grid

            <telerik:RadGrid ID="ctlGridAuditSeriesChecklist" runat="server"

                AllowMultiRowEdit="true"
                AllowMultiRowSelection="false"
                AllowPaging="false" 
                AllowSorting="false" 
                AutoGenerateColumns="False"
                BorderColor="#a6a6a6"
                BorderStyle="Solid"
                BorderWidth="0" 
                CellPadding="10" 
                CellSpacing="5"
                CssClass="TUV_grid"
                DataMember="DefaultView"
                DataSourceID="odsGridAuditSeriesChecklist"
                GridLines="Both"
                ImagesPath="~/images/grid"
                ShowFooter="false"
                Width="700px" >
                <ClientSettings
                    EnableAlternatingItems="true"
                    Scrolling-AllowScroll="false"
                    Scrolling-SaveScrollPosition="true"
                    Scrolling-UseStaticHeaders="true" /> 
                <ExportSettings
                    Excel-Format="Xlsx"
                    ExportOnlyData="false"
                    FileName="AuditSeriesReview" 
                    HideStructureColumns="true"
                    IgnorePaging="true"
                    OpenInNewWindow="true" />
                <MasterTableView
                    DataKeyNames="AuditID"
                    CommandItemDisplay="Top"
                    EditMode="InPlace" >
                    <CommandItemTemplate>
                        <span class="TUV_gridHeader">Audit Series Review Checklist</span>
                    <telerik:RadButton ID="btnExportToPDF" runat="server"
                        CommandName="ExportToPDF"
                        Icon-PrimaryIconUrl="~/images/ExportToPDF.gif"
                        Text="Export To PDF" />
                    <telerik:RadButton ID="btnExportToExcel" runat="server"
                        CommandName="ExportToExcel"
                        Icon-PrimaryIconUrl="~/images/ExportToExcel.gif"
                        Text="Export To Excel" />
                    <telerik:RadButton ID="btnExportToCSV" runat="server"
                        CommandName="ExportToCSV"
                        Icon-PrimaryIconUrl="~/images/ExportToCsv.gif"
                        Text="Export To CSV" />
                    </CommandItemTemplate>
                    <Columns>
                        <telerik:GridBoundColumn 
                            DataField="CARMajorCount"
                            DataType="System.Int32"
                            HeaderText="CAR Major Count"
                            UniqueName="CARMajorCount"
                            ReadOnly="true" />
                        <telerik:GridBoundColumn 
                            DataField="CARMinorCount"
                            DataType="System.Int32"
                            HeaderText="CAR Minor Count"
                            UniqueName="CARMinorCount"
                            ReadOnly="true" />
                        <telerik:GridBoundColumn 
                            DataField="CARUploadCount"
                            DataType="System.Int32"
                            HeaderText="CAR Upload Count"
                            UniqueName="CARUploadCount"
                            ReadOnly="true" />
                        <telerik:GridBoundColumn 
                            DataField="CARAppealCount"
                            DataType="System.Int32"
                            HeaderText="CAR Appeal Count"
                            UniqueName="CARAppealCount"
                            ReadOnly="true" />
                        <telerik:GridBoundColumn 
                            DataField="CARApprovalCount"
                            DataType="System.Int32"
                            HeaderText="CAR Approval Count"
                            UniqueName="CARApprovalCount"
                            ReadOnly="true" />
                        <telerik:GridBoundColumn 
                            DataField="CARStatusText"
                            DataType="System.String"
                            HeaderText="CAR Status"
                            UniqueName="CARStatusText"
                            ReadOnly="true" />
                        <telerik:GridButtonColumn
                            ButtonType="ImageButton"
                            UniqueName="CARs"
                            CommandName="CARs" 
                            HeaderText="CARs" 
                            ItemStyle-HorizontalAlign="Center"
                            ItemStyle-Wrap="false" />
                        <telerik:GridBoundColumn 
                            DataField="AuditID"
                            DataType="System.Int32"
                            Visible="false" />
                    </Columns>
                    <DetailTables>
                        <telerik:GridTableView runat="server"
                            DataKeyNames="AuditReviewID"
                            DataSourceID="odsGridAuditSeriesChecklistSub"
                            AllowPaging="false" 
                            AllowSorting="false"
                            PagerStyle-AlwaysVisible="false"
                            Width="96%" >
                            <ParentTableRelation>
                                <telerik:GridRelationFields
                                    DetailKeyField="AuditID"
                                    MasterKeyField="AuditID" />
                            </ParentTableRelation>
                            <Columns>
                                <telerik:GridBoundColumn 
                                    DataField="DocumentName"
                                    DataType="System.String"
                                    HeaderText="DocumentName"
                                    ReadOnly="true" />
                                <telerik:GridBoundColumn 
                                    DataField="Need"
                                    DataType="System.String"
                                    UniqueName="Need"
                                    HeaderText="Need"
                                    ReadOnly="true" />
                                <telerik:GridCheckBoxColumn 
                                    DataField="AdminReview"
                                    DataType="System.Boolean"
                                    UniqueName="AdminReview"
                                    HeaderText="A/R"
                                    ItemStyle-Wrap="true" />
                                <telerik:GridCheckBoxColumn 
                                    DataField="MainReview"
                                    DataType="System.Boolean"
                                    UniqueName="MainReview"
                                    HeaderText="M/R"
                                    ItemStyle-Wrap="true" />
                                <telerik:GridTemplateColumn
                                    DataField="TechReview"
                                    HeaderText="Yes No N/A Corr"
                                    UniqueName="TechReview"
                                    HeaderStyle-Wrap="false"
                                    ItemStyle-Wrap="false" >
                                    <EditItemTemplate>
                                        <asp:RadioButtonList ID="optTechReview" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
                                            <asp:ListItem Text = "" Value="Yes" />
                                            <asp:ListItem Text = "" Value="No" />
                                            <asp:ListItem Text = "" Value="NA" />
                                            <asp:ListItem Text = "" Value="Corr" />
                                        </asp:RadioButtonList>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn 
                                    DataField="Remarks"
                                    UniqueName="Remarks"
                                    HeaderText="Remarks" 
                                    DataType="System.String"/>

                                <telerik:GridBoundColumn 
                                    DataField="AuditReviewID"
                                    DataType="System.Int32"
                                    Visible="false" />
                            </Columns>
                        </telerik:GridTableView>
                    </DetailTables>
                </MasterTableView>
            </telerik:RadGrid>

    <asp:ObjectDataSource ID="odsGridAuditSeriesChecklist" runat="server" 
        TypeName="GridAuditorMainReview_Checklist"
        DataObjectTypeName="GridAuditorMainReview_Checklist.Bean"
        EnablePaging="True"
        SelectCountMethod="GetRecordCount"
        SelectMethod="GetRecords" 
        SortParameterName="SortExpression" >
    </asp:ObjectDataSource>

    <asp:ObjectDataSource ID="odsGridAuditSeriesChecklistSub" runat="server" 
        TypeName="GridAuditorMainReview_Checklist_Sub"
        DataObjectTypeName="GridAuditorMainReview_Checklist_Sub.Bean"
        SelectCountMethod="GetRecordCount"
        SelectMethod="GetRecords" >
        <SelectParameters>
            <asp:SessionParameter Name="AuditID" SessionField="AuditID" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>

Attila Antal
Telerik team
 answered on 10 Apr 2018
1 answer
1.1K+ views

I have a combobox with checkboxes to choose what columns in a grid to have visible and not, the grid and combobox is ajaxified.

on the combobox itemChecked event i find the appropiate column and set its visibility value based on the checkbox, all very simple enough,

protected void cmbGridColumnChooser_ItemChecked(object sender, RadComboBoxItemEventArgs e)
    {
        grCases.Columns.FindByUniqueName(e.Item.Value).Visible = e.Item.Checked;
        var test = grCases.Columns.FindByUniqueName(e.Item.Value).Visible;
    }

 

However, setting the column to visible=false works great But when setting the column visible to visible=true again does not, even though the checkbox state shows true, and after checking the columns visible state straight afterwords (its true) the column still wont appear.

 

Any ideas anyone?

Attila Antal
Telerik team
 answered on 10 Apr 2018
1 answer
349 views

Hi,

I have a RadComboBox which has an extra "Select All"-type item to select a sub set of all items. When this item is checked and the combobox is closed, I would like for the counter to ignore it when displaying how many items are checked.

e.g. The combobox contains "Select all", "Select all fruits", "apple", "banana", "monkey"

If I check "banana" and "monkey", it displays "2 items checked".

If I check "select all fruits", "apple" and "banana" will be checked but since "select all fruits" is also an item, it will display "3 items checked"

 

I haven't been able to find a way to have the combobox ignore one of the listitems or to change the count of selected items. Is this possible?

Eyup
Telerik team
 answered on 10 Apr 2018
2 answers
109 views

Hi,

 

I'm using in a web application RadDock control. However I'm trying to figure out if it is possible to use DockCommand as a RadAjaxManager trigger. Because DockCommand has no ID it seems very hard to achieve this.

 

My application scenario is quite easy to understand. The dock command button must load a user control in a panel (ExtendedViewPanel) and then reload it. Please consider the following code :

 

        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="MyDockCommand">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="ExtendedViewPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
            <telerik:RadDockLayout runat="server" ID="RadDockLayout1">
                <table style="width:100%">
                    <tr>
                        <td>
                            <telerik:RadDockZone runat="server" ID="RadDockZone1" Orientation="Horizontal" Style="border: 0;">
                                <telerik:RadDock RenderMode="Lightweight" ID="RadDock1" runat="server" Title="Classeurs non publiés"
                                    EnableAnimation="true" CssClass="higherZIndex" Width="33%" Skin="Metro" OnCommand="RadDock1_Command">
                                    <Commands>
                                        <telerik:DockToggleCommand Name="SwitchView" AutoPostBack="true" CssClass="command-maximize"/>
                                    </Commands>
                                    <ContentTemplate>
                                        <div>
                                            <widget:LastModifiedWorkbook ID="LastModifiedWorkbookControl" runat="server" />
                                            <asp:HiddenField runat="server" ID="toggleState" />
                                        </div>
                                    </ContentTemplate>
                                </telerik:RadDock>
                            </telerik:RadDockZone>
                        </td>
                    </tr>
                </table>
            </telerik:RadDockLayout>
<asp:Panel runat="server" ID="ExtendedViewPanel" CssClass="extended-view-panel" Visible="false">
</asp:Panel>

 

Thanks for your help,

Marin Bratanov
Telerik team
 answered on 10 Apr 2018
7 answers
360 views
When adding HTML5 video tag to the editor, it strips out the controls preload attributes:
<video id="video" poster="myposter.jpg" src="myvideo.mp4" controls preload></video>

Any suggestions? 

Thanks
Chuck
Rumen
Telerik team
 answered on 10 Apr 2018
0 answers
108 views
So I have a grid that is pulling most of it's information from one context/one database (db1). But I have one column that is pulling it's information from another context/database (db2) based on one of the columns from db1. However, if I try to filter or sort on this column, nothing happens. I have exhausted my researching abilities and tried many fixes for this and none of them are working great. What, in your opinion, would be the best solve? 
Alyssa
Top achievements
Rank 1
 asked on 09 Apr 2018
2 answers
204 views
Hi

I have a GridColumnButton how would I print a pdf from its click event. Ideally I like to open the pdf print / preview window

Andy
JOSE LUIZ TORDINO
Top achievements
Rank 1
 answered on 09 Apr 2018
4 answers
246 views
I want open one pdf window on click of that Id.

How to open pdf in new window
JOSE LUIZ TORDINO
Top achievements
Rank 1
 answered on 09 Apr 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
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
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?