I have a RadGrid with a datasource and I added 4 more columns manually and I populate these 4 columns in the server side.
When I try to export the RadGrid data, the 4 columns that I added manually doesn't display the cell values.
Is there a configuration that I have to set?
Code client-side:
<
telerik:RadGrid
ID
=
"radGridOLAUtilization"
runat
=
"server"
AllowFilteringByColumn
=
"True"
AllowSorting
=
"True"
DataSourceID
=
"sqlDataSource"
CellSpacing
=
"-1"
>
<
ExportSettings
ExportOnlyData
=
"true"
></
ExportSettings
>
<
GroupingSettings
CollapseAllTooltip
=
"Collapse all groups"
></
GroupingSettings
>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"False"
/>
</
ClientSettings
>
<
MasterTableView
DataSourceID
=
"sqlDataSource"
AutoGenerateColumns
=
"False"
UseAllDataFields
=
"true"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"PalletID"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter PalletID column"
HeaderText
=
"Pallet ID"
SortExpression
=
"PalletID"
UniqueName
=
"PalletID"
HeaderStyle-HorizontalAlign
=
"Center"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Station"
FilterControlAltText
=
"Filter Station column"
HeaderText
=
"Station"
SortExpression
=
"Station"
UniqueName
=
"Station"
HeaderStyle-HorizontalAlign
=
"Center"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"StartDateTime"
DataType
=
"System.DateTime"
FilterControlAltText
=
"Filter StartDateTime column"
HeaderText
=
"Start DateTime"
SortExpression
=
"StartDateTime"
UniqueName
=
"StartDateTime"
HeaderStyle-HorizontalAlign
=
"Center"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"EndDateTime"
DataType
=
"System.DateTime"
FilterControlAltText
=
"Filter EndDateTime column"
HeaderText
=
"End DateTime"
SortExpression
=
"EndDateTime"
UniqueName
=
"EndDateTime"
HeaderStyle-HorizontalAlign
=
"Center"
> </
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"DeltaTime"
DataType
=
"System.TimeSpan"
FilterControlAltText
=
"Filter DeltaTime column"
HeaderText
=
"Delta Time"
ReadOnly
=
"True"
SortExpression
=
"DeltaTime"
UniqueName
=
"DeltaTime"
HeaderStyle-HorizontalAlign
=
"Center"
>
</
telerik:GridBoundColumn
>
<!-- Columns added manually -->
<
telerik:GridBoundColumn
DataField
=
"TotalTime"
DataType
=
"System.TimeSpan"
FilterControlAltText
=
"Filter TotalTime column"
HeaderText
=
"Total Time"
ReadOnly
=
"True"
SortExpression
=
"TotalTime"
UniqueName
=
"TotalTime"
HeaderStyle-HorizontalAlign
=
"Center"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
Display
=
"false"
DataField
=
"DownTime"
DataType
=
"System.TimeSpan"
FilterControlAltText
=
"Filter DownTime column"
HeaderText
=
"DownTime"
ReadOnly
=
"True"
SortExpression
=
"DownTime"
UniqueName
=
"DownTime"
HeaderStyle-HorizontalAlign
=
"Center"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataType
=
"System.TimeSpan"
FilterControlAltText
=
"Filter AccumulatedDownTime column"
HeaderText
=
"Accumulated DownTime"
ReadOnly
=
"True"
SortExpression
=
"AccumulatedDownTime"
UniqueName
=
"AccumulatedDownTime"
HeaderStyle-HorizontalAlign
=
"Center"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataType
=
"System.String"
FilterControlAltText
=
"Filter UtilizationTime column"
HeaderText
=
"Utilization Time"
ReadOnly
=
"True"
SortExpression
=
"UtilizationTime"
UniqueName
=
"UtilizationTime"
HeaderStyle-HorizontalAlign
=
"Center"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Server-side:
protected
void
Page_Load(
object
sender, EventArgs e)
{
double
AccumulatedDeltaTime = 0;
for
(
int
i = 0; i < radGridOLAUtilization.Items.Count; i++)
{
TableCell accumulatedDownTimeCell = radGridOLAUtilization.Items[i][
"AccumulatedDownTime"
];
TableCell DownTimeCell = radGridOLAUtilization.Items[i][
"DownTime"
];
TableCell deltaTimeCell = radGridOLAUtilization.Items[i][
"DeltaTime"
];
TableCell accumulatedUtilizationTimeCell = radGridOLAUtilization.Items[i][
"UtilizationTime"
];
TableCell totalTimeCell = radGridOLAUtilization.Items[i][
"TotalTime"
];
AccumulatedDeltaTime += TimeSpan.Parse(deltaTimeCell.Text).TotalSeconds;
if
(i == 0)
{
accumulatedDownTimeCell.Text =
"00:00:00"
;
accumulatedUtilizationTimeCell.Text =
"100%"
;
totalTimeCell.Text = deltaTimeCell.Text;
}
else
{
TableCell previousAccumulatedDownTimeCell = radGridOLAUtilization.Items[i - 1][
"AccumulatedDownTime"
];
TableCell previousTotalTimeCell = radGridOLAUtilization.Items[i - 1][
"TotalTime"
];
double
accumulatedDownTime = TimeSpan.Parse(previousAccumulatedDownTimeCell.Text).TotalSeconds + TimeSpan.Parse(DownTimeCell.Text).TotalSeconds;
accumulatedDownTimeCell.Text = TimeSpan.FromSeconds(accumulatedDownTime).ToString();
int
accumulatedUtilizationTime = (
int
)(100 * AccumulatedDeltaTime / (AccumulatedDeltaTime + accumulatedDownTime));
accumulatedUtilizationTimeCell.Text = accumulatedUtilizationTime.ToString() +
"%"
;
double
totalTime = AccumulatedDeltaTime + accumulatedDownTime;
totalTimeCell.Text = TimeSpan.FromSeconds(totalTime).ToString();
}
}
}
protected
void
btnExportToExcel_Click(
object
sender, EventArgs e)
{
//radGridOLAUtilization.ExportSettings.Excel.Format = GridExcelExportFormat.Xlsx;
radGridOLAUtilization.ExportSettings.FileName =
"Alerts Data"
;
radGridOLAUtilization.ExportSettings.IgnorePaging =
true
;
//radGridOLAUtilization.MasterTableView.ExportToExcel();
radGridOLAUtilization.MasterTableView.ExportToCSV();
}
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="sdsCRNAShifts" GridLines="None" Skin="Simple" |
AutoGenerateColumns="False" AllowAutomaticUpdates="True" AllowAutomaticInserts="True" PageSize="128" Width="100%" AllowSorting="True" OnEditCommand="RadGrid1_EditCommand" > |
<MasterTableView DataSourceID="sdsCRNAShifts" CommandItemDisplay="Top" DataKeyNames="shiftID" > |
<Columns> |
<telerik:GridCheckBoxColumn DataField="active" HeaderText="active" UniqueName="active" AllowFiltering="False" AllowSorting="False"> |
<HeaderStyle Width="20px" /> |
</telerik:GridCheckBoxColumn> |
<telerik:GridDropDownColumn DataField="shiftType" DataSourceID="XmlDataSource1" HeaderText="Type" |
ListValueField="ID" ListTextField="Text" UniqueName="shiftType" > |
<ItemStyle Width="60px" /> |
<HeaderStyle Width="60px" /> |
</telerik:GridDropDownColumn> |
<telerik:GridBoundColumn DataField="shiftName" HeaderText="Name" UniqueName="shiftName" ColumnEditorID="GridTextBoxColumnEditor1" > |
<HeaderStyle Width="120px" /> |
</telerik:GridBoundColumn> |
<telerik:GridBoundColumn DataField="shiftDescr" HeaderText="Description" UniqueName="shiftDescr" ColumnEditorID="GridTextBoxColumnEditor2" AllowSorting="False" > |
<HeaderStyle Width="200px" /> |
</telerik:GridBoundColumn> |
<telerik:GridTemplateColumn DataField="bOff" HeaderText="BeginTime" UniqueName="bOff"> |
<EditItemTemplate> |
<telerik:RadComboBox ID="bOffRadComboBox" runat="server" DataSourceID="sdsTimeText" |
DataTextField="timeText" DataValueField="numMins" SelectedValue='<%# Bind("bOff") %>' AutoPostBack="True" OnSelectedIndexChanged="bOffRadComboBox_SelectedIndexChanged"> |
</telerik:RadComboBox> |
<asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="StartTime must precede EndTime" OnServerValidate="CustomValidator1_ServerValidate"></asp:CustomValidator> |
</EditItemTemplate> |
<ItemTemplate> |
<asp:Label ID="bOffLabel" runat="server" Text='<%# Eval("beginTime") %>'></asp:Label> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridTemplateColumn DataField="eOff" HeaderText="EndTime" UniqueName="eOff"> |
<EditItemTemplate> |
<telerik:RadComboBox ID="eOffRadComboBox" runat="server" DataSourceID="sdsTimeText" |
DataTextField="timeText" DataValueField="numMins" SelectedValue='<%# Bind("eOff") %>' AutoPostBack="True"> |
</telerik:RadComboBox> |
|
<asp:CustomValidator ID="CustomValidator2" runat="server" ErrorMessage="EndTime must follow StartTime" OnServerValidate="CustomValidator2_ServerValidate"></asp:CustomValidator> |
</EditItemTemplate> |
<ItemTemplate> |
<asp:Label ID="eOffLabel" runat="server" Text='<%# Eval("endTime") %>'></asp:Label> |
</ItemTemplate> |
</telerik:GridTemplateColumn> |
<telerik:GridEditCommandColumn ButtonType="ImageButton"> |
<HeaderStyle Width="50px" /> |
</telerik:GridEditCommandColumn> |
</Columns> |
<EditFormSettings> |
<EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit"> |
</EditColumn> |
</EditFormSettings> |
</MasterTableView> |
<ClientSettings> |
<Selecting AllowRowSelect="True" /> |
</ClientSettings> |
</telerik:RadGrid> |
Telerik.Web.UI: 2017.3.913.45
I am using RadTextBox and trying to load the content of the XML file using c# code. This works fine without any issues and loads the XML content. After loading it, the partial just work and it fails. It post at all. I was able to repro this issue and it's very simple to do that. Is this a known issue? Any fix?
Hello,
I'm using the Load On Demand Scenario & I'm attempting to force all child nodes to collapse when its parent has collapsed. Here is the code that I have so far. Any help on this would be greatly appreciated.
Private
Sub
iTeam_DynamicOrgChart_Load(sender
As
Object
, e
As
EventArgs)
Handles
Me
.Load
Dim
oConn
As
New
System.Data.SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings(
"Connection"
).ConnectionString)
Dim
oCmd
As
New
SqlCommand
Dim
oData
As
SqlDataReader
Dim
oAdapter
As
New
SqlDataAdapter(oCmd)
Dim
oDataSet
As
New
DataSet
Try
oConn.Open()
'get employee hierarchy
With
oCmd
.Parameters.Clear()
.Connection = oConn
.CommandType = Data.CommandType.StoredProcedure
.CommandText =
"EmployeeHierachySP"
.Parameters.AddWithValue(
"@NameOnly"
, NameOnly.Checked)
End
With
oAdapter.Fill(oDataSet)
With
OrgChart
.DisableDefaultImage =
True
.LoadOnDemand = OrgChartLoadOnDemand.Nodes
.EnableDrillDown =
True
.PersistExpandCollapseState =
True
.DataTextField =
"UserName"
.DataFieldID =
"UserID"
.DataFieldParentID =
"ManagerUserID"
.DataCollapsedField =
"Collapsed"
.DataSource = oDataSet
'.GroupColumnCount = 4
'.GroupEnabledBinding.GroupItemBindingSettings.DataTextField = "UserName"
'.GroupEnabledBinding.GroupItemBindingSettings.DataFieldID = "UserID"
'.GroupEnabledBinding.GroupItemBindingSettings.DataFieldNodeID = "ManagerUserID"
'.GroupEnabledBinding.GroupItemBindingSettings.DataSource = oDataSet
'.GroupEnabledBinding.NodeBindingSettings.DataFieldID = "UserID"
'.GroupEnabledBinding.NodeBindingSettings.DataFieldParentID = "ManagerUserID"
'.GroupEnabledBinding.NodeBindingSettings.DataSource = oDataSet
.DataBind()
End
With
Catch
ex
As
Exception
Response.Write(ex.ToString)
Finally
oConn.Dispose()
oConn =
Nothing
oCmd =
Nothing
oData =
Nothing
oDataSet.Dispose()
oDataSet =
Nothing
oAdapter.Dispose()
oAdapter =
Nothing
End
Try
End
Sub
Protected
Sub
OrgChart_NodeDataBound(sender
As
Object
, e
As
Telerik.Web.UI.OrgChartNodeDataBoundEventArguments)
Handles
OrgChart.NodeDataBound
''e.Node.CssClass = "SmallNode"
'If e.Node.Level = 1 Then
' e.Node.Collapsed = True
'ElseIf e.Node.Level > 1 Then
' 'e.Node.Collapsed = False
'End If
e.Node.CssClass =
"Level"
& e.Node.Level
For
Each
oGroupItem
As
OrgChartGroupItem
In
e.Node.GroupItems
If
NameOnly.Checked
Then
oGroupItem.CssClass =
"SmallNodeNameOnly"
Else
oGroupItem.CssClass =
"SmallNode"
End
If
Next
End
Sub
Private
Sub
OrgChart_NodeExpandCollapse(sender
As
Object
, e
As
OrgChartNodeExpandCollapseEventArguments)
Handles
OrgChart.NodeExpandCollapse
Try
If
e.State = OrgChartNodeExpandCollapseState.NodeCollapsed
Then
For
Each
employee
As
OrgChartNode
In
e.SourceNode.Nodes
employee.Collapsed =
True
Next
End
If
Catch
ex
As
Exception
End
Try
End
Sub
Hi, we're trying to use the ASP.NET AJAX controls in our SharePoint pages as visual web parts. We've only used the RadGrid, RadComboBox & RadAjaxManager and they seem to work for the most part. We're trying to incorporate the RadScriptManager as well. We can't add it inside the web part as SharePoint throws the error "Only one instance of a ScriptManager can be added to the page". Which makes sense as the MasterPage (seattle.master) uses a ScriptManager. So, we've tried removing the ScriptManager and replace it with RadScriptManager like:
<!--SPM:<asp:ScriptManager id="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true"/>-->
to
<!--SPM:<telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true"/>-->
The <!--SPM:--> tag is used in the seattle.html because MS don't recommend you edit the seattle.master file directly in SharePoint 2013. But it throws the same error "Only one instance of a ScriptManager can be added to the page" in the ULS logs. It's like SharePoint is ignoring the RadScriptManager control.
Any thoughts?
We're using version 2018.1.117.40 of the ASP.NET AJAX controls and SharePoint 2013 (15.0.4569.1000) with the latest patches as at 2018/02/16.
Hi
Is there a way to check (boolean) if the file is pass / fail clientside validation in OnClientFileSelected?
I want to create a form which the submit button is disabled if RadAsyncUpload has files that failed at client side validation. Then enable submit button when there's no fail validation in the list (OnClientFileUploadRemoved event).
I know failed file won't appear in UploadedFiles but still, I need that validation check which boolean.
Any idea?
thanks
<
telerik:GridBoundColumn
HeaderText
=
"Message Date"
DataField
=
"messageDate"
UniqueName
=
"messageDate"
SortExpression
=
"messageDate"
ShowSortIcon
=
"false"
DataFormatString
=
"{0:MM/dd/yyyy hh:mm:ss tt}"
DataType
=
"System.DateTime"
></
telerik:GridBoundColumn
>
Hi all,
i want to have a repeated table with forms. One guy sayd, that i should use grid for this. So i want to create something like:
<grid ID="Grid1" runat="server" DataSourceID=???>
<MasterTableView DataKeyNames="fldId" DataSourceID=??? AutoGenerateColumns="False">
<form runat="server" ID=??? DataSourceID=??? DataKeyNames="fldId">
</form>
</MasterTableView >
</grid>
The form is created with fields from DB based on the fldId and i want to have repeated forms with all fldId's. I hope your can understand my idea.
Thank you in advance!
Hi,
is it possible to diable the automatic calculation of a summary task. My goal is it to have a specifiv start and end for the summary task not depending on the start and end of the child-tasks.
best regards
Thorsten