in the OnClientItemClicked event the clickedMenuItem is null and the hidden form field which is set in the RowContextMenu is null? Am i using the right event?
in RowContextMenu "hiddenClientID" is correctly set to the ClientID key field
// process content menu
function
RowContextMenu(sender, eventArgs) {
var
colIndex = eventArgs.get_domEvent().target.cellIndex;
var
rowIndex = eventArgs.get_itemIndexHierarchical();
var
masterTable = sender.get_masterTableView();
cell = masterTable.getCellByColumnUniqueName(masterTable.get_dataItems()[rowIndex],
"ClientID"
);
var
ClientID = cell.innerHTML;
//
document.getElementById(
"hiddenClientID"
).value = ClientID;
var
radGridClickedRowIndex = document.getElementById(
"hiddenClientID"
).value;
var
menu = $find(
"<%=RadContextMenu1.ClientID %>"
);
var
evt = eventArgs.get_domEvent();
if
(evt.target.tagName ==
"INPUT"
|| evt.target.tagName ==
"A"
) {
return
;
}
var
index = eventArgs.get_itemIndexHierarchical();
sender.get_masterTableView().selectItem(sender.get_masterTableView().get_dataItems()[index].get_element(),
true
);
menu.show(evt);
evt.cancelBubble =
true
;
evt.returnValue =
false
;
if
(evt.stopPropagation) {
evt.stopPropagation();
evt.preventDefault();
}
}
function
contextMenuItemClicked(sender, args) {
var
clickedMenuItem = args.get_item().get_value();
var
radGridClickedRowIndex = document.getElementById(
"hiddenClientID"
).value;
var
grid = $find(
'<%= RadGrid1.ClientID %>'
);
var
masterTableView = grid.MasterTableView;
var
row = masterTableView.get_dataItems()[radGridClickedRowIndex];
var
cell = masterTableView.getCellByColumnUniqueName(row,
"ClientID"
);
if
(clickedMenuItem ==
"Edit"
) {
editClient();
}
if
(clickedMenuItem ==
"Calendar"
) {
AddAppoint(cell.innerHTML);
}
<telerik:RadContextMenu ID=
"RadContextMenu1"
runat=
"server"
OnClientItemClicked=
"contextMenuItemClicked"
EnableRoundedCorners=
"true"
EnableShadows=
"true"
Skin=
"Metro"
>
<Items> <telerik:RadMenuItem Text=
"Select"
/> <telerik:RadMenuItem Text=
"Calendar"
/> <telerik:RadMenuItem Text=
"Contact"
/> <telerik:RadMenuItem Text=
"Edit"
/> <telerik:RadMenuItem Text=
"Payment"
/> <telerik:RadMenuItem Text=
"Archive"
/> </Items> </telerik:RadContextMenu>
I have RadTreeView control inside a NestedViewTemplate of a RadGrid.
I want to reference this control in code behind so I can bind data to it, however I'm unsure of how to do this.
I was thinking it is something along this line:
Dim
RadTreeView1 As RadTreeView = CType(RadGrid2.MasterTableView.GetItems(GridItemType.NestedView.FindControl("RadTreeView1"), RadTreeView))
But this is incorrect. Can someone point me in the right direction
I was wondering if you can export each page of a grid to a separate excel sheet in the same excel file using Telerik
if no I would be grateful if you pointed me to like to how to do it using native ASP.NET code
I am having a trouble in implementing below requirement.
Current RadGrid: Attached (Snapshot 1) is the RadGrid in which I am using GroupByExpressions to display/show data grouped with "Business Unit" column.
In RadGrid column 2nd(InvoiceLineNo) and 3rd(InvoiceNo), I am auto generating the numbers using Stored Procedure.
i.e., for "InvoiceLineNo" column, Autogenerated No's are: 01,02,03,04,05,06,07,08.......n
for "InvoiceNo" column, Autogenerated No's are: 15100001, 15100002, 15100003........n
where, 15 is a "year" and 100001 are "running numbers"
Requirement is: I want to show the "InvoiceLineNo" column data as Group wise.
Example:
for 1st "Business Unit" group (i.e., SUNWAY LEISURE SDN BHD (CARNIVAL)), InvoiceLineNo shall be: 01,02,03,04,05,06,07,08
for 2nd "Business Unit" group (i.e., SUNWAY MALL PARKING SDN BHD), InvoiceLineNo shall be: 01,02,03,04,05,06,07,08
Similarly, I want to show the "InvoiceNo" column data as Group wise.
Example:
for 1st "Business Unit" group (i.e., SUNWAY LEISURE SDN BHD (CARNIVAL)), InvoiceNo shall be: 15100001,15100001,15100001,15100001,15100001,15100001,15100001,15100001
for 2nd "Business Unit" group (i.e., SUNWAY MALL PARKING SDN BHD), InvoiceNo shall be: 15100002,15100002,15100002,15100002,15100002,15100002,15100002,15100002
"InvoiceNo" column data will always be unique for different "Business Unit".
I want output to be like attached snapshot 2.
I can autogenerate the numbers serial wise but I am not getting how to autogenerate the 2 column values based on Group and show them like that.
Please help me to achieve it. Please do reply.
Thanks in advance.
Hello,
I'm trying to apply a custom sorting on a grid datascource in the onsortcommand event
my datascource is Programmatically set and apparently whenever I try to retrieve it in the event I find the object is assigned to null
I'm using custom paging on my grid so there's no way to sort the records using the sorting expression without disabling virtual paging first
can you be guys of any help please??
After upgrading Web dll's from version 2012.n to 2015.n the CSS property for the tristate.png is being set to incorrect values regardless of the .rtChecked, etc values are being set to (and have been set to). The values in the TreeView.css file are:
.RadTreeView .rtChecked { background-position: 0 0; }
.RadTreeView .rtUnchecked { background-position: 0 -13px; }
.RadTreeView .rtIndeterminate { background-position: 0 -26px; }
The values are being overridden from the now being set to:
.RadTreeView .rtChecked { background-position: 0 -40; }
.RadTreeView .rtUnchecked { background-position: 0 0; }
.RadTreeView .rtIndeterminate { background-position: 0 -80px; }
The dom explorer (in IE) is saying that this setting is held in the WebResource.axd file, which is a file dynamically created by the runtime.
Does anyone have any idea where these background-positions values are being set from so I can correct it, or help me understand what happened during the upgrade that caused these settings?
Thank you!
Jason
Hello,
I have a Gantt chart with tasks and dependencies.
Can anyone tell me how can I update "Start" and "End" of the tasks if it's parent task's "End" date is updated.
I tried doing the following code (@screenshot) in the TaskUpdate event, but it just refreshes the page, nothing else.
Any help will be appreciated. Thank you.
Regards,
Hi Telerik,
We have a grid with an ItemTemplate code that contains a RadComboBox
<
telerik:RadComboBox
runat
=
"server"
ID
=
"RadComboBoxEventNotAttending"
Width
=
"155px"
CheckBoxes
=
"true"
DropDownAutoWidth
=
"Enabled"
AutoPostBack
=
"true"
EmptyMessage
=
"Select Not Attending"
EnableCheckAllItemsCheckBox
=
"true"
OnItemChecked
=
"RadComboBoxEventNotAttending_ItemChecked"
OnCheckAllCheck
=
"RadComboBoxEventNotAttending_CheckAllCheck"
OnDataBinding
=
"RadComboBoxEventNotAttending_DataBinding"
Label='<%# Eval("EventSubId")%>' LabelCssClass="myLabelHide" >
<
Localization
AllItemsCheckedString
=
"Family not attending"
CheckAllString
=
"Select All"
ItemsCheckedString
=
"Member(s) not attending"
/>
<
CollapseAnimation
Type
=
"InExpo"
/>
<
ExpandAnimation
Type
=
"OutExpo"
/>
<
HeaderTemplate
>
<
asp:Label
runat
=
"server"
Font-Size
=
"8"
Text
=
"Not Attending"
/>
</
HeaderTemplate
>
</
telerik:RadComboBox
>
Every Item for the grid could have different drop down items and checks for their respective repeating RadComboBoxes depending on the scenario, which is all handled fine with the OnDataBinding for each record in the grid datasource. When the user checks an item in the dropdown it does a whole postback for the grid. We would like it to only do a postback for the RadComboBox and show a LoadingPanel around the RadComboBox itself instead of showing around the grid.
Our grid is wrapped in a ASP Panel and is used in the RadAjaxManager. The RadComboBox could be wrapped in a ASP Panel and used the same way. We are not sure this is possible for it to be used inside a grid like this.
Could you supply some information or some code snippet for this type of situation?
Thanks!!!
HI I have created a Radgrid and added a textbox as a template coloumn,
When the user presses the ok button i want any values that have been entered into the textbox to be returned
I believe i have code correct on the event of the ok button but i am always returned a Null value. I have looked at a sample of code found here http://kandydeol.blogspot.co.uk/2013/09/fetching-telerik-radgrid-column-and.html
and as far as I can see all is correct,
aspx code :-
<telerik:RadGrid ID="GRD_OTCOrder" runat="server" AutoGenerateColumns="False" OnItemDataBound="GRD_OTCOrder_ItemDataBound" Culture="en-GB" OnNeedDataSource="GRD_OTCOrder_NeedDataSource" GroupPanelPosition="Top" Width="1173px">
<MasterTableView TableLayout="Auto">
<Columns>
<telerik:GridBoundColumn DataField="TxtName" HeaderText="OTC Name / Type"></telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Packsize" HeaderText="Pack size" ItemStyle-Width="100px">
<ItemStyle Width="100px"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Units" ItemStyle-Width="100px">
<ItemStyle Width="100px"></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Qty Required">
<ItemTemplate>
<asp:TextBox ID="TB_QTYOrder" runat="server" Width="50px"></asp:TextBox>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn>
<ItemTemplate>
<telerik:RadComboBox ID="DDL_Reason" runat="server"></telerik:RadComboBox>
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn Visible="false">
<ItemTemplate>
<asp:Label ID="LAB_OTCID" runat="server"></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
<telerik:RadButton ID="BTN_Order" runat="server" Text="Place Order" OnClick="BTN_Order_Click"></telerik:RadButton>
<telerik:RadComboBox ID="DDL_House" runat="server" ></telerik:RadComboBox>
and the cs code attached to the ok button
protected void BTN_Order_Click(object sender, EventArgs e)
{
foreach (GridDataItem data in GRD_OTCOrder.Items)
{
//find controls in Grid
RadComboBox reason = (RadComboBox)data.FindControl("DDL_Reason");
TextBox qtyre = (TextBox)data.FindControl("TB_QTYOrder");
Label otc = (Label)data.FindControl("LAB_OTCID");
//create new OTC Object in memory
OTCOrders temp = new OTCOrders();
temp.House = Convert.ToInt64(DDL_House.SelectedValue);
temp.OrderBy = Websession.sessionuser.UserID;
temp.OTCType = Convert.ToInt32(otc.Text);
if (!string.IsNullOrEmpty(qtyre.Text))
{
temp.QTY = Convert.ToInt32(qtyre.Text);
}
temp.BolSent = false;
temp.BolRec = false;
temp.SentBy = 0;
temp.RecBy = 0;
temp.DteSent = DateTime.Now;
temp.dterec = DateTime.Now;
temp.House = Convert.ToInt64(DDL_House.SelectedValue);
temp.Reason = reason.SelectedValue;
temp.DteOrdered = DateTime.Now;
//Save object to database
temp.SaveOrder();
}
}
Many Thanks