Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
254 views

Using version 2015.2.623.45, RadGrid posts back when selecting the same row...

<ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True" EnablePostBackOnRowClick="True">
     <Selecting AllowRowSelect="True" EnableDragToSelectRows="False" />
     <Scrolling AllowScroll="True" UseStaticHeaders="True" />
     <Resizing AllowColumnResize="True" AllowResizeToFit="True" EnableRealTimeResize="True" />
</ClientSettings>

Is there a ClientSettings-Selecting property that can be set or a javascript snippet to disallow postback when the selected row is selected again?

We'd like to avoid using the ClientSelectColumn.

Thanks!

cookies please
Top achievements
Rank 1
 answered on 01 Sep 2015
1 answer
150 views

All

I've been messing with a couple of problems far too long and I desperately need some help.

I have a RadGrid, EditMode=Batch, with 1:M DetailsTable

I have 2 major problems

1. Checkbox ​and edit mode. I know you can't select a checkbox. I have this kind of working using a GridTemplateColumn instead of a GridCheckboxColumn. It works fine in Chrome using code below, but in IE and FF, it still requires 2 clicks.

2. I need to add a CheckAll Button or Checkbox in the footer of each DetailsTable/GridTableView Flag column that will force all checkboxes in that single DetailsTable to checked, even if they are already checked. All samples work with MasterTable only and I can't figure out how to have it iterate in javascript through the particular DetailsTable.

PLEASE, any help or direction would be most appreciated.

            <telerik:RadGrid ID="RadGrid1" runat="server" CssClass="transparentRadGrid" AllowPaging="False"
                AllowSorting="True" AutoGenerateColumns="False" ShowStatusBar="False" AllowAutomaticDeletes="True"
                AllowAutomaticInserts="True" AllowAutomaticUpdates="True" DataSourceID="sdsGrid1"
                Width="99%" ShowGroupPanel="False" AllowFilteringByColumn="False" AutoGenerateHierarchy="True"
                ShowHeader="false" EnableLinqExpressions="false" >
                <SortingSettings EnableSkinSortStyles="False" />
                <MasterTableView Name="MasterTableView" CommandItemDisplay="None" DataSourceID="sdsGrid1"
                    DataKeyNames="SubSystemID" AllowSorting="True" Width="100%" EditMode="InPlace"
                    HierarchyDefaultExpanded="true" NoMasterRecordsText="No SubSystems have been created. Create a SubSystem by clicking the green + button above." >
                    <DetailTables>
                        <telerik:GridTableView AllowAutomaticInserts="false" Name="DetailTableView" TableLayout="Fixed" CommandItemDisplay="None"
                            ShowHeader="true" ShowFooter="true" HierarchyLoadMode="ServerBind" EnableHierarchyExpandAll="true"
                            EditMode="Batch" DataKeyNames="SystemRowID" DataSourceID="sdsGrid3" Width="100%"
                            runat="server" NoDetailRecordsText="No Parts in this SubSystem." >
                            <CommandItemStyle HorizontalAlign="Right" />
                            <CommandItemSettings ShowRefreshButton="false" ShowAddNewRecordButton="false" RefreshText="" AddNewRecordText=""
                                CancelChangesText="" SaveChangesText="" />
                            <BatchEditingSettings EditType="Row" />
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="SubSystemID" MasterKeyField="SubSystemID" />
                            </ParentTableRelation>
                            <Columns>
                                <telerik:GridBoundColumn UniqueName="SystemRowID" HeaderText="ID" DataField="SystemRowID"
                                    DataType="System.Int32" ReadOnly="True" SortExpression="SystemRowID" Visible="false" />
 
