I am trying to use GridAttachemntColumn in grid with batcheditng. i tried to find out the file name in prior to store in db. but not able to do it.please find code snippet for further detail.
protected void gridProjectManagement_BatchEditCommand(object sender, GridBatchEditingEventArgs e)
{
int s = e.Commands.Count();
foreach (GridBatchEditingCommand command in e.Commands)
{
Hashtable newValues = command.NewValues;
Hashtable oldValues = command.OldValues;
//RadAsyncUpload rd = command.Item["Attachment"].Controls[0] as RadAsyncUpload;
//string file = rd.UploadedFiles[0].FileName;
//command.Item.EditManager.GetColumnEditor("Attachment")
//var gridAttachmentColumnEditor = ((GridAttachmentColumnEditor)command.Item.EditManager.GetColumnEditor("Attachment"));
//string file = gridAttachmentColumnEditor.RadUploadControl.UploadedFiles[0].GetName();
string id = (string)newValues["ID"];
//Convert.ToInt64(newValues["ID"].ToString());
// string newFirstName = newValues["PerspectiveRating"].ToString();
if (!string.IsNullOrEmpty(id))
{
var OldeItem = ListActivityArchivalSupportPM.Where(x => x.ID == Convert.ToInt32(id)).FirstOrDefault();
using (var db = new EntitiesModel())
{
var p = db.ActivityArchivalSupportPMs.Where(x => x.ID == Convert.ToInt32(id)).FirstOrDefault();
if (newValues["Estimate"] != null)
{
p.Estimate = Convert.ToDecimal(newValues["Estimate"].ToString());
}
p.Activity = (string)newValues["Activity"];
p.EstimateAssumptions = (string)newValues["EstimateAssumptions"];
p.ApplicationID = AppName.Value;
if (newValues["FileName"] != null)
{
p.Attachment = (Byte[])newValues["FileName"];
}
<
telerik:RadGrid
ID
=
"gridProjectManagement"
GridLines
=
"None"
runat
=
"server"
AllowAutomaticDeletes
=
"false"
AllowAutomaticInserts
=
"True"
AllowSorting
=
"true"
AllowFilteringByColumn
=
"true"
FilterType
=
"CheckList"
EnableLinqExpressions
=
"false"
OnItemCreated
=
"gridProjectManagement_ItemCreated"
OnPreRender
=
"gridProjectManagement_PreRender"
AllowAutomaticUpdates
=
"True"
AutoGenerateColumns
=
"False"
OnBatchEditCommand
=
"gridProjectManagement_BatchEditCommand"
OnItemCommand
=
"gridProjectManagement_ItemCommand"
OnNeedDataSource
=
"gridProjectManagement_NeedDataSource"
OnItemDataBound
=
"gridProjectManagement_ItemDataBound"
>
<
ExportSettings
ExportOnlyData
=
"true"
HideStructureColumns
=
"true"
OpenInNewWindow
=
"true"
IgnorePaging
=
"true"
><
Excel
Format
=
"Html"
/></
ExportSettings
>
<
MasterTableView
CommandItemDisplay
=
"Top"
DataKeyNames
=
"ID"
Font-Size
=
"Small"
CommandItemSettings-ShowAddNewRecordButton
=
"false"
CommandItemSettings-ShowRefreshButton
=
"false"
HorizontalAlign
=
"NotSet"
EditMode
=
"Batch"
AutoGenerateColumns
=
"False"
AllowFilteringByColumn
=
"True"
>
<
CommandItemSettings
ShowExportToCsvButton
=
"true"
ShowExportToExcelButton
=
"true"
ShowAddNewRecordButton
=
"true"
ShowExportToPdfButton
=
"true"
ShowExportToWordButton
=
"true"
/>
<
BatchEditingSettings
EditType
=
"Cell"
OpenEditingEvent
=
"Click"
/>
<%-- <
SortExpressions
>
<
telerik:GridSortExpression
FieldName
=
"PerspModel_ID"
SortOrder
=
"Descending"
/>
</
SortExpressions
>--%>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ID"
ForceExtractValue
=
"Always"
Display
=
"false"
HeaderText
=
"ID"
UniqueName
=
"ID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Activity"
AllowSorting
=
"true"
SortExpression
=
"Activity"
HeaderStyle-Width
=
"150px"
HeaderText
=
"Activity"
UniqueName
=
"Activity"
>
</
telerik:GridBoundColumn
>
<
telerik:GridNumericColumn
DataField
=
"Estimate"
HeaderStyle-Width
=
"80px"
AllowFiltering
=
"false"
AllowSorting
=
"false"
DataType
=
"System.Decimal"
DecimalDigits
=
"1"
HeaderText
=
"Estimate(hours)"
SortExpression
=
"Estimate"
UniqueName
=
"Estimate"
>
</
telerik:GridNumericColumn
>
<
telerik:GridTemplateColumn
ColumnEditorID
=
"EstimateAssumptions"
ItemStyle-CssClass
=
"breakWord120"
UniqueName
=
"EstimateAssumptions"
ItemStyle-Width
=
"100px"
AllowFiltering
=
"false"
HeaderStyle-Width
=
"150px"
HeaderText
=
"Estimate Assumptions"
>
<
ItemTemplate
>
<%# Eval("EstimateAssumptions")%>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadTextBox
ID
=
"txtEditEstimateAssumptions"
Height
=
"50px"
Wrap
=
"true"
TextMode
=
"MultiLine"
ToolTip='<%# Eval("EstimateAssumptions")%>' runat="server" Text='<%# Eval("EstimateAdjustmentRationale")%>'></
telerik:RadTextBox
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridAttachmentColumn
EditFormHeaderTextFormat
=
"Upload File:"
HeaderStyle-Width
=
"150px"
HeaderText
=
"Attachment"
AttachmentDataField
=
"Attachment"
AttachmentKeyFields
=
"ID"
FileNameTextField
=
"FileName"
DataTextField
=
"FileName"
UniqueName
=
"Attachment"
>
</
telerik:GridAttachmentColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
ScrollHeight
=
"300px"
SaveScrollPosition
=
"true"
></
Scrolling
>
<%-- <
ClientEvents
OnBatchEditOpened
=
"OnBatchEditOpened"
OnBatchEditOpening
=
"BatchEditOpening"
/>--%>
<%-- <
ClientEvents
OnCommand
=
"gridCommand"
></
ClientEvents
>--%>
</
ClientSettings
>
</
telerik:RadGrid
>
I use the recommended code for setting tile postbacks (below) and I found that it changes the inline height Css to 185px. The two screenshots show the affect, it changes the horizontal layout and the tilelist height. Project code below, screenshots attached.
<%@ Page Language="C#" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link rel="stylesheet" href="/App_Themes/Edway/Edway.css" type="text/css" />
<link rel="stylesheet" href="mypage.css" type="text/css" />
<style>
.left {
align-items: center;
}
.wideContent {
width: 290px;
height: 130px;
font-family: Segoe UI;
padding: 10px;
}
.squareContent {
width: 100px;
height: 120px;
padding: 10px;
}
.shortContent {
height: 105px;
}
.font14 {
font-size: 14px;
}
.font16 {
font-size: 16px;
}
.peekTemplateClass {
width: 120px;
height: 120px;
padding: 10px;
font-size: 13px;
line-height: 20px;
}
.feedback {
width: 120px;
height: 120px;
font-size: 13px;
line-height: 20px;
}
/* group heading tile appearance */
.groupHeadingTitle {
height: 120px;
width: 120px;
position: relative;
}
.innerTitle {
width: 120px;
height: 40px;
top: 50%;
margin-top: -20px;
position: absolute;
font-size: 17px;
line-height: 20px;
padding-left: 10px;
}
div.noHover.RadTile {
border-color: transparent;
}
/* change tile texts to better fit long names and show over the images */
.RadTile div.rtileBottomContent {
font-weight: bold;
width: auto;
max-width: 120px;
color: Black;
/* semi-transparent background like this will work in CSS3 compatible browsers */
background-color: rgba(255,255,255,0.5);
height: 20px;
line-height: 20px;
padding: 0 10px;
bottom: 10px;
}
</style>
<!-- remove this function and the layout of the tiles changes
<script type="text/javascript">
function resetAutoPostBackTile(sender, args) {
var tiles = sender.get_allTiles();
for (var i = 0; i < tiles.length; i++) {
//a default condition would be if the tile has NavigateUrl set
//you can use a custom one - e.g., the presence of a CSS class
if (tiles[i].get_navigateUrl()) {
tiles[i].set_autoPostBack(false);
}
}
}
-->
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<telerik:RadTileList ID="RadTileList1" runat="server" TileRows="1" Skin="Bootstrap" AutoPostBack="true" OnClientLoad="resetAutoPostBackTile" CssClass="left" >
<Groups>
<telerik:TileGroup>
<telerik:RadImageAndTextTile ID="RadImageAndTextTile1" runat="server" Width="120px" Height="120px" NavigateUrl="student-Program-progress.aspx" Target="_self" Text="Gradebook">
<PeekTemplate>
<div class="squareContent font14">
See your complete gradebook
</div>
</PeekTemplate>
<PeekTemplateSettings CloseDelay="6000" Animation="Fade" HidePeekTemplateOnMouseOut="true"
ShowPeekTemplateOnMouseOver="true" />
</telerik:RadImageAndTextTile>
<telerik:RadImageAndTextTile ID="RadImageAndTextTile2" runat="server" Width="120px" Height="120px" NavigateUrl="/Help/MyPage.htm" Target="_blank" Text="Help" BackColor="#f8b617">
<PeekTemplate>
<div style="background-color: #f8b617" class="squareContent font14">
See help for your homepage
</div>
</PeekTemplate>
<PeekTemplateSettings CloseDelay="6000" Animation="Fade" HidePeekTemplateOnMouseOut="true"
ShowPeekTemplateOnMouseOver="true" />
</telerik:RadImageAndTextTile>
<telerik:RadImageAndTextTile ID="TextTileProfile" Name="TextTileProfile" runat="server" Width="120px" Height="120px" NavigateUrl="/MyPage-UserInfo.aspx" Target="_blank" Text="Profile" BackColor="#f37928">
<PeekTemplate>
<div style="background-color: #f37928" class="squareContent font14">
Update your password
</div>
</PeekTemplate>
<PeekTemplateSettings CloseDelay="6000" Animation="Fade" HidePeekTemplateOnMouseOut="true"
ShowPeekTemplateOnMouseOver="true" />
</telerik:RadImageAndTextTile>
<telerik:RadImageAndTextTile ID="tileLogout" runat="server" Width="120px" Height="120px" Text="Logout" BackColor="#03953f" AutoPostBack="true">
<PeekTemplate>
<div style="background-color: #03953f" class="squareContent font14">
Logout
</div>
</PeekTemplate>
<PeekTemplateSettings CloseDelay="6000" Animation="Fade" HidePeekTemplateOnMouseOut="true"
ShowPeekTemplateOnMouseOver="true" />
</telerik:RadImageAndTextTile>
</telerik:TileGroup>
</Groups>
</telerik:RadTileList>
<telerik:RadTileList ID="RadTileList2" runat="server" TileRows="1" Skin="Bootstrap" AutoPostBack="true" OnClientLoad="resetAutoPostBackTile" CssClass="left" >
<Groups>
<telerik:TileGroup>
<telerik:RadImageAndTextTile ID="RadImageAndTextTile3" runat="server" Width="120px" Height="120px" NavigateUrl="student-Program-progress.aspx" Target="_self" Text="Gradebook">
<PeekTemplate>
<div class="squareContent font14">
See your complete gradebook
</div>
</PeekTemplate>
<PeekTemplateSettings CloseDelay="6000" Animation="Fade" HidePeekTemplateOnMouseOut="true"
ShowPeekTemplateOnMouseOver="true" />
</telerik:RadImageAndTextTile>
<telerik:RadImageAndTextTile ID="RadImageAndTextTile4" runat="server" Width="120px" Height="120px" NavigateUrl="/Help/MyPage.htm" Target="_blank" Text="Help" BackColor="#f8b617">
<PeekTemplate>
<div style="background-color: #f8b617" class="squareContent font14">
See help for your homepage
</div>
</PeekTemplate>
<PeekTemplateSettings CloseDelay="6000" Animation="Fade" HidePeekTemplateOnMouseOut="true"
ShowPeekTemplateOnMouseOver="true" />
</telerik:RadImageAndTextTile>
<telerik:RadImageAndTextTile ID="RadImageAndTextTile5" Name="TextTileProfile" runat="server" Width="120px" Height="120px" NavigateUrl="/MyPage-UserInfo.aspx" Target="_blank" Text="Profile" BackColor="#f37928">
<PeekTemplate>
<div style="background-color: #f37928" class="squareContent font14">
Update your password
</div>
</PeekTemplate>
<PeekTemplateSettings CloseDelay="6000" Animation="Fade" HidePeekTemplateOnMouseOut="true"
ShowPeekTemplateOnMouseOver="true" />
</telerik:RadImageAndTextTile>
<telerik:RadImageAndTextTile ID="RadImageAndTextTile6" runat="server" Width="120px" Height="120px" Text="Logout" BackColor="#03953f" AutoPostBack="true">
<PeekTemplate>
<div style="background-color: #03953f" class="squareContent font14">
Logout
</div>
</PeekTemplate>
<PeekTemplateSettings CloseDelay="6000" Animation="Fade" HidePeekTemplateOnMouseOut="true"
ShowPeekTemplateOnMouseOver="true" />
</telerik:RadImageAndTextTile>
</telerik:TileGroup>
</Groups>
</telerik:RadTileList>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
</form>
</body>
</html>
Hello,
I am attempting to display aggregate sums of groups in group headers in my RadGrid. I have attempted to use the instructions in the following article: http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/functionality/grouping/how-to/aligning-items-in-groupheader
My issue is due to the fact that I am using multiple levels of grouping. I am not sure why, but when I use the code in the article mentioned above, the entries in my group headers become misaligned as shown in the attached image. In the picture shown, my goal is to have the 10,000's be lined up no matter which level of grouping they are in, and to have the product names behave as they would be normally. Is there any easier way to display group totals for each column in the group headers? If not, is there some modification that can be made to the code in the help article that will ensure that the header items are aligned in each level of group headers? Thanks
Can the Radpivotgrid make use of the pivot commands in SQL to have the SQL system handle the summary processing?
For example the SQL script below seemed to not format correctly in the pivotgrid
create table Report
(
deck char(3),
Jib_in float,
rev float,
rev_insight float,
jib_out float,
creation float
)
insert into Report values
('A_1',0.345,0,0,1.23,20140212),
('B_2',0.456,0,4,2.34,20140215),
('C_3',0.554,0,6,0.45,20140217),
('D_4',0.231,0,8,7.98,20140222),
('E_5',0.453,0,0,5.67,20140219),
('F_6',0.344,0,3,7.23,20140223)
SELECT HEADER, [A_1],[B_2],[C_3],[D_4],[E_5],[F_6]
FROM
(SELECT DECK,HEADER, VALUE FROM REPORT
UNPIVOT
(
VALUE FOR HEADER IN ([JIB_IN],[REV_INSIGHT],[JIB_OUT],[CREATION])
) UNPIV
) SRC
PIVOT
(
SUM(VALUE)
FOR DECK IN ([A_1],[B_2],[C_3],[D_4],[E_5],[F_6])
) PIV
Hi,
I am trying to make some changes to the default appearance of RadAsyncUpload control. However I am unable to change the appearance. Basically I want to hide the Green dot icon which shows if file uploaded successfully or not and the Change the Red cross icon which shows along with the Remove option.(Please check the attached image for more details). I have tried with the below css style and unfortunately it didn't work. Could you please help me.
<style>
div.RadUpload .ruRemove
{
background-image
:
url
(
'/Images/DeleteImage.png'
)
!important
;
background-position
:
-2px
0px
;
width
:
50px
;
height
:
14px
;
}
</style>
Hi,
I want to show screenshot of Doc/Pdf files instead of the default icon on the file Explorer in Thumbnails View.
The screen shot is located on my machine and I have multiple files. So for every file, screenshot will be different.
Is there a way I can replace the default icon ?
Thanks
Hi All,
I'm having issues with the this Col.
I can't get the selectvalue to fire up.
Please can you assist.
<telerik:GridDropDownColumn DataField="AstSeriesID" ListTextField ="Name" ListValueField="Id" DataSourceID="AssetSeries" HeaderText ="Asset Series"
UniqueName="AssetSeries" DropDownControlType ="RadComboBox" EnableEmptyListItem="True" EmptyListItemValue=" " EmptyListItemText="<Add New Seies>">
</telerik:GridDropDownColumn>
Kind Regards,
Liz