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!
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
>
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
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.
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.
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
|
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