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?
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>
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?
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?
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,
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
src
=
"/JS/jquery-1.8.2.min.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"/JS/jquery-ui-1.9.2.custom.js"
></
script
>
<
script
type
=
"text/javascript"
>
function ShowColumnHeaderMenu(ev, columnName) {
var grid = $find("<%=RadGrid1.ClientID %>");
var columns = grid.get_masterTableView().get_columns();
for (var i = 0; i <
columns.length
; i++) {
if (columns[i].get_uniqueName() == columnName) {
columns[i].showHeaderMenu(ev, 75, 20);
}
}
}
</script>
</
telerik:RadCodeBlock
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowPaging
=
"true"
AllowSorting
=
"true"
OnDeleteCommand
=
"RadGrid1_DeleteCommand"
OnInsertCommand
=
"RadGrid1_InsertCommand"
OnUpdateCommand
=
"RadGrid1_UpdateCommand"
OnNeedDataSource
=
"RadGrid1_NeedDataSource"
OnItemDataBound
=
"RadGrid1_OnItemDataBound"
Skin
=
"Office2010Silver"
EnableHeaderContextMenu
=
"true"
EnableHeaderContextFilterMenu
=
"true"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
></
PagerStyle
>
<
MasterTableView
Width
=
"100%"
EditMode
=
"InPlace"
CommandItemDisplay
=
"Bottom"
DataKeyNames
=
"ID, Status, Description"
HorizontalAlign
=
"NotSet"
AutoGenerateColumns
=
"False"
NoMasterRecordsText="<%$Resources:Resources, NoItems%>"
InsertItemDisplay="Bottom" EditItemStyle-VerticalAlign="Top"
AllowFilteringByColumn="True" IsFilterItemExpanded="false">
<
CommandItemSettings
AddNewRecordText="<%$Resources:Resources, NewItem%>"
ShowRefreshButton="false" />
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ID"
UniqueName
=
"ID"
Visible
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
DataField
=
"DueDateTime"
SortExpression
=
"DueDateTime"
UniqueName
=
"DueDateTime"
ItemStyle-HorizontalAlign
=
"Left"
HeaderStyle-HorizontalAlign
=
"Left"
GroupByExpression
=
"DueDateTime Group By DueDateTime"
>
<
HeaderTemplate
>
<
asp:LinkButton
runat
=
"server"
CommandArgument
=
"DueDateTime"
CommandName
=
"Sort"
Text="<%$Resources:Resources, Date%>"></
asp:LinkButton
>
<
img
src
=
"/Images/funnel-icon.png"
style="margin-top: 5px; margin-left: 5px;
cursor: pointer"
onclick
=
'ShowColumnHeaderMenu(event,"DueDateTime")'
alt
=
"Filter"
/>
</
HeaderTemplate
>
<
ItemTemplate
>
<
asp:Label
runat
=
"server"
ID
=
"lblDate"
></
asp:Label
>
</
ItemTemplate
>
<
InsertItemTemplate
>
<
telerik:RadDateTimePicker
ID
=
"dtpDate"
runat
=
"server"
Width
=
"195"
>
<
Calendar
ID
=
"ddCalendar"
runat
=
"server"
EnableKeyboardNavigation
=
"true"
>
</
Calendar
>
<
DateInput
ID
=
"ddDate"
runat
=
"server"
DateFormat
=
"dd/MM/yyyy hh:mm tt"
>
</
DateInput
>
<
TimeView
ID
=
"TimeView1"
runat
=
"server"
Interval
=
"00:30:00"
>
</
TimeView
>
</
telerik:RadDateTimePicker
>
</
InsertItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadDateTimePicker
ID
=
"dtpDate"
runat
=
"server"
Width
=
"195"
>
<
Calendar
ID
=
"ddCalendar"
runat
=
"server"
EnableKeyboardNavigation
=
"true"
>
</
Calendar
>
<
DateInput
ID
=
"ddDate"
runat
=
"server"
DateFormat
=
"dd/MM/yyyy hh:mm tt"
>
</
DateInput
>
<
TimeView
runat
=
"server"
Interval
=
"00:30:00"
>
</
TimeView
>
</
telerik:RadDateTimePicker
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>