Hello, I am looking for support with the radwindowmanager and the autosize and autosize behavior properties...I've been trying to implement the same scenario as these two links:
- http://docs.telerik.com/devtools/aspnet-ajax/controls/window/troubleshooting/autosizing-issues
-http://demos.telerik.com/aspnet-ajax/window/examples/autosize/defaultcs.aspx
no luck... I always need to have a width and a height coming from the codebehind, else it only displays a small square. I am not sure if this is cause by the way the app is programmed...anyway hope somebody can jump in and help out. Thanks...here is the code driving the window:
starts here:
gui.OpenRadWindow(
url: "/Pages/Inventory/Add_Product.aspx",
width: 800,
height: 550,
title: "Add Product",
modal: true,
javascriptOnClientClose: "OnClientClose",
page: Page
);
goes to here:
public void OpenRadWindow(string url, int width, int height, string title, bool modal, WindowBehaviors behaviors, bool showDuringLoad, string javascriptOnClientClose, Page page)
{
RadWindowManager winMgr = null;
winMgr = (RadWindowManager)page.Master.FindControl("RadWindowManager_Global");
if (winMgr != null)
{
RadWindow radWindowForm = new RadWindow();
radWindowForm.ID = "radWindowForm_" + Guid.NewGuid().ToString();
radWindowForm.MinWidth = new System.Web.UI.WebControls.Unit(width,System.Web.UI.WebControls.UnitType.Pixel);
radWindowForm.MinHeight = new System.Web.UI.WebControls.Unit(height, System.Web.UI.WebControls.UnitType.Pixel);
radWindowForm.AutoSize = true;
radWindowForm.AutoSizeBehaviors = WindowAutoSizeBehaviors.Default;
radWindowForm.Title = title;
radWindowForm.Modal = modal;
radWindowForm.NavigateUrl = url;
radWindowForm.Behaviors = behaviors;
radWindowForm.EnableShadow = true;
radWindowForm.EnableTheming = true;
radWindowForm.KeepInScreenBounds = true;
radWindowForm.ShowContentDuringLoad = showDuringLoad;
radWindowForm.VisibleStatusbar = false;
radWindowForm.VisibleOnPageLoad = true;
radWindowForm.OnClientClose = javascriptOnClientClose;
winMgr.EnableViewState = false;
winMgr.Windows.Add(radWindowForm);
}
}
this is the control in master page:
<telerik:RadWindowManager ID="RadWindowManager_Global" runat="server" AutoSize="true" AutoSizeBehaviors="Default" Style="z-index: 7001" />
thanks for the support. I will add additional info if needed.
I am setting a default recurrence rule in the FormCreated event when opening an advanced insert form as described at http://docs.telerik.com/devtools/aspnet-ajax/controls/scheduler/recurrence-editor/server-side-programming/populating-the-recurrence-rule
When the Save button is clicked, I am attempting to read the recurrence rule from e.Appointment.RecurrenceRule. This always returns the default rule that I set in FormCreated, even if the user altered the recurrence settings in the form before clicking Save. If I do not set the recurrence rule in FormCreated, this returns the settings that the user chose as expected.
Is there any way to set the default recurrence settings that are shown when the form is opened and still access the user's chosen settings in the AppointmentInsert event?
Hello
My Grid
<telerik:RadGrid RenderMode=
"Lightweight"
ID=
"catGrid"
Width=
"944"
AllowPaging=
"false"
runat=
"server"
GridLines=
"None"
Skin=
"Office2010Blue"
AllowSorting=
"false"
AutoGenerateColumns=
"False"
OnNeedDataSource=
"CatGridNeedDataSource"
ShowFooter=
"false"
ShowStatusBar=
"false"
OnItemCommand=
"CatGridItemCommand"
OnItemDataBound=
"CatGridItemDataBound"
>
<MasterTableView DataKeyNames=
"ID"
ClientDataKeyNames=
"ID"
>
<Columns>
<telerik:GridCalculatedColumn DataFields=
"TestName, TestNameDetail"
Expression=
"{0}+{1}"
HeaderText=
"TEST NAME"
>
</telerik:GridCalculatedColumn>
<telerik:GridCalculatedColumn DataFields=
"Standard, StandardDetail"
Expression=
"{0}+{1}"
HeaderText=
"STANDARD"
>
</telerik:GridCalculatedColumn>
<telerik:GridBoundColumn DataField=
"Pricing"
HeaderText=
"PRICING"
DataFormatString=
"{0:c}"
HtmlEncode=
"false"
ItemStyle-HorizontalAlign=
"right"
>
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText=
"DETAIL"
UniqueName=
"DETAIL"
>
<ItemTemplate>
<telerik:RadImageButton ID=
"detailBtn"
runat=
"server"
Image-Url=
"~/App_Themes/Site/Core/DetailIcon.png"
Width=
"32"
Height=
"32"
CommandName=
"Detail"
CommandArgument=
'<%#Eval("CategoryID") +","+ Eval("Details")%>'
></telerik:RadImageButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText=
"REPORT"
UniqueName=
"REPORT"
>
<ItemTemplate>
<telerik:RadImageButton ID=
"ReportBtn"
runat=
"server"
Image-Url=
"~/App_Themes/Site/Core/Reporticon.png"
Width=
"32"
Height=
"32"
CommandName=
"Report"
Value=
"ID"
></telerik:RadImageButton>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
<ClientSettings EnableRowHoverStyle=
"true"
>
</ClientSettings>
</telerik:RadGrid>
My Code Behind
protected
void
CatGridItemDataBound(
object
sender, GridItemEventArgs e)
{
//Is it a GridDataItem
if
(e.Item
is
GridDataItem)
{
var oRow = (DataRowView) e.Item.DataItem;
var detr = (RadImageButton) oRow[
"DETAIL"
];
string
detailTF = (detr).CommandArgument.ToString();
var arg =
new
string
[2];
char
[] splitter = {
','
};
arg = detailTF.Split(splitter);
HasDetail = Convert.ToBoolean(arg);
if
(HasDetail ==
true
)
{
catGrid.MasterTableView.GetColumn(columnUniqueName:
"DETAIL"
).Display =
true
;
}
else
{
catGrid.MasterTableView.GetColumn(columnUniqueName:
"DETAIL"
).Display =
false
;
}
}
}
I am trying to get the second CommandArgument value which is true or false of the ImageButton. Once I have that value if false I want to set that row item to display.false. Currently I am receiving an error:
Unable to cast object of type 'DynamicClass1' to type 'System.Data.DataRowView'.
How can I achieve my goal?
Hello,
We use the Scheduler control in our Planning-application. This is all working nicely. However, the small "DatePicker" above the scheduler does not select the date in the Scheduler view.
I have updated the control to the newest version.
Can you please help me fix the problem?
The latest release of Google Chrome browser (v.55) had introduced changes that affect the RadPanelBarItems highlight effect when they are hovered. The issue could be overcome by changing the RenderMode of the PanelBar to Lightweight.
For more information on the Lightweight rendermode, refer to the following documentation article:
http://docs.telerik.com/devtools/aspnet-ajax/controls/panelbar/radpanelbar-items/render-modes
I am able to add custom context menus, determine which menu items have been selected and disable the ones I don't need. I need to take one step further and disable specific menu items depending upon the extension of the file selected.
I am coding everything in the OnGridContextShown function but one thing I have not been able to identify is the value of the selected item in the grid. if I can get this, I can determine whether to disable a menu item or not.
Any suggestions?
Thanks
function OnGridContextShown(sender, args) {
void Grid_ItemCommand(object source, GridCommandEventArgs e) |
{ |
if (e.CommandName == "Toggle") |
{ |
#region Toggle the database record |
/// Do some stuff, update some records |
#endregion |
Grid.Rebind(); |
} |
} |
<telerik:RadGrid ID="Grid" runat="server" AutoGenerateColumns="false" |
Width="300px" AllowMultiRowSelection="true" AllowPaging="false"> |
<SelectedItemStyle CssClass="SelectedItem"></SelectedItemStyle> |
<MasterTableView DataKeyNames="EntityId"> |
<RowIndicatorColumn Visible="False"> |
<HeaderStyle Width="20px" /> |
</RowIndicatorColumn> |
<ExpandCollapseColumn Resizable="False" Visible="False"> |
<HeaderStyle Width="20px" /> |
</ExpandCollapseColumn> |
<Columns> |
<telerik:GridBoundColumn DataField="Data" HeaderText="Data" UniqueName="Data"> |
</telerik:GridBoundColumn> |
<telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Toggle" Text="Toggle"> |
</telerik:GridButtonColumn> |
</Columns> |
<EditFormSettings> |
<PopUpSettings ScrollBars="None" /> |
</EditFormSettings> |
</MasterTableView> |
</telerik:RadGrid> |
I am databinding a DataTable to a RadGrid. The records look something like this:
Customer Name
A-Line Truck Equipment
ABC Enterprises
Airflow Systems
Airtest
Alloring
Anderson and Associates
But when this column is sorted in the grid, it appears like this:
ABC Enterprises
Airflow Systems
Airtest
A-Line Truck Equipment
Alloring
Anderson and Associates
As you can see, the hyphen is ignored in the A-Line Truck Equipment name which moves it in the list. Is there a way to prevent this?
Hi,
I am having RadListView grouped by Date. I am trying to edit/update records in RadListView. I was able to get record key value through editFormItem.GetDataKeyValue("Seq"). But unable to access the record items in either of the updateCommand or ItemCommand events. Any help , how to access the record.
Thank you.
<t:RadListView ID="rgHrs" runat="server" RenderMode="Mobile" AllowMultiFieldSorting="true"
ItemPlaceholderID="myTimeGroupContainer" DataKeyNames="Seq" AllowPaging="true"
OnNeedDataSource="rgHrs_NeedDataSource"
OnItemDataBound="rgHrs_ItemDataBound"
OnItemCommand="rgHrs_ItemCommand"
OnItemCreated="rgHrs_ItemCreated"
OnItemDeleting="rgHrs_DeleteCommand"
OnItemUpdating="rgHrs_UpdateCommand"
>
<ItemTemplate>
<div class="row">
<div class="column small-12 ">
<header> DATE </header>
<div>
<%#Eval("WORK_DT", "{0:MM/dd/yyyy}")%>
</div>
</div>
<div class="column small-12" id="wkHrsDiv" runat="server" >
<header> HOURS </header>
<div>
<%#Eval("WORK_HRS")%>
</div>
</div>
<div class="column small-12">
<header> PC </header>
<div>
<%#Eval("PAY_CODE")%>
</div>
</div>
<div class="column small-12">
<header> ST</header>
<div >
<%#Eval("ST_CODE")%>
</div>
</div>
<div class="column small-12">
<header> COMP ID </header>
<div >
<%#Eval("COMP_ID")%>
</div>
</div>
<div class="column small-12">
<header> GL ID </header>
<div >
<%#Eval("GL_ID")%>
</div>
</div>
<div class="column small-12">
<header> WORK ORDER </header>
<div>
<%#Eval("WR_ODR_NO")%>
</div>
</div>
<div class="column small-12" style="display:none"
<header> Sequence number </header>
<div>
<%#Eval("Seq")%>
</div>
</div>
</div>
<div class="row">
<div id="commentIdDiv" runat="server" class="column medium-4">
<div class="color-blue">
<header> COMMENT </header>
</div>
<div class="note">
<asp:Label ID="lblRGComment" runat="server" Text='<%# Eval("LD_COMMENT") %>' ToolTip='<%# Eval("LD_COMMENT") %>' />
</div>
</div>
<div class="column medium-4 text-right">
<asp:Button id="editButton" runat="server" ButtonType="StandardButton" CommandName="Edit"
RenderMode="Lightweight"
Text="EDIT" class="button small" >
</asp:Button>
<asp:Button id="deleteButton" runat="server" ButtonType="StandardButton" CommandName="Delete"
RenderMode="Lightweight"
Text="DELETE" class="button small" >
</asp:Button>
</div>
</div>
</ItemTemplate>
<EmptyDataTemplate>
<div class="EmptyRows">
There are no items to be displayed.
</div>
</EmptyDataTemplate>
<EditItemTemplate>
<section>
<div class="row">
<div class="column small-12 ">
<header> DATE </header>
<div>
<t:RadTextBox RenderMode="LightWeight" ID="txtWorkDt" runat="server" Text='<%#Eval("WORK_DT", "{0:MM/dd/yyyy}")%>' >
</t:RadTextBox>
</div>
</div>
<div class="column small-12" id="wkHrsDiv" runat="server" >
<header> HOURS </header>
<div>
<t:RadTextBox RenderMode="LightWeight" ID="txtWorkHrs" runat="server" Text='<%#Eval("WORK_HRS")%>'>
</t:RadTextBox>
</div>
</div>
<div class="column small-12">
<header> PC </header>
<div>
<t:RadTextBox RenderMode="LightWeight" ID="txtPayCode" runat="server" Text='<%#Eval("PAY_CODE")%>'>
</t:RadTextBox>
</div>
</div>
<div class="column small-12">
<header> ST</header>
<div >
<t:RadTextBox RenderMode="LightWeight" ID="txtStateCode" runat="server" Text='<%#Eval("ST_CODE")%>'>
</t:RadTextBox>
</div>
</div>
<div class="column small-12">
<header> COMP ID </header>
<div >
<t:RadTextBox RenderMode="LightWeight" ID="txtCompID" runat="server" Text='<%#Eval("COMP_ID")%>'>
</t:RadTextBox>
</div>
</div>
<div class="column small-12">
<header> GL ID </header>
<div >
<t:RadTextBox RenderMode="LightWeight" ID="txtGlId" runat="server" Text='<%#Eval("GL_ID")%>'>
</t:RadTextBox>
</div>
</div>
<div class="column small-12">
<header> WORK ORDER </header>
<div>
<t:RadTextBox RenderMode="LightWeight" ID="txtWorkOrder" runat="server" Text='<%#Eval("WR_ODR_NO")%>'>
</t:RadTextBox>
</div>
</div>
<div class="column small-12" style="display:none"
<header> Sequence number </header>
<div>
<t:RadTextBox RenderMode="LightWeight" ID="txtSeqMinMax" runat="server" Text='<%#Eval("Seq")%>'>
</t:RadTextBox>
</div>
</div>
</div>
<div class="row">
<div id="commentIdDiv" runat="server" class="column medium-4">
<div class="color-blue">
<header> COMMENT </header>
</div>
<div class="note">
<t:RadTextBox ID="txtRGComment" runat="server" Text='<%# Eval("LD_COMMENT") %>' ToolTip='<%# Eval("LD_COMMENT") %>'>
</t:RadTextBox>
</div>
</div>
<div class="column medium-4" >
<t:RadButton RenderMode="Lightweight" ID="btnUpdate" runat="server" Text="UPDATE" CommandName="Update">
</t:RadButton>
<t:RadButton RenderMode="Lightweight" ID="btnCancel" runat="server" Text="CANCEL" CommandName="Cancel">
</t:RadButton>
</div>
</div>
</EditItemTemplate>
<LayoutTemplate>
<ul class="accordion my-time-report" data-accordion data-allow-all-closed="true" role="tablist" data-multi-expand="true">
<asp:PlaceHolder ID="myTimeGroupContainer2" runat="server"></asp:PlaceHolder>
</ul>
</LayoutTemplate>
<GroupSeparatorTemplate>
</GroupSeparatorTemplate>
<DataGroups>
<t:ListViewDataGroup GroupField ="WORK_DT" DataGroupPlaceholderID="MyTimeGroupContainer2" SortOrder="Ascending">
<DataGroupTemplate>
<li class="accordion-item border-bottom-2x" data-accordion-item >
<a class="accordion-title" role="tab" aria-expanded="false" aira-selected="false" >
<asp:Label runat="server" ID="Label39" Text='<%# (Container as RadListViewDataGroupItem).DataGroupKey + "Daily Total Hours: " +
(Container as RadListViewDataGroupItem).AggregatesValues["WORK_HRS"].ToString() %>'>
</asp:Label>
</a>
<div class="accordion-content" data-tab-content role="tabpanel" aria-hidden="true" style="display:none;">
<asp:PlaceHolder ID="myTimeGroupContainer" runat="server"></asp:PlaceHolder>
</div>
</li>
</DataGroupTemplate>
<GroupAggregates>
<telerik:ListViewDataGroupAggregate Aggregate="Sum" DataField="WORK_HRS" />
</GroupAggregates>
</t:ListViewDataGroup>
</DataGroups>
</t:RadListView>
Backend:
protected void rgHrs_UpdateCommand(object sender, RadListViewCommandEventArgs e)
{
try
{
// unable to access through editable item record.
RadListViewEditableItem editFormItem = (RadListViewEditableItem)e.ListViewItem;
Label stxtWorkHrs = new Label();
stxtWorkHrs = (Label)editFormItem.FindControl("WORK_HRS");
--
--
--
MyTime.UpdateTimeSheet(iCompID, sEmpID, Date, Hrs, Comment, etc....); // manual update to database..
}
catch (Exception ex)
{
DataHelper.LogErrors(ex);
throw ex;
}
}