I have the following radcombobox setup:
<
telerik:RadComboBox
ID
=
"cbChannel2"
runat
=
"server"
DropDownWidth
=
"200px"
HighlightTemplatedItems
=
"True"
Width
=
"200px"
DataTextField
=
"sle_chnl_cd"
DataValueField
=
"sle_chnl_id"
AutoPostBack
=
"True"
AppendDataBoundItems
=
"True"
>
<
HeaderTemplate
>
<
table
cellpadding
=
"1"
cellspacing
=
"0"
class
=
"Main"
width
=
"190px"
>
<
tr
>
<
td
class
=
"ComboHeader2"
width
=
"50px"
style
=
"text-align: left; visibility: visible;"
><
b
>Code</
b
>
</
td
>
<
td
class
=
"ComboHeader2"
width
=
"140px"
style
=
"text-align: left; visibility: visible;"
><
b
>Description</
b
>
</
td
>
</
tr
>
</
table
>
</
HeaderTemplate
>
<
ItemTemplate
>
<
table
cellpadding
=
"1"
cellspacing
=
"0"
class
=
"Main"
width
=
"190px"
>
<
tr
>
<
td
width
=
"50px"
style
=
"text-align: left; visibility: visible;"
>
<%#DataBinder.Eval(Container.DataItem, "sle_chnl_cd")%>
</
td
>
<
td
width
=
"140px"
style
=
"text-align: left; visibility: visible;"
>
<%#DataBinder.Eval(Container.DataItem, "sle_chnl_name")%>
</
td
>
</
tr
>
</
table
>
</
ItemTemplate
>
</
telerik:RadComboBox
>
Sometimes I have to add an additional row after the combobox has already been DataBound. I understand how to add a radcomboboxitem what I don't understand is how to add one such that "sle_chnl_name" actually gets a value? How do I add a row that's contained in a dataset without losing the data that's already been loaded?
Hi Team,
I am using autocomplete the list is bound to a column which can have empty values. Now when we click on control you shows the list which have blank values as well. If we click on the UI without selecting any option from the autocomplete it select the first blank option from the list.
Behavior should be if we click on UI without selecting any option from the autocomplete list it should not select any value. Please suggest
Regards
When filters are added to a sheet and then exported, the entire sheet is exported.
Is it possible to export only the filtered data on the sheet?
Hi
Is it possible to draw filled rectangles series to the radhtmlchart? See the attachment
Regards,
Auvo
I'm having trouble accessing rows and cells in the RadGrid hierarchy. An error is occurring in the line "var cell = MasterTable.getCellByColumnUniqueName (row," Pro ") // cell"
Please help me.
Error: Unhandled exception at line 1452, column 29 in http://localhost:58910/_CC/ControlModel/Graphics.aspx
0x800a01b6 - JavaScript runtime error: Object does not support property or method 'getCellByColumnUniqueName'
<script type="text/javascript">
function LoadValues() {
var grid = $find("<%= RadGrid1.ClientID %>");
var masterTable = grid.get_masterTableView();
// get all rows in the grid
selectedRows = masterTable.get_dataItems();
for (var i = 0; i < selectedRows.length; i++) {
var row = selectedRows[i]; // found the row
for (var j = 0; j < row.get_nestedViews().length; j++) {
var detTable = row.get_nestedViews()[j]; // found the child table
var childRows = detTable.get_dataItems();
for (var k = 0; k < childRows.length; k++) {
var cRow = childRows[k];
var cell = cRow.getCellByColumnUniqueName(row, "ValueScore")
var cellValue = cell.innerHTML;
}
}
}
}
<telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" runat="server" ShowStatusBar="true" Skin="Windows7" AllowPaging="True" Width="900px"
OnColumnCreated="RadGrid1_ColumnCreated" OnItemDataBound="RadGrid1_ItemDataBound" OnPreRender="RadGrid1_PreRender"
OnNeedDataSource="RadGrid1_NeedDataSource" AllowMultiRowSelection="true" OnDetailTableDataBind="RadGrid1_DetailTableDataBind">
<GroupingSettings CollapseAllTooltip="Collapse all groups" />
<ClientSettings AllowColumnsReorder="true">
<Selecting AllowRowSelect="true" />
</ClientSettings>
<MasterTableView DataKeyNames="CodigoRede" ClientDataKeyNames="CodigoRede" Name="Rede">
<DetailTables>
<telerik:GridTableView DataKeyNames="CodigoSubRede" ClientDataKeyNames="CodigoSubRede" Name="SubRede" Width="868px" ShowHeader="true" ShowFooter="false">
<Columns>
<telerik:GridClientSelectColumn UniqueName="SelectColumnNameSubRede"></telerik:GridClientSelectColumn>
<telerik:GridBoundColumn DataField="ValorScoreSubRede" UniqueName="ValueScore" HeaderText="Value Score" HeaderButtonType="TextButton" Visible="true">
<ItemStyle Width="316px" HorizontalAlign="Left" />
</telerik:GridBoundColumn>
</Columns>
</telerik:GridTableView>
</DetailTables>
<RowIndicatorColumn Visible="false"></RowIndicatorColumn>
<Columns>
<telerik:GridClientSelectColumn UniqueName="SelectColumnName"></telerik:GridClientSelectColumn>
<telerik:GridTemplateColumn HeaderText="Ideal Score">
<ItemStyle HorizontalAlign="Right" Width="330px" />
<ItemTemplate>
<telerik:RadSlider ID="RadSliderValorScoreMinMax" runat="server" Orientation="Horizontal" MinimumValue="0" MaximumValue="99" SmallChange="1" LargeChange="10"
ItemType="Tick" Width="300px" Height="70px" ShowDecreaseHandle="true" ShowIncreaseHandle="true" EnableDragRange="true" EnableServerSideRendering="true"
IsSelectionRangeEnabled="true" AutoPostBack="false" Skin="Windows7" OnClientValueChanged="OnClientValueChanged" DataValueField="">
</telerik:RadSlider>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
<br />
<asp:Button ID="buttonClick" runat="server" Text="buttonClick" OnClientClick="buttonClick(); return false;" />
I am using below control and property for upload multiple files. I want to display (Preview file) each file near by file name.
<telerik:RadAsyncUpload runat="server" RenderMode="Lightweight" ID="ruDocument" MultipleFileSelection="Automatic"
AllowedFileExtensions=".doc,.docx,.pdf,.txt,.xls,.xlsx,.jpg,.png,.bmp,.jpeg,.zip,.rar"
UploadedFilesRendering="BelowFileInput"
EnableInlineProgress="true"
OnClientValidationFailed="validationFailed"
OnClientFilesUploaded="OnClientFilesUploaded"
OnClientFilesSelected="OnClientFilesSelected"
OnClientFileUploadRemoved="OnClientFileUploadRemoved"
OnClientFileUploading="OnClientFileUploading" />
Is it possible to display .xls or .doc file's first page as image in preview?
Thanks,
Mukesh Prajapati
I have a fairly old app that the boss has ordered me to update, to make it more 'Bootstrappy', more like our more recent programs.
To this end I have updated my controls to the latest and set the RadGrid skin to Bootstrap. So far, so good.
However, it's my understanding that 'ordinary' Bootstrap and Telerik 'Bootstrap' can conflict.
Here is the original HTML for my Edit button:
<telerik:GridTemplateColumn UniqueName="TemplateEditColumn" AllowFiltering="False" ItemStyle-Width="40px" HeaderStyle-Width="40px">
<HeaderStyle Width="40px"></HeaderStyle>
<ItemStyle HorizontalAlign="Center" />
<ItemTemplate>
<asp:HyperLink ID="EditLink" runat="server" Text="Edit"></asp:HyperLink>
</ItemTemplate>
</telerik:GridTemplateColumn>
What I'd like to do is change a couple of the items in the grid rows to bright shiny BootStrap type icons, in particular the Edit button. So far I've had little luck.
I'm going to attach an image of the sort of buttons I'm aiming for.
Hi
I have the following:
(Global.Master) => MasterPage
(LoginValidationLayer.Master) => Nasted Master Page (To check login sessions...) from the above Master "Global.Master"
(CarsAndMachines.aspx) => Web form With Master Page from the Above Master "LoginValidationLayer.Master"
this form contents :
RadScriptManager (RadScriptManager1)
RadCodeBlock (RadCodeBlock1)
RadAjaxManager (RadAjaxManager1)
RadAjaxLoadingPanel (RadAjaxLoadingPanel1)
RadWindowManager (RadWindowManager1)
Panel (MainPanel)
The RadCodeBlock declared as following:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function ShowOpenJobForm(machineId, rowIndex, companyId) {
var grid = $find("<%= CarsAndMachinesGrid.ClientID %>");
var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
grid.get_masterTableView().selectItem(rowControl, true);
window.radopen("EditOpenJobForm_csharp.aspx?MachineId=" + machineId + "&CompanyId=" + companyId, "OpenJobDialog");
return false;
}
</script>
</telerik:RadCodeBlock>
the RadAjaxManager declared as following :
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="MainPanel">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="MainPanel" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
to ajaxfy the updates and show progress when updating grid.
the RadWindowManager declared as following:
<telerik:RadWindowManager RenderMode="Lightweight" ID="RadWindowManager1" runat="server" EnableShadow="true">
</telerik:RadWindowManager>
the Panel contains RadGrid
Inside this Web form I have RadGrid that set to show RadWindow when I click on one of it's columns (OpenJobsColumn) it is a GridTemplateColumn that has HyperLink that has OpenJobLink Id (it is an ItemTemplate)
I have set the link of the HyperLink control in the ItemCreated event as following :
HyperLink openJobLink = (HyperLink)e.Item.FindControl("OpenJobLink");
if (openJobLink != null)
{
openJobLink .Attributes["href"] = "javascript:void(0);";
openJobLink .Attributes["onclick"] = String.Format("return ShowOpenJobForm('{0}','{1}','{2}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Id"], e.Item.ItemIndex, Request.QueryString["CompanyId"]);
}
now when I click on the HyperLink (OpenJobLink) it shows the RadWindow and everything is great until here
inside the RadWindow I'm showing a Web Form which contains: (EditOpenJobForm_csharp.aspx)
RadScriptManager (RadScriptManager1)
RadCodeBlock (RadCodeBlock1)
RadAjaxManager (RadAjaxManager1)
RadAjaxLoadingPanel (RadAjaxLoadingPanel1)
RadWindowManager (RadWindowManager1)
RadGrid (PartsGrid)
ScriptManager(ScriptManager1)
the RadCodeBlock declared as following:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function ShowEditForm(id, rowIndex) {
var grid = $find("<%= PartsGrid.ClientID %>");
var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
grid.get_masterTableView().selectItem(rowControl, true);
window.radopen("EditOpenJobPartsForm_csharp.aspx?InvoiceId=" + id, "OpenJobPartsDialog");
return false;
}
function ShowInsertForm() {
window.radopen("EditOpenJobPartsForm_csharp.aspx?InvoiceId", "OpenJobPartsDialog");
return false;
}
function refreshGrid(arg) {
if (!arg) {
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
}
else {
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
}
}
function RowDblClick(sender, eventArgs) {
window.radopen("EditOpenJobPartsForm_csharp.aspx?InvoiceId=" + eventArgs.getDataKeyValue("InvoiceId"), "OpenJobPartsDialog");
return false;
}
</script>
</telerik:RadCodeBlock>
the RadAjaxManager declared as following:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="PartsGrid">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="PartsGrid" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
in the ASPX I declared a script as following :
<script type="text/javascript">
function CloseAndRebind(args)
{
GetRadWindow().BrowserWindow.refreshGrid(args);
GetRadWindow().close();
}
function GetRadWindow()
{
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
return oWindow;
}
function CancelEdit()
{
GetRadWindow().close();
}
</script>
The RadGrid (PartsGrid) has a column for edit (GridTemplateColumn) declared as following:
<telerik:GridTemplateColumn UniqueName="TemplateEditColumn">
<ItemTemplate>
<asp:HyperLink ID="EditLink" runat="server" Text="Edit"></asp:HyperLink>
</ItemTemplate>
</telerik:GridTemplateColumn>
and I set to show RadWindow to edit the selected record in the grid (PartsGrid) using ItemCreated event as following :
if (e.Item is GridDataItem)
{
HyperLink editLink = (HyperLink)e.Item.FindControl("EditLink");
editLink.Attributes["href"] = "javascript:void(0);";
editLink.Attributes["onclick"] = String.Format("return ShowEditForm('{0}','{1}');", e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Id"], e.Item.ItemIndex);
}
and the AjaxRequest of RadAjaxManager is declared in code behind as following:
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
if (e.Argument == "Rebind")
{
PartsGrid.MasterTableView.SortExpressions.Clear();
PartsGrid.MasterTableView.GroupByExpressions.Clear();
PartsGrid.Rebind();
}
else if (e.Argument == "RebindAndNavigate")
{
PartsGrid.MasterTableView.SortExpressions.Clear();
PartsGrid.MasterTableView.GroupByExpressions.Clear();
PartsGrid.MasterTableView.CurrentPageIndex = PartsGrid.MasterTableView.PageCount - 1;
PartsGrid.Rebind();
}
}
now when I click on Edit a RadWindow appears over the previous RadWindow and shows a DetailsView to update the selected record of PartsGrid
When I click on update this RadWindow it doesn't update the RadGrid while in database I can see the record updated and the updates doesn't appear until I do a full refresh (close the Previous RadWindow and open it again)
although in detailsview I set the following:
protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e)
{
if (e.CommandName == "Update")
{
ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebindA();", true);
}
else if (e.CommandName == "Insert")
{
ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebindA('navigateToInserted');", true);
}
else
{
ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CancelEdit();", true);
}
}
and it contains :
<script type="text/javascript">
function CloseAndRebindA(args)
{
var oWnd = GetRadWindowA();
var DialogB = oWnd.get_windowManager().getWindowByName("OpenJobDialog");
DialogB.refreshGrid(args);
window.close();
}
function alerto()
{
alert("this is a test");
}
function GetRadWindowA()
{
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
return oWindow;
}
function CancelEdit()
{
GetRadWindow().close();
}
</script>
<asp:ScriptManager ID="ScriptManager3" runat="server" />
I need to update a RadGrid located in a RadWindow using a DetailsView in another RadWindw and apply the updates to appear directly
I'm not sure if it is about ajax or I don't know
Thank you.
I have a form with a few textboxes and a save button. I want RadSpellCheck to launch when the save button is clicked and then on the server execute the click event for the save button. I don't want a separate button for the spell check. When I run the page the RadSpellCheck dialog box appears and finds the misspellings but doesn't correct them when the form is submitted.
I appreciate any ideas you all have.
Here's the .aspx markup file:
<
head
runat
=
"server"
>
<
title
></
title
>
<
telerik:RadScriptBlock
ID
=
"script1"
runat
=
"server"
>
<
script
src
=
"//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"
></
script
>
<
script
type
=
"text/javascript"
>
function check() {
Page_ClientValidate();
if (Page_IsValid) {
var spell = $find('<%= RadSpell1.ClientID %>');
spell.startSpellCheck();
return false;
}
}
function RadSpell1_OnClientCheckFinished() {
$("#<% =btnSaveReal.ClientID %>").trigger('click');
}
</
script
>
</
telerik:RadScriptBlock
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"RadScriptManager1"
/>
<
div
>
<
asp:TextBox
id
=
"txt1"
runat
=
"server"
>My firzt client side TEXTAREA with some delibirate mistakees.</
asp:TextBox
>
<
br
/>
<
asp:TextBox
id
=
"txt2"
runat
=
"server"
>My secont client side TEXTAREA with some delibirate mistakees.</
asp:TextBox
>
<
br
/>
<
asp:Textbox
id
=
"txt3"
runat
=
"server"
>My thirdth client side TEXTAREA with some delibirate mistakees.</
asp:Textbox
>
<
br
/>
<
asp:TextBox
ID
=
"txtTest"
runat
=
"server"
></
asp:TextBox
>
<
asp:RequiredFieldValidator
ID
=
"reqTest"
ControlToValidate
=
"txtTest"
ErrorMessage
=
"Required"
runat
=
"server"
></
asp:RequiredFieldValidator
>
<
br
/>
<
telerik:RadSpell
RenderMode
=
"Lightweight"
ID
=
"RadSpell1"
runat
=
"server"
ControlsToCheck
=
"txt1,txt2,txt3"
OnClientCheckFinished
=
"RadSpell1_OnClientCheckFinished"
IsClientID
=
"true"
ButtonType
=
"None"
></
telerik:RadSpell
>
<
asp:Button
ID
=
"btnSave"
Text
=
"Save"
OnClientClick
=
"return check()"
runat
=
"server"
/>
<
asp:Button
ID
=
"btnSaveReal"
Text
=
"Save"
OnClick
=
"btnSave_Click"
style
=
"display:none;"
runat
=
"server"
/>
<
asp:Button
ID
=
"btnDelete"
Text
=
"Delete"
OnClick
=
"btnDelete_Click"
runat
=
"server"
/>
</
div
>
</
form
>
</
body
>
</
html
>
Code Behind:
public partial class test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnSave_Click(object sender, EventArgs e)
{
if (Page.IsValid)
{
Response.Write(txt1.Text);
}
}
protected void btnDelete_Click(object sender, EventArgs e)
{
Response.Write("Delete");
}
}