I have a RadRating element for each row in a RadGrid, and need to get the associated Id for the row where the RadRating is being Rated (but with Javascript), however, the get_parent() method is returning the grid reference and not the row.
How can I get the GridDataItem of the row of the RadRating?
The following code works sometimes but not all the time. What am I doing wrong?
<
script
type
=
"text/javascript"
>
(function(global,undefined) {
function OnClientRating(controlRating,args) {
var row = controlRating.get_parent();
var userId = row.getDataKeyValue("UserId");
}
global.OnClientRating = OnClientRating;
})(window);
</
script
>
<
rad:RadGrid
runat
=
"server"
ID
=
"gridUsers"
Skin
=
"Hay"
EnableAJAX
=
"False"
AutoGenerateColumns
=
"False"
GridLines
=
"Both"
Width
=
"100%"
AllowSorting
=
"True"
OnItemDataBound
=
"Grid_ItemDataBound"
>
<
MasterTableView
DataKeyNames
=
"UserId"
ClientDataKeyNames
=
"UserId"
>
<
Columns
>
<
rad:GridTemplateColumn
HeaderText
=
"Name"
HeaderStyle-Width
=
"180px"
ItemStyle-Width
=
"180px"
>
<
ItemTemplate
>
<%# Eval("FullName")%>
</
ItemTemplate
>
</
rad:GridTemplateColumn
>
<
rad:GridTemplateColumn
HeaderText
=
"Rating"
HeaderStyle-Width
=
"100px"
ItemStyle-Width
=
"100px"
>
<
ItemTemplate
>
<
rad:RadRating
ID
=
"ratAppraiserRating"
runat
=
"server"
ItemCount
=
"5"
Value='<%# Eval("AverageRating")%>'
SelectionMode="Continuous" Precision="Item" Orientation="Horizontal" OnClientRating="OnClientRating"
OnRate="RatRating_Rate" AutoPostBack="true" />
</
ItemTemplate
>
</
rad:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
>
<
Scrolling
UseStaticHeaders
=
"false"
ScrollHeight
=
"240px"
AllowScroll
=
"true"
/>
<
Selecting
AllowRowSelect
=
"false"
/>
<
ClientEvents
OnRowDblClick
=
"selectRow"
/>
</
ClientSettings
>
</
rad:RadGrid
>
<
telerik:RadTabStrip
ID
=
"radESGRTab"
runat
=
"server"
Orientation
=
"HorizontalTop"
MultiPageID
=
"radPageMulti"
ClickSelectedTab
=
"true"
Skin
=
"Web20"
Font-Bold
=
"true"
Font-Size
=
"Large"
Width
=
"800px"
OnClientMouseOver
=
"tabEmployer"
OnClientTabSelected
=
"CheckValidation"
>
<
Tabs
>
<
telerik:RadTab
PageViewID
=
"rdPageInfo"
Text
=
"Soldier Info"
runat
=
"server"
SelectedIndex
=
"1"
></
telerik:RadTab
>
<
telerik:RadTab
PageViewID
=
"rdPageEmploy"
Text
=
"Employer Info"
runat
=
"server"
SelectedIndex
=
"2"
></
telerik:RadTab
>
<
telerik:RadTab
PageViewID
=
"rdpageSurvey"
Text
=
"Survey Info"
SelectedIndex
=
"3"
></
telerik:RadTab
>
<
telerik:RadTab
PageViewID
=
"rdPageAwards"
Text
=
"Employer Awards"
SelectedIndex
=
"4"
></
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
function
CheckValidation() {
var
tab1 = $find(
'<%=radESGRTab.ClientID %>'
).selectedIndex();
if
(tab1 == 1) {
var
combo = $find(
'<%= ddlSoldCounty.ClientID %>'
);
var
item = combo.get_selectedItem().get_value();
alert(combo.get_selectedItem().get_value());
if
(item == 1) {
alert(
'You must pick a county from Drop Down List'
);
}
}
}
</script>
Hi
I want to refresh/rebind all child grids (child2 gridtableview) on edit/insert case of chid1 (gridtableview), child1 and chid2 are on same level in Detail tables of RadGrid.
I am using update command function to insert/edit records in chid1.
After completing insert/edit case of child1 gridview rebind automatically while the other child2 on same level contain old data, i want to refresh/rebind the child2 grid as well.
Here is code structure for understanding...
<telerik:RadGrid ID="PlEmployee" runat="server" AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True"
OnUpdateCommand="PlEmployee_UpdateCommand"
<DetailTables>
<telerik:GridTableView runat="server" Name="Child1">
<telerik:GridTableView runat="server" Name="Child2">
</DetailTables>
</telerik:RadGrid>
Regards,
Zain
Hi team,
I am having listview, I want to add treeview inside listview.
And the listview should be combobox same like in this demo
Please help me how to do this.
aspx page
<
telerik:RadListView
ID
=
"rlvUsers"
runat
=
"server"
ItemPlaceholderID
=
"EmployeesContainer"
DataKeyNames
=
"userid"
OnItemDataBound
=
"rlvUsers_ItemDataBound"
>
<
LayoutTemplate
>
<
fieldset
>
<
legend
>New Employees - Manage Profiles</
legend
>
<
asp:PlaceHolder
ID
=
"EmployeesContainer"
runat
=
"server"
></
asp:PlaceHolder
>
</
fieldset
>
</
LayoutTemplate
>
<
ItemTemplate
>
<
fieldset
>
<
legend
class
=
"gray"
><%#Eval("fullName")%></
legend
>
<
table
style
=
"line-height: 30px; padding: 60px; width: 100%"
>
<
tr
>
<
td
style
=
"width: 120px"
>
<
asp:Label
ID
=
"Label1"
runat
=
"server"
CssClass
=
"ax-text-gray"
Text
=
"Employee Code"
></
asp:Label
>
</
td
>
<
td
>
<
asp:Label
ID
=
"Label2"
runat
=
"server"
CssClass
=
"ax-input-noborder"
Text='<%#Eval("empid")%>'></
asp:Label
>
</
td
>
<
td
style
=
"width: 50px"
></
td
>
<
td
style
=
"width: 120px"
>
<
asp:Label
ID
=
"Label7"
runat
=
"server"
CssClass
=
"ax-text-gray"
Text
=
"Select Parent"
></
asp:Label
>
</
td
>
<
td
>
<
telerik:RadComboBox
ID
=
"cbParent"
runat
=
"server"
Width
=
"400px"
>
<
ItemTemplate
>
<
telerik:RadTreeView
ID
=
"rTreeParent"
runat
=
"server"
DataFieldID
=
"userid"
DataFieldParentID
=
"parent_id"
DataTextField
=
"fullName"
DataValueField
=
"userid"
>
</
telerik:RadTreeView
>
</
ItemTemplate
>
</
telerik:RadComboBox
>
</
td
>
<
td
rowspan
=
"3"
>
<
asp:Button
ID
=
"btnAssignProfiles"
CssClass
=
"btn btn-circle btn-sky"
runat
=
"server"
Text
=
"Assign"
/>
</
td
>
</
tr
>
</
table
>
<
br
/>
<
br
/>
</
fieldset
>
</
ItemTemplate
>
</
telerik:RadListView
>
code behind
protected
void
rlvUsers_ItemDataBound(
object
sender, RadListViewItemEventArgs e)
{
if
(e.Item.ItemType == RadListViewItemType.DataItem || e.Item.ItemType == RadListViewItemType.AlternatingItem)
{
RadListViewItem item = e.Item
as
RadListViewItem;
RadComboBox cbParent = (RadComboBox)item.FindControl(
"cbParent"
);
cbParent.DataSource = getActiveUsers();
cbParent.DataBind();
}
}
Now it is loading in combo box. But I wan this in tree inside combobox
Thanks
Alex
How to get value from javascript in server side using RadConfirm.
I have the following code but I am not getting any value in server side:
here my HTML code:
function ConfirmCancel() {
var confirmvalue = false;
if (!confirmvalue) {
radconfirm('CANCELLING A REQUEST IS DEFINE AS : When an employee who received original request approval never performed one day of service in the Sixth Period Coverage Program. This action might trigger the recoupment of the original payments', confirmCallBackFn); return false;
}
}
function confirmCallBackFn(arg) {
var control = $find("<%= inpHide.ClientID%>");
if (arg) {
confirmValue = true;
document.getElementById(control).value = "1";
}
else {
document.getElementById(control).value = "0";
}
}
<input id="inpHide" type="hidden" runat="server" />
<telerik:GridTemplateColumn HeaderText="Link to Form/Cancel Request" UniqueName="ButtonColumn" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="200px" >
<ItemTemplate> <
<asp:ImageButton ID="CancelReqBtn" ImageUrl="~/Image/Cancel_button6.png" runat="server" CommandName="Cancel" ImageAlign="Right" BackColor="Transparent" ToolTip="cancel the request" Width="50px" Height="20px" Visible="false" OnClientClick="return ConfirmCancel();" />
</ItemTemplate>
</telerik:GridTemplateColumn>
And here is my code behind:
if (e.CommandName == "Cancel")
{
int result = int.Parse(inpHide.Value);
if (result == 0)
{
}
But for some reason when I put breakpoint on command name it is not executing.
Please help me to solve this issue.
thanks so much
Hi,
Checkboxes and radiobuttons in Microsoft Edge browser with Lightweight render mode doesn't work at all!
You can see this in your demo:
http://demos.telerik.com/aspnet-ajax/formdecorator/examples/overview/defaultcs.aspx
When using classic render mode it works!
Regards<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
<script type="text/javascript"> |
function ShowInvoice(file) { |
window.radopen("InvoiceWindow.aspx?file=" + file, "InvoiceWin"); |
return false; |
} |
</script> |
<telerik:RadWindowManager ID="RadWindowManager1" runat="server"> |
<Windows> |
<telerik:RadWindow Skin="Sunset" ID="InvoiceWin" runat="server" Title="Monthly Invoice" Height="800" |
Width="850" Left="10px" ReloadOnShow="true" Modal="true" ShowContentDuringLoad="false" Animation="None" /> |
</Windows> |
</telerik:RadWindowManager> |
</telerik:RadCodeBlock> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head runat="server"> |
<title>Dealership Invoice Viewer</title> |
<script type="text/javascript"> |
function GetRadWindow() { |
var oWindow = null; |
if (window.radWindow) oWindow = window.radWindow; |
else if (window.frameElement.radWindow) |
oWindow = window.frameElement.radWindow; |
return oWindow; |
} |
function CloseRadWin() { |
//get a reference to the RadWindow |
var oWnd = GetRadWindow(); |
//close the RadWindow |
oWnd.close(); |
} |
</script> |
</head> |
<body> |
<form id="form1" runat="server"> |
<iframe style="width:820px; height:680px;" id="iframe1" runat="server"></iframe><br /> |
<a href="#" onclick='return CloseRadWin();'><img src="images/close_win.gif" border="0" style="vertical-align: middle" /> Close Invoice</a> |
</form> |
</body> |
</html> |
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load |
iframe1.Attributes("src") = Request("file") |
End Sub |
Hi,
I have an aspx page where i declared a radwindow (Contenttemplate). In that radwindow i have some text which needs to be copied to clipboard.
I tried with traditional way of copying to clipboard by using the exec("copy"). it works in IE. but it doesn't in Google Chrome (Version 47.0.2526.106)
In other page, i used radbutton for the action of copying, since it was not working i have changed it to asp button.Now its working there for IE and Chrome. that page has no controls which would collapse in the script runtime. But here the radwindow is doing some weird things of stopping that js code.
When in debugging, it is executing but not evaluating anything. ?
any work around for this?