Hey!
I want to remove the PageView of a tab and give the tab a new PageView. Currently I'm doing it like this:
// Delete PageView from tab
RadTab tabToReset = TabStripBookings.FindTab(t => Convert.ToInt32(t.Attributes[
"bookingId"
]) == bookingId);
if
(tabToReset ==
null
)
{
System.Diagnostics.Debug.WriteLine($
"Tab with booking id {bookingId} not found."
);
return
;
}
// Remove old PageView
MultiPageBookings.PageViews.Remove(tabToReset.PageView);
// Add new PageView to tab
AddPageView(tabToReset);
The "AddPageView" Method looks like this:
RadPageView pageView =
new
RadPageView();
pageView.ID =
"PageView_"
+ tab.Attributes[
"bookingId"
] ;
// set the id of the pageview depending on the booking ID (0 for new booking)
pageView.CssClass =
"contentWrapper"
+ tab.Index;
pageView.Attributes.Add(
"bookingId"
, tab.Attributes[
"bookingId"
]);
pageView.Attributes.Add(
"day"
, tab.Attributes[
"day"
]);
tab.PageViewID = pageView.ID;
MultiPageBookings.PageViews.Add(pageView);
And finally my PageViewCreated Event:
BookingControl userControl = (BookingControl) Page.LoadControl(
"BookingControl.ascx"
);
// PageView ID is: PageView_BookingId -> split in PageView & BookingId
// Set UserControl id to UserControl_BookingId
userControl.ID =
"UserControl_"
+ e.PageView.ID.ToString().Split(
'_'
)[1];
userControl.BookingDeleted += UserControl_BookingDeleted;
// Subscribe to event when a booking is deleted
userControl.FormReset += UserControl_FormReset;
// Subscribe to event when the form shall be reseted
if
(e.PageView.HasAttributes)
{
userControl.ValuesSet =
true
;
userControl.BookingId = Convert.ToInt32(e.PageView.Attributes[
"bookingId"
]);
userControl.SelectedDay = DateTime.ParseExact(e.PageView.Attributes[
"day"
],
"dd.MM.yyyy"
,
null
);
}
e.PageView.Controls.Add(userControl);
How it shall work:
The first method is called via an event. The MultiPage should be removed and a new one (basically the same one as before, but freshly initialized from the database) is added to the MultiPage.
What it actually does:
At first I don't see the new Tab where it should be. Instead the content of the next tab is shown, but when I switch to another tab and then switch back, the correct PageView is shown.
Is there any solution for this problem? Am I missing something? Can I maybe tell the TabStrip to reload its PageView?
Greetings
Felix
I use RadEditor in MasterPage and Delete button is disabled into ImageManager. I have ViewPaths, UploadPaths, and DeletePaths in server side.
Se attached image....
I get error:
Message
System.Web.HttpException (0x80004005): This is an invalid webresource request.
at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
<telerik:RadEditor ID=
"RadEditor1"
RenderMode=
"Lightweight"
Culture=
"sv-SE"
StripFormattingOptions=
"All"
ContentAreaMode=
"Div"
ToolsFile=
"~/medlemsidor/minsida/presentation/Toolbar.xml"
ExternalDialogsPath=
"~/EditorDialogs/"
Width=
"578px"
Height=
"400px"
EditModes=
"Design"
MaxHtmlLength=
"8000"
runat=
"server"
/>
RadEditor1.ImageManager.MaxUploadFileSize =
"10485760"
RadEditor1.ImageManager.SearchPatterns =
New
String
() {
"*.jpg"
,
"*.png"
,
"*.gif"
}
RadEditor1.ImageManager.ViewPaths =
New
String
() {
"~/medlemsidor/pressbilder/"
& UserFolder &
"/bilder/"
}
RadEditor1.ImageManager.UploadPaths =
New
String
() {
"~/medlemsidor/pressbilder/"
& UserFolder &
"/bilder/"
}
RadEditor1.ImageManager.DeletePaths =
New
String
() {
"~/medlemsidor/pressbilder/"
& UserFolder &
"/bilder/"
}
RadEditor1.ImageManager.EnableAsyncUpload =
True
RadEditor1.ImageManager.ContentProviderTypeName =
GetType
(ChangeImageSizeProvider).AssemblyQualifiedName
Hi, I am using the built-in Excel exporting feature, but sometimes I get this error
We found a problem with this formula. Try clicking Insert Function on the Formulas tab to fix it.\n\nNot trying to type a formula? When the first character is an equal (=) or minus (-) sign, RadSpreadsheet thinks it is a formula. For example, when you type =1+1 the cell shows 2.
Since the cells content depend on the database, I cannot be sure there are no formula-like characters in some cells.
How can I catch this exception? Or, better yet, how can I manipulate the data in order for the Excel exporting to not complain?
Thanks
Luca
I am using a custom class as the DataSource for a radgrid. My class has a structure like this (greatly simplified).
public
class
Batch
{
public
Batch() { }
public
int
BatchID {
get
;
set
; }
public
string
FirstName {
get
;
set
; }
public
string
MiddleName {
get
;
set
; }
public
string
LastName {
get
;
set
; }
public
DateTime BatchDate {
get
;
set
; }
public
List<Payment> Payments {
get
;
set
; }
}
public
class
Payment
{
public
Payment() { }
public
int
PaymentID {
get
;
set
; }
public
string
CheckNumber {
get
;
set
; }
public
decimal
Amount {
get
;
set
; }
}
My grid is defined like this.
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
>
<
mastertableview
datakeynames
=
"BatchID"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"FirstName"
HeaderText
=
"First Name"
UniqueName
=
"gbcFirstName"
/>
<
telerik:GridBoundColumn
DataField
=
"MiddleName"
HeaderText
=
"Middle Name"
UniqueName
=
"gbcMiddleName"
/>
<
telerik:GridBoundColumn
DataField
=
"LastName"
HeaderText
=
"Last Name"
UniqueName
=
"gbcLastName"
/>
<
telerik:GridBoundColumn
DataField
=
"BatchDate"
HeaderText
=
"Batch Date"
UniqueName
=
"gbcBatchDate"
/>
</
Columns
>
<
DetailTables
>
<
telerik:GridTableView
runat
=
"server"
HierarchyLoadMode
=
"ServerBind"
Name
=
"gtvPayments"
DataKeyNames
=
"Payments.BatchID"
>
<
ParentTableRelation
>
<
telerik:GridRelationFields
MasterKeyField
=
"BatchID"
DetailKeyField
=
"Payments.BatchID"
/>
</
ParentTableRelation
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Payments.CheckNumber"
HeaderText
=
"Check Number"
UniqueName
=
"gbcCheckNumber"
/>
<
telerik:GridNumericColumn
DataField
=
"Payments.Amount"
HeaderText
=
"Amount"
UniqueName
=
"gncAmount"
/>
</
Columns
>
</
telerik:GridTableView
>
</
DetailTables
>
</
mastertableview
>
</
telerik:RadGrid
>
I assign the datasource to the grid in the NeedDataSource event.
void
RadGrid1_NeedDataSource(
object
sender, GridNeedDataSourceEventArgs e)
{
List<Batch> batch =
new
List<Batch>(1500);
RadGrid1.DataSource = batch;
}
Since each row in the master table datasource contains a list of its detail items is it possible to create a Master/Detail grid relationship directly from this or do I need to do something in the DetailTableDataBind event?
Thanks
Hi,
I have got the zip file of Telerik_UI_for_ASP.NET_AJAX_2016 zip file from my client, I have extracted this zip file on c://ProgramFiles(x86)/Telerik folder and created one asp.net application in c# visual studio 2015 and added the reference to Telerik.web.dll located in above location but after compiling the application it is giving me an error as "Could not load file or assembly 'Telerik.Web.UI, Version=2016.1.113.45, Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)" .
please let me know can I use Telerik tool kit from zip file? or do I have to install the telerik tool kit on development server ?
I have a Grid with link buttons inside of template fields. This grid is created after various drop down selections are made. Once a link button is clicked from inside this "Master" grid, information from that button gets passed to a SQL query to populate a second Grid that is contained within a ModalPopupExtender. When this grid is databound I would like to resize all the columns to fit the contents. I have found this on this site: http://www.telerik.com/forums/radgrid-columns-width-fit-the-content-of-the-columns
However, my grid is not bound on pageLoad. How can I get my "Pop Up" grid to set columns to autowidth when it is bound after the link button click from the "Master" grid? The Grid is bound to a datatable that is returned from a stored procedure and then the ModalPopupExtender is called with mpe.Show(); . At present I am setting the width of the grid and all the bound columns to get the desired look. I have many more grids to populate on this page in similar ModalPopupExtender's. I would hate to have to set the width's for all grids.
Here is the aspx code for the MPE and RadGrid:
<
input
id
=
"hidden4"
type
=
"hidden"
name
=
"hddclick"
runat
=
"server"
/>
<
ajaxToolkit:ModalPopupExtender
ID
=
"mpIRH"
runat
=
"server"
PopupControlID
=
"pnlIRH"
TargetControlID
=
"hidden4"
CancelControlID
=
"lbIRHClose"
BackgroundCssClass
=
"modalBackground"
/>
<
asp:Panel
ID
=
"pnlIRH"
runat
=
"server"
CssClass
=
"modalPopup"
HorizontalAlign
=
"Center"
Style
=
"display: none;"
>
<
h1
class
=
"bold"
>Invoice Reg Hours</
h1
>
<
asp:Panel
ID
=
"Panel5"
runat
=
"server"
CssClass
=
"inputSet"
>
<
span
>Labor Code:</
span
>
<
asp:Label
ID
=
"pnlIRH_lblLC"
runat
=
"server"
/>
</
asp:Panel
>
<
asp:Panel
ID
=
"Panel6"
runat
=
"server"
CssClass
=
"inputSet"
>
<
span
>ROM:</
span
>
<
asp:Label
ID
=
"pnlIRH_lblROM"
runat
=
"server"
/>
</
asp:Panel
>
<
asp:UpdatePanel
ID
=
"pnlIRH_UP"
runat
=
"server"
UpdateMode
=
"Conditional"
AssociatedUpdatePanelID
=
"updateProgress"
>
<
ContentTemplate
>
<
telerik:RadGrid
ID
=
"pnlIRH_RadGrid"
runat
=
"server"
RenderMode
=
"Lightweight"
CssClass
=
"box_shadow round-corners AddBorders"
AllowPaging
=
"false"
AllowSorting
=
"true"
CellSpacing
=
"0"
GridLines
=
"None"
ClientSettings-Scrolling-AllowScroll
=
"true"
ClientSettings-Scrolling-UseStaticHeaders
=
"true"
ClientSettings-Resizing-AllowColumnResize
=
"true"
ClientSettings-AllowColumnsReorder
=
"true"
ClientSettings-Animation-AllowColumnReorderAnimation
=
"true"
HeaderStyle-HorizontalAlign
=
"Center"
HeaderStyle-Font-Size
=
"8pt"
MasterTableView-TableLayout
=
"auto"
Width
=
"825px"
AlternatingItemStyle-HorizontalAlign
=
"Center"
ItemStyle-HorizontalAlign
=
"Center"
ClientSettings-ReorderColumnsOnClient
=
"true"
ClientSettings-Animation-ColumnReorderAnimationDuration
=
"1"
AlternatingItemStyle-Font-Bold
=
"true"
ItemStyle-Font-Bold
=
"true"
>
<
ClientSettings
>
<
Resizing
AllowColumnResize
=
"true"
ResizeGridOnColumnResize
=
"true"
AllowResizeToFit
=
"true"
/>
</
ClientSettings
>
<
MasterTableView
AutoGenerateColumns
=
"false"
AllowMultiColumnSorting
=
"true"
>
<
Columns
>
<
telerik:GridBoundColumn
HeaderText
=
"Payroll"
DataField
=
"Payroll"
SortExpression
=
"Payroll"
ItemStyle-Width
=
"55px"
HeaderStyle-Width
=
"55px"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Employee"
DataField
=
"Employee"
SortExpression
=
"Employee"
/>
<
telerik:GridBoundColumn
HeaderText
=
"PLC"
DataField
=
"PLC"
SortExpression
=
"PLC"
ItemStyle-Width
=
"55px"
HeaderStyle-Width
=
"55px"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Week Ending"
DataField
=
"Weekending"
SortExpression
=
"Weekending"
DataFormatString
=
"{0:MM/dd/yyyy}"
ItemStyle-Width
=
"55px"
HeaderStyle-Width
=
"95px"
/>
<
telerik:GridBoundColumn
HeaderText
=
"WO Number"
DataField
=
"WO Number"
SortExpression
=
"WO_Number"
ItemStyle-Width
=
"55px"
HeaderStyle-Width
=
"130px"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Fri"
DataField
=
"Fri"
SortExpression
=
"Fri"
ItemStyle-CssClass
=
"width1"
HeaderStyle-CssClass
=
"width1"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Sat"
DataField
=
"Sat"
SortExpression
=
"Sat"
ItemStyle-CssClass
=
"width1"
HeaderStyle-CssClass
=
"width1"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Sun"
DataField
=
"Sun"
SortExpression
=
"Sun"
ItemStyle-CssClass
=
"width1"
HeaderStyle-CssClass
=
"width1"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Mon"
DataField
=
"Mon"
SortExpression
=
"Mon"
ItemStyle-CssClass
=
"width1"
HeaderStyle-CssClass
=
"width1"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Tue"
DataField
=
"Tue"
SortExpression
=
"Tue"
ItemStyle-CssClass
=
"width1"
HeaderStyle-CssClass
=
"width1"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Wed"
DataField
=
"Wed"
SortExpression
=
"Wed"
ItemStyle-CssClass
=
"width1"
HeaderStyle-CssClass
=
"width1"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Thu"
DataField
=
"Thu"
SortExpression
=
"Thu"
ItemStyle-CssClass
=
"width1"
HeaderStyle-CssClass
=
"width1"
/>
<
telerik:GridBoundColumn
HeaderText
=
"Total"
DataField
=
"Total"
SortExpression
=
"Total"
ItemStyle-CssClass
=
"width2"
HeaderStyle-CssClass
=
"width2"
/>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
</
ContentTemplate
>
</
asp:UpdatePanel
>
<
br
/>
<
asp:LinkButton
ID
=
"lbIRHClose"
runat
=
"server"
class
=
"button icon fa-info-sign"
Style
=
"cursor: pointer;"
Text
=
"Close"
/>
</
asp:Panel
>
Here is the all the CSS code that is called:
div.RadGrid .rgRow td,
div.RadGrid .rgAltRow td {
padding: 0px;
}
.modalBackground {
background-color: Black;
filter: alpha(opacity=90);
opacity: 0.8;
}
.modalPopup {
background-color: #FFFFFF;
border-width: 3px;
border-style: solid;
border-color: black;
padding: 10px;
width: auto;
height: auto;
max-width: 90%;
}
.width1 {
width: 35px;
}
.width2 {
width: 50px;
}
/* Add vertical lines to RadGrid */
div.AddBorders .rgHeader:first-child,
div.AddBorders th.rgResizeCol:first-child,
div.AddBorders .rgFilterRow td:first-child,
div.AddBorders .rgRow td:first-child,
div.AddBorders .rgAltRow td:first-child,
div.AddBorders .rgEditRow td:first-child,
div.AddBorders .rgFooter td:first-child
{
border-left-width:0;
}
div.AddBorders .rgHeader,
div.AddBorders th.rgResizeCol,
div.AddBorders .rgFilterRow td,
div.AddBorders .rgRow td,
div.AddBorders .rgAltRow td,
div.AddBorders .rgEditRow td,
div.AddBorders .rgFooter td
{
border-style:solid;
border-color:#aaa;
border-width:0 0 1px 1px; /*top right bottom left*/
}
I have a column chart with two series.
One is very important and the other is more just added information.
I would like to make column 2 with the extra information smaller in width than series 1.
This is so its visually obvious this is the main data.
How do you do this? If its not possible, do you have any suggestions?
Thanks,
RadAsyncUpload control works great when in debug mode.
When i deploy the same on my server, the documents always have the red dot next to the document.
They are not saved to the database.
Am i missing any property/setting here?
Thanks in Advance.