<%@ Register TagPrefix="ajax" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %> |
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2009.1.402.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %> |
<ajax:ScriptManagerProxy ID="sm" runat="server"> |
<Scripts> |
<ajax:ScriptReference Path="/_layouts/VMMA.Intranet/js/ProgramSheet.js" /> |
</Scripts> |
</ajax:ScriptManagerProxy> |
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" |
DefaultLoadingPanelID="RadAjaxLoadingPanel1"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="RadGridActualsPlanning"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="pnlActualsPlanning" |
LoadingPanelID="RadAjaxLoadingPanel1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
<telerik:AjaxSetting AjaxControlID="rgInvoice"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="pnlActualsPlanning" |
LoadingPanelID="RadAjaxLoadingPanel1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |
<asp:Panel ID="pnlActualsPlanning" runat="server" Visible="false"> |
<h3> |
<asp:Label ID="lblActualsPlanning" runat="server"></asp:Label></h3> |
<telerik:RadGrid ID="RadGridActualsPlanning" runat="server" AllowFilteringByColumn="true" |
AllowPaging="true" Width="760px" AllowSorting="true" AllowColumnsReorder="True" |
PagerStyle-AlwaysVisible="true"> |
<ClientSettings Scrolling-AllowScroll="true" Scrolling-ScrollHeight="100%" Scrolling-UseStaticHeaders="true" |
Scrolling-FrozenColumnsCount="2" Resizing-AllowColumnResize="True"> |
</ClientSettings> |
<ExportSettings Pdf-PaperSize="A4" Pdf-PageWidth="21cm" Pdf-PageHeight="29cm"> |
</ExportSettings> |
<PagerStyle LastPageToolTip="Laatste Pagina" NextPagesToolTip="Volgende Pagina's" |
NextPageToolTip="Volgende Pagina" PrevPagesToolTip="Vorige Pagina's" PrevPageToolTip="Vorige Pagina" |
PagerTextFormat="{4} Pagina <strong>{0}</strong> van <strong>{1}</strong>, item <strong>{2}</strong> tot <strong>{3}</strong> van de <strong>{5}</strong>." |
FirstPageToolTip="Eerste Pagina" /> |
<StatusBarSettings LoadingText="Wordt geladen..." ReadyText="Klaar" /> |
<MasterTableView AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"> |
<Columns> |
<telerik:GridBoundColumn DataField="ProductRightsID" SortExpression="ProductRightsID" |
HeaderText="BillieID" /> |
<telerik:GridBoundColumn DataField="programmatitel" SortExpression="programmatitel" |
HeaderText="programmatitel" /> |
<telerik:GridBoundColumn DataField="productiejaar" SortExpression="productiejaar" |
HeaderText="productiejaar" /> |
<telerik:GridBoundColumn DataField="jaargang" SortExpression="jaargang" HeaderText="jaargang" /> |
<telerik:GridBoundColumn DataField="episodeTitel" SortExpression="episodeTitel" HeaderText="episodeTitel" /> |
<telerik:GridBoundColumn DataField="zender" SortExpression="zender" HeaderText="zender" /> |
<telerik:GridBoundColumn DataField="uitzenddag" SortExpression="uitzenddag" HeaderText="uitzenddag" /> |
<telerik:GridBoundColumn DataField="uitzenduur" HeaderText="uitzenduur" /> |
</Columns> |
</MasterTableView> |
</telerik:RadGrid> |
</asp:Panel> |
I am trying to dynamically populate a Telerik Radmenu control in my code behind. I'm having a really hard time with it.
I have the following code that I get a list of categories from and save to a Session Variable.
protected void createFilter(int categoryid)
{
// check cateogyrid
//get list of proudct id
List<int> productIds = new List<int>();
DataRow[] productRow = CategoriesProductsData.Tables["Products"].Select("Category_ID = " + 573);
productIds = productRow.Select(p => int.Parse(p["Product_ID"].ToString())).ToList();
//get attributes
ITCProductService pService = new TCProductServiceClient();
var productTuples = (pService.GetProductsAttributes(productIds));
List<Tuple<int, CustomAttribute>> customAttributes = new List<Tuple<int,CustomAttribute>>();
foreach(var productTuple in productTuples)
{
foreach(var attributeTuple in productTuple.m_Item2)
{
var customAttribute = new Tuple<int, CustomAttribute>(productTuple.m_Item1, new CustomAttribute(attributeTuple));
customAttributes.Add(customAttribute);
}
}
List<CustomAttributeCategory> categories = new List<CustomAttributeCategory>();
var categoryTuples = customAttributes.Select(a => a.Item2).Select(a => a.Attribute.Category).Distinct();
foreach (var categoryTuple in categoryTuples)
{
var category = new CustomAttributeCategory(categoryTuple);
var attributeByCategory = customAttributes.Select(a => a.Item2).Where(b => b.Attribute.CategoryId == categoryTuple.AttributeCategoryId).Distinct();
foreach (var attributeTuple in attributeByCategory)
{
var attribute = new CustomAttribute(attributeTuple.Attribute);
var attributeProductIds = customAttributes.Where(a => a.Item2.Attribute.AttributeId == attributeTuple.Attribute.AttributeId).Select(a => a.Item1).ToList();
attribute.ProductIds = attributeProductIds;
category.Attributes.Add(attribute);
}
categories.Add(category);
}
Session["filter"] = categories.ToString();
}
public class CustomAttributeCategory
{
public AttributeCategoryModel Category { get; set; }
public List<CustomAttribute> Attributes { get; set; }
public CustomAttributeCategory(AttributeCategoryModel category)
{
Category = category;
Attributes = new List<CustomAttribute>();
}
}
public class CustomAttribute
{
public AttributeModel Attribute { get; set; }
public List<int> ProductIds { get; set; }
public CustomAttribute(AttributeModel attribute)
{
Attribute = attribute;
ProductIds = new List<int>();
}
}
Then I try to add the categories to the menu with this code:
protected void handsetMenu_ItemDataBound(object sender, RadMenuEventArgs e)
{
var categories = Session["filter"].ToString();
foreach (var category in categories)
{
var item = new RadMenuItem(categories);
handsetMenu.Items.Add(item);
}
}
It's not working. I know I'm missing something from my HTML to bind the control, but I'm not even sure if the code in my code behind is working. Here's the control:
<telerik:RadMenu ID="handsetMenu" runat="server" ShowToggleHandle="true" OnItemDataBound="handsetMenu_ItemDataBound">
<Items>
<telerik:RadMenuItem Text="Here">
<Items>
</Items>
</telerik:RadMenuItem>
</Items>
</telerik:RadMenu>
I am really lost if anyone could help me that'd be great.
Hi Telerik Team,
I have created sample application using Rad file explorer.Im storing values as bytes in database table when user click on the download im downloading the files. my problem in case Mainfolder the values are assigned directly from database no prblm but while create subfolder under the Mainfolder im facing problem in database the value is inserting but while bind the values not binding.
here the code.
I am converting one of the controls on our page, from being a RadComboBox to a RadDropDownTree, as the page (read control) is a filter page, the values are no populated until the user clicks on them. When a web service is called. This method just saves on processing and page size, for functionality that is rarely used
We have previously used OnClientItemsRequested (on the combo box) to pass client specific data to the webservice, however this doesn't appear to be possible on the DropDownTree, I've tried using OnClientDropDownOpening but this doesn't appear to have access to the context
function RequestingContractCategories(sender, eventArgs) {
var context = eventArgs.get_context();
var companyCode = $find(FilterCompanyId).get_value();
}
I note in all your examples that the webservice signature has a context, and ours when called has a value ... just 0 length, with no children
Hi,
Am using RadScheduler with RadSchedulerContextMenu . ​Now the menus are showing when we right click the appointment . I need to show the menu on single click instead of right click. How this would be possible please?
Code-------------
<telerik:RadScheduler runat="server" ID="RegScheduler" CssClass="RegScheduler" SelectedView="MonthView" Height="565px"
AllowDelete="false" AppointmentStyleMode="Default" TimelineView-UserSelectable="false"
CustomAttributeNames="EventStatus,Recurrence" StartInsertingInAdvancedForm="True"
EnableCustomAttributeEditing="True" EnableExactTimeRendering="True" EnableResourceEditing="False"
AdvancedForm-EnableCustomAttributeEditing="True" AllowEdit="true" AllowInsert="true"
OnClientAppointmentsPopulating="appointmentsPopulating" OnClientAppointmentsPopulated="appointmentsPopulated"
OnClientDataBound="clientDataBound"
OnClientAppointmentContextMenuItemClicked="appointmentContextMenu"
OnClientAppointmentWebServiceInserting="appointmentInserting" OnClientRequestSuccess="clientRequestSuccess"
OnClientAppointmentInserting="clientappointmentInserting" OnClientAppointmentEditing="clientappointmentEditing"
OnClientAppointmentWebServiceUpdating="appointmentWebserviceEditing" OnClientAppointmentMoveStart="onClientAppointmentMoveStart"
OnClientAppointmentResizeStart="onClientAppointmentResizeStart" OnClientTimeSlotContextMenuItemClicking="onClientTimeSlotContextMenuItemClicking" >
<AdvancedForm Modal="true" />
<WebServiceSettings Path="Controls/Registration/Calendar/SchedulerWcfService.svc" />
<TimelineView UserSelectable="False" />
<WeekView EnableExactTimeRendering="True" />
<DayView EnableExactTimeRendering="True" WorkDayEndTime="18:00:00" WorkDayStartTime="06:00:00" />
<MonthView VisibleAppointmentsPerDay="3" />
<AppointmentContextMenus>
<telerik:RadSchedulerContextMenu runat="server" ID="SchedulerAppointmentContextMenu" >
<Items>
<telerik:RadMenuItem Text="Edit" Value="Edit">
</telerik:RadMenuItem>
<telerik:RadMenuItem Text="Delete" Value="Delete">
</telerik:RadMenuItem>
<telerik:RadMenuItem Text="View Registrants" Value="ViewRegistrants">
</telerik:RadMenuItem>
<telerik:RadMenuItem Text="Add Registrant" Value="AddRegistrants">
</telerik:RadMenuItem>
<telerik:RadMenuItem Text="Add Registrants" Value="AddBulkRegistrants">
</telerik:RadMenuItem>
</Items>
</telerik:RadSchedulerContextMenu>
</AppointmentContextMenus>
<TimeSlotContextMenus>
<telerik:RadSchedulerContextMenu runat="server" ID="SchedulerTimeSlotContextMenu">
<Items>
<telerik:RadMenuItem Text="New" Value="CommandAddAppointment" />
</Items>
</telerik:RadSchedulerContextMenu>
</TimeSlotContextMenus>
</telerik:RadScheduler>​
Regards,
Matthew
Hello,
New to RadGrid and all the fancy feature that are implemented out of the box. One that I found very helpful is the column filter. I am using the filter with a linqdatasource for the grid datasource. The filter is implemented using :
AllowFilteringByColumn="True"
Column are specified like this:
<
telerik:GridBoundColumn
DataField
=
"App.First"
DataType
=
"System.String"
FilterControlAltText
=
"Filter"
HeaderText
=
"First Name"
CurrentFilterFunction
=
"Contains"
FilterDelay
=
"2000"
ShowFilterIcon
=
"false"
AutoPostBackOnFilter
=
"true"
></
telerik:GridBoundColumn
>
This basic implementation does work on my development environment. However, once I compile and publish this project to my production server, the filters stop working. Watching the browser console I can see ​these errors happen when the filter is used on the production site:
TypeError: $find(...) is null bookingmgr:1:0
SyntaxError: unreachable code after return statement bookingmgr:1:13
TypeError: $find(...) is null
It seems as if the functions and or telerik library use to implement the filter function are coming over when I publish the project. Any ideas as to why this is?
Thanks,
Bryan
I am setting up an upload form to allow a user to upload/crop/resize an image and save it to our server. Things work great except I don't want the save dialog. I want to save it to the specific location without them having to enter things. The saving it is not an issue. I have that working now. I just need to know how to eliminate the save dialog box that pops up when you click the toolbar save button?
I have looked through many articles but cannot find one that pertains just to this. Can I use a separate button outside of the editor and still get the cropped/resized image info?
I have a RadGrid and a RadComboBox outside of RadGrid (say comboOutside), inside a Web Form.
Inside RadGrid, there is 1 more RadComboBox (say comboRadGrid). On selection of items from comboOutside, comboRadGrid is bind i.e., If item 'Company' is selected from comboOutside, then all the company names will be bind in comboRadGrid; and then user select specific company from comboRadGrid and records are added in RadGrid.
For all items, functionality is working fine but I am facing issue in binding of a specific comboOutside item. i.e., When I choose a specific item from comboOutside, say I have 100 items inside comboOutside, and when I select 35th items from it, then comboRadGrid always throw this error while binding records for 35th item (since 35th item has 2000+ records to bind in comboRadGrid)
Error is attached below:
Funcitonality is working fine for all the items except 1 specific item of RadComboBox. I don't understand why. Due to this I am unable to add records in RadGrid
Below is my code-
C# code​
public
DataTable GetAccCode(
string
CompanyCode)
{
SqlConnection con =
new
SqlConnection(strcon);
SqlCommand cmd =
new
SqlCommand(
"[Invoice].[usp_tbl_AccountCode_DL_Test]"
, con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(
"@CompanyCode"
, CompanyCode);
SqlDataAdapter da =
new
SqlDataAdapter(cmd);
DataTable dt =
new
DataTable();
try
{
con.Open();
da.Fill(dt);
con.Close();
}
catch
(Exception ex)
{
}
return
dt;
}
protected
void
RGGSTAcCode_ItemDataBound(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridEditableItem && e.Item.IsInEditMode)
{
//bind dropdwon while "Add"
string
CompanyCode = ddlCompany.SelectedValue.ToString();
GridEditableItem item = (GridEditableItem)e.Item;
//code to bind inside RadComboBox list
RadComboBox rcb = (RadComboBox)item.FindControl(
"ddlAccountCode"
);
rcb.DataSource = GetAccCode(CompanyCode);
rcb.DataTextField =
"AccountDescription"
;
rcb.DataValueField =
"AccountCodeID"
;
rcb.DataBind();
rcb.Items.Insert(0,
new
RadComboBoxItem(
"- Select -"
,
string
.Empty));
Session[
"AccCode"
] = rcb.SelectedValue.ToString();
string
a = rcb.SelectedValue.ToString();
//Select particular dropdown value while "Edit"
Label lblAcCode2 = item.FindControl(
"lblAcCode2"
)
as
Label;
if
(!
string
.IsNullOrEmpty(lblAcCode2.Text))
{
rcb.SelectedValue = lblAcCode2.Text;
rcb.SelectedItem.Text = lblAcCode2.Text;
}
}
}
//code to bind outside RadComboBox list
protected
void
BindComapnyDL()
{
SqlConnection con =
new
SqlConnection(strcon);
SqlCommand cmd =
new
SqlCommand(
"General.usp_tbl_BuyerCode_Query"
, con);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da =
new
SqlDataAdapter(cmd);
DataTable dt =
new
DataTable();
try
{
con.Open();
da.Fill(dt);
con.Close();
}
catch
(Exception ex)
{
}
ddlCompany.DataTextField =
"Title"
;
ddlCompany.DataValueField =
"Code"
;
ddlCompany.DataSource = dt;
ddlCompany.DataBind();
Session[
"Comp"
] = ddlCompany.SelectedValue.ToString();
string
a = ddlCompany.SelectedValue.ToString();
}
//RadComboBox select index changed event
protected
void
ddlCompany_SelectedIndexChanged(
object
sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
if
(ddlCompany.SelectedValue ==
null
|| ddlCompany.SelectedValue ==
""
)
{
GridCommandItem cmditem = (GridCommandItem)RGGSTAcCode.MasterTableView.GetItems(GridItemType.CommandItem)[0];
System.Web.UI.WebControls.Button ctrl = (System.Web.UI.WebControls.Button)cmditem.FindControl(
"AddNewRecordButton"
);
ctrl.Enabled =
false
;
System.Web.UI.WebControls.LinkButton btn = (System.Web.UI.WebControls.LinkButton)cmditem.FindControl(
"InitInsertButton"
);
btn.Enabled =
false
;
string
content =
"Please select company first"
;
ScriptManager.RegisterStartupScript(
this
,
typeof
(
string
),
"Successful"
,
"alert('"
+ content +
"');"
,
true
);
}
else
{
RGGSTAcCode.Rebind();
}
}
HTML Code:
<
telerik:RadComboBox
ID
=
"ddlCompany"
runat
=
"server"
Height
=
"200"
Width
=
"240"
DropDownWidth
=
"310"
EmptyMessage
=
"- Select Product -"
HighlightTemplatedItems
=
"true"
CausesValidation
=
"false"
Filter
=
"Contains"
AppendDataBoundItems
=
"true"
AllowCustomText
=
"true"
AutoPostBack
=
"true"
DataTextField
=
"Title"
DataValueField
=
"Code"
OnSelectedIndexChanged
=
"ddlCompany_SelectedIndexChanged"
>
</
telerik:RadComboBox
>
<
telerik:RadGrid
ID
=
"RGGSTAcCode"
runat
=
"server"
ShowFooter
=
"True"
GroupingEnabled
=
"False"
ShowStatusBar
=
"true"
EmptyDataText
=
"No record available."
AllowAutomaticInserts
=
"False"
AllowAutomaticUpdates
=
"False"
AllowAutomaticDeletes
=
"true"
OnNeedDataSource
=
"RGGSTAcCode_NeedDataSource"
OnItemDataBound
=
"RGGSTAcCode_ItemDataBound"
OnInsertCommand
=
"RGGSTAcCode_InsertCommand"
OnDeleteCommand
=
"RGGSTAcCode_DeleteCommand"
OnUpdateCommand
=
"RGGSTAcCode_UpdateCommand"
OnItemCommand
=
"RGGSTAcCode_ItemCommand"
>
<
mastertableview
ShowHeadersWhenNoRecords
=
"true"
autogeneratecolumns
=
"false"
datakeynames
=
"AccountCodeID"
InsertItemDisplay
=
"Top"
insertitempageindexaction
=
"ShowItemOnCurrentPage"
ShowFooter
=
"True"
CommandItemDisplay
=
"Top"
ClientIDMode
=
"Static"
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
UniqueName
=
"EditCommandColumn"
></
telerik:GridEditCommandColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"AccountCode"
HeaderText
=
"Account Code"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"lblAcCode"
runat
=
"server"
Text='<%# Eval("AccountCode")%>'></
asp:Label
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
asp:Label
ID
=
"lblAcCode2"
runat
=
"server"
Text='<%# Eval("AccountCode") + " - " + Eval("AccountDescription")%>' Visible="false"></
asp:Label
>
<
telerik:RadComboBox
ID
=
"ddlAccountCode"
runat
=
"server"
Height
=
"200"
Width
=
"240"
DropDownWidth
=
"310"
HighlightTemplatedItems
=
"true"
CausesValidation
=
"true"
Filter
=
"Contains"
AppendDataBoundItems
=
"true"
DataTextField
=
"AccountDescription"
DataValueField
=
"AccountCodeID"
>
</
telerik:RadComboBox
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"AccountDescription"
HeaderText
=
"Description"
UniqueName
=
"AccountDescription"
SortExpression
=
"AccountDescription"
InsertVisiblityMode
=
"AlwaysHidden"
ReadOnly
=
"true"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
aggregate
=
"SUM"
DataField
=
"Amount"
HeaderText
=
"Amount"
FooterAggregateFormatString
=
"Total : {0:###,##0.00}"
DataFormatString
=
"{0:n}"
FooterStyle-BackColor
=
"#ffc04c"
UniqueName
=
"Amount"
SortExpression
=
"Amount"
></
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Remark"
HeaderText
=
"IFCA Remark"
UniqueName
=
"Remark"
SortExpression
=
"Remark"
>
</
telerik:GridBoundColumn
>
<
telerik:GridButtonColumn
ConfirmTextFormatString
=
"Are you sure you want to Delete {0} Account Code?"
ConfirmTextFields
=
"AccountCodeID"
ConfirmDialogType
=
"RadWindow"
CommandName
=
"Delete"
Text
=
"Delete"
UniqueName
=
"DeleteColumn"
></
telerik:GridButtonColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
ButtonType
=
"ImageButton"
/>
</
EditFormSettings
>
<
CommandItemSettings
AddNewRecordText
=
"Add new record"
RefreshText
=
"Refresh"
></
CommandItemSettings
>
</
mastertableview
>
</
telerik:RadGrid
>
Please let me know how to resolve. What shall I change in my code.
I have to populate/bind the RadComboBox (comboRadGrid) which is inside of RadGrid, based on the Items that are outside of RadGrid of RadComboBox (comboOutside). Please note that I am very new in Telerik and asp.net Please let me know how to modify my comboRadGrid binding code (based on outside Combo List items) so that this issue do not occur again ? Please reply​