....(other fields)...
                                <telerik:GridTemplateColumn HeaderText="Flag" SortExpression="Flag" UniqueName="Flag">
                                    <ItemTemplate>
                                        <asp:CheckBox id="cbFlag" runat="server" checked='<%# Bind("Flag") %>' onclick="changeEditor(this);" />
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:CheckBox ID="cbFlag" runat="server" Checked='<%# Bind("Flag") %>' />
                                    </EditItemTemplate>
                                    <FooterTemplate>
                                        <input type="checkbox" runat="server" value="check" ID="checkbox" onclick="checkAll();"  />
                                    </FooterTemplate>
                                    <HeaderStyle Width="40px" HorizontalAlign="Center" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </telerik:GridTemplateColumn>
                            </Columns>
                            <FooterStyle />
                        </telerik:GridTableView>
                    </DetailTables>
                    <Columns>
                        <telerik:GridBoundColumn UniqueName="SubSystemID" HeaderText="ID" DataField="SubSystemID"
                            DataType="System.Int32" ReadOnly="True" SortExpression="SubSystemID" Display="False" />
 
                        <telerik:GridTemplateColumn HeaderText="SubSystem Name" SortExpression="SubSystemName"
                            UniqueName="SubSystemName">
                            <ItemTemplate>
                                <asp:Label ID="SubSystemName" runat="server" Text='<%# Eval("SubSystemName").ToUpper %>' />
                            </ItemTemplate>
                            <InsertItemTemplate>
                                SubSystem Name: 
                                <telerik:RadTextBox ID="SubSystemName" runat="server" Text='<%# Bind("SubSystemName") %>'
                                    Width="200px" MaxLength="100" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="SubSystemName"
                                    ErrorMessage="SubSystem Name is required." Text="*" />
                            </InsertItemTemplate>
                            <EditItemTemplate>
                                SubSystem Name: 
                                <telerik:RadTextBox ID="SubSystemName" runat="server" Text='<%# Bind("SubSystemName") %>'
                                    Width="200px" MaxLength="100" />
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="SubSystemName"
                                    ErrorMessage="SubSystem Name is required." Text="*" />
                            </EditItemTemplate>
                            <ItemStyle Font-Bold="true" Font-Size="Larger" Width="400px" />
                        </telerik:GridTemplateColumn>
 
                        <telerik:GridTemplateColumn HeaderText="Phase" SortExpression="Phase" UniqueName="Phase">
                            <ItemTemplate>
                                <asp:Label ID="Phase" runat="server" Text='<%# Eval("Phase") %>' />
                            </ItemTemplate>
                            <InsertItemTemplate>
                                Phase: 
                                <telerik:RadDropDownList ID="Phase" runat="server" AppendDataBoundItems="true" DataSourceID="sdsProjectPhases"
                                    DataTextField="Phase" DataValueField="PhaseID" SelectedValue='<%# Bind("PhaseID") %>'
                                    Skin='<%# Session("UserSkin") %>' />
                            </InsertItemTemplate>
                            <EditItemTemplate>
                                Phase: 
                                <telerik:RadDropDownList ID="Phase" runat="server" AppendDataBoundItems="true" DataSourceID="sdsProjectPhases"
                                    DataTextField="Phase" DataValueField="PhaseID" SelectedValue='<%# Bind("PhaseID") %>'
                                    Skin='<%# Session("UserSkin") %>' />
                            </EditItemTemplate>
                            <ItemStyle Font-Size="Larger" />
                        </telerik:GridTemplateColumn>
 
                        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="ImageButton"
                            Exportable="false">
                            <ItemStyle Width="40px" />
                        </telerik:GridEditCommandColumn>
                        <telerik:GridButtonColumn CommandName="Delete" Text="Delete" ButtonType="ImageButton"
                            ConfirmText="Are you sure you want to delete this record?" Exportable="false">
                            <ItemStyle Width="23px" />
                        </telerik:GridButtonColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings AllowKeyboardNavigation="True" AllowDragToGroup="false" EnableRowHoverStyle="true"
                    AllowColumnsReorder="False" ReorderColumnsOnClient="false">
                    <%--<ClientEvents OnKeyPress="keyPress" />--%>
                </ClientSettings>
            </telerik:RadGrid>
 
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function checkAll() {
                var grid = $find("<%=RadGrid1.ClientID%>");
                var detailTables = grid.get_detailTables(0);
                setSelectedToAllDataItems(detailTables[1].get_dataItems(), true);
                //var items = grid.get_masterTableView().get_dataItems();
                //for (var i = 0; i < detailTables.length; i++) {
                    //alert(i);
                    //var cb = detailTables.get_dataItems()[i].findElement("cbFlag");
                    //cb.checked = !cb.checked;
                    //checkBox2.checked obj.checked;
                    //setSelectedToAllDataItems(detailTables[i].get_dataItems(), true);
                    //grid.get_batchEditingManager().openRowForEdit(sender.parentElement.parentElement.parentElement);
                //}
            }
            function setSelectedToAllDataItems(dataItems, selected) {
                for (var i = 0; i < dataItems.length; i++) {
                    alert(i);
                    //dataitems[i].get_cell("cbDisplay"), true);
                    //dataItems[i].set_selected(selected);
 
                    var cb = dataItems[1].get_cell("Flag");
                    var checkBox2 = detailTables.get_dataItems()[i].findElement("cbFlag");
                    checkBox2.checked = obj.checked;
                }
            }
 
            function changeEditor(sender, args) {
                var grid = $find("<%=RadGrid1.ClientID%>");
                var batchManager = grid.get_batchEditingManager();
                //grid.get_batchEditingManager().openRowForEdit(sender.parentElement.parentElement);
                grid.get_batchEditingManager().openRowForEdit(sender.parentElement.parentElement.parentElement);
                sender.checked = !sender.checked;
            }
 
            function refreshGrid() {
                var masterTable = $find("<%=radGrid1.clientId%>").get_masterTableView();
                masterTable.rebind();
            }
            function saveGridChanges(sender, args) {
                var grid = $find("<%=RadGrid1.ClientID%>");
                var batchManager = grid.get_batchEditingManager();
                batchManager.saveAllChanges();
                //__doPostBack("btnSaveAll", "");
            }
            function cancelGridChanges() {
                var masterTable = $find("<%=radGrid1.clientId%>").get_masterTableView();
                masterTable.rebind();
            }
        </script>
    </telerik:RadCodeBlock>

Viktor Tachev
Telerik team
 answered on 01 Sep 2015
1 answer
114 views

Hi,

I am using 2015.1.401.40 of your ASP.NET controls for AJAX.

One of my PivotGridColumnField's is a smalldatetime field from SQL Server.

In the PivotGrid column header labels I want the dates to be formatted as MMM-yy,  like Aug-15.

I can accomplish that for the detail columns (the non-aggregate columns) by setting the DataFormatString="{0:MMM-yy}"

But that doesn't affect the label of the column total header.  That header label reads:  "08/01/2015 00:00:00 Total"

Again, my goal is to have it read:  Aug-15 Total

How can I accomplish this?  I can't believe there isn't a property to control it...

I've seen a couple of suggestions where people were told they should change the header text in the CellDataBound Event, but the problem is that in this event I don't seem to have access to the date value.  I have only seen that I can read the current header text which again is a string of a date and the word "Total".

I don't want to strip the word "Total" out of that string and then then convert the date that remains to a string in the date format I want.  We do localization here so I would imagine that if my culture was something other than English, the word "Total" would be translated into another language.

If there isn't a neat and clean way to do this, it seems like a big oversight (missing functionality) on the part of the pivotgrid.

Thanks,

Brent

Angel Petrov
Telerik team
 answered on 01 Sep 2015
3 answers
214 views
I have been looking through the support topics and the online documentation but can't seem to find any information.  Can I use the RadUpload to transfer files to an FTP server instead of using the TargetFolder option?

Thanks,
- Jason
Nencho
Telerik team
 answered on 01 Sep 2015
1 answer
79 views

Hi,  

I knew that you didn't support this control from your site.

And I had the problem about IE 11, Firefox. Please see link http://i.imgur.com/gltkd5W.png. So I will update to new RadEditor Ajax for free, right?

If yes, please give me know how to do it. (I only need to update DLL in Telerik\UI for ASP.NET AJAX Q2 2015\Bin35 or Bin4x folder to my project???) .

If no, please explain to me that why I must pay to you a fee? And how much I will pay to you?

 

Thanks in advances,

Huy Tran.

Marin Bratanov
Telerik team
 answered on 01 Sep 2015
1 answer
127 views

Team,

I need to export student images with details in to pdf with ASP.net server side. Image information is stored in varbinary format in Database. Can you help me please, how to export pdf with Images and details.

Kostadin
Telerik team
 answered on 01 Sep 2015
3 answers
177 views
I am using Version 2013  of telerik webUI and the frame work for my web application is .Net framework 3.5. Issue is when im opening the particular .aspx form in internet explorer it is appearing proper, but in firefox and chrome it appears weird. FYR screenshot is attached.

Magdalena
Telerik team
 answered on 01 Sep 2015
0 answers
55 views
i need to insert new dataitem to the existing kendo gantt data source. but i cant able to do. i have used javascript splice method also, but not working

$("#gantt").data("kendoGantt").dataSource.fetch(function () {
    //newJsonData contains the objects for insertion
    $.each(newJsonData, function (i, row) {
       //insert data to gantt data source
       this._data.pop(newJsonData[i]);
   });
});
Azeem
Top achievements
Rank 1
 asked on 01 Sep 2015
0 answers
67 views
 

i need to insert new dataitem to the existing kendo gantt data source. but i cant able to do. i have used javascript splice method also, but not working

$("#gantt").data("kendoGantt").dataSource.fetch(function () {
    //newJsonData contains the objects for insertion
    $.each(newJsonData, function (i, row) {
       //insert data to gantt data source
       this._data.pop(newJsonData[i]);
   });
});

i need to insert new dataitem to the existing kendo gantt data source. but i cant able to do. i have used javascript splice method also, but not working

$("#gantt").data("kendoGantt").dataSource.fetch(function () {
    //newJsonData contains the objects for insertion
    $.each(newJsonData, function (i, row) {
       //insert data to gantt data source
       this._data.pop(newJsonData[i]);
   });
});

i need to insert new dataitem to the existing kendo gantt data source. but i cant able to do. i have used javascript splice method also, but not working

$("#gantt").data("kendoGantt").dataSource.fetch(function () {
    //newJsonData contains the objects for insertion
    $.each(newJsonData, function (i, row) {
       //insert data to gantt data source
       this._data.pop(newJsonData[i]);
   });
});

i need to insert new dataitem to the existing kendo gantt data source. but i cant able to do. i have used javascript splice method also, but not working

$("#gantt").data("kendoGantt").dataSource.fetch(function () {
    //newJsonData contains the objects for insertion
    $.each(newJsonData, function (i, row) {
       //insert data to gantt data source
       this._data.pop(newJsonData[i]);
   });
});

i need to insert new dataitem to the existing kendo gantt data source. but i cant able to do. i have used javascript splice method also, but not working

$("#gantt").data("kendoGantt").dataSource.fetch(function () {
    //newJsonData contains the objects for insertion
    $.each(newJsonData, function (i, row) {
       //insert data to gantt data source
       this._data.pop(newJsonData[i]);
   });
});

i need to insert new dataitem to the existing kendo gantt data source. but i cant able to do. i have used javascript splice method also, but not working

$("#gantt").data("kendoGantt").dataSource.fetch(function () {
    //newJsonData contains the objects for insertion
    $.each(newJsonData, function (i, row) {
       //insert data to gantt data source
       this._data.pop(newJsonData[i]);
   });
});

i need to insert new dataitem to the existing kendo gantt data source. but i cant able to do. i have used javascript splice method also, but not working

$("#gantt").data("kendoGantt").dataSource.fetch(function () {
    //newJsonData contains the objects for insertion
    $.each(newJsonData, function (i, row) {
       //insert data to gantt data source
       this._data.pop(newJsonData[i]);
   });
});
Azeem
Top achievements
Rank 1
 asked on 01 Sep 2015
2 answers
92 views

Hi,

I use the 2015.1.401.40 version of your ASP.NET for AJAX controls.

If it matters, I'm currently binding it to a SQLDataSource.

From what I see, the entire PivotGrid does a PostBack when you:

- click a filter to display the Filter Popup

- expand or collapse a row or column field to show or hide detail

Why does it postback???  When I expand a row to show detail, and then collapse it, there is no reason to post back.  I'm not even rebinding on postback.  Why doesn't the control just use javascript to hide the detail.

The same with the filter popup... when you click the filter icon, why not just display a div that you could have put in the page when the control was initially bound?  Why do a postback to then just display the filters in a popup?

Am I missing something or doing something wrong?  Most of you other controls (hierarchical grid or grid with grouping​), they are able to hide / show children or grouped rows on the client.  Why doesn't the pivot grid?

Thanks,

Brent

Eyup
Telerik team
 answered on 01 Sep 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?