<telerik:RadAsyncUpload ID="fuImport" runat="server" HttpHandlerUrl="~/CustomHandler.ashx" OnClientFileUploaded="onClientFileUploaded" PersistConfiguration="true" MaxFileInputsCount="1" MultipleFileSelection="Disabled" OnClientFileSelected="CheckExtension" CssClass="jImport" OnClientAdded="onClientAdded" Style="display: none"></telerik:RadAsyncUpload><add key="Telerik.EnableEmbeddedScripts" value="false"/>var $fileInput;function onClientAdded(sender, args) { if (sender.get_id() != undefined && sender.get_id() == 'fuImport') { //get file control instance from telerik upload control. $fileInput = $(".jImport").find(".ruFileInput"); }}//check selected file is valid or not.function CheckExtension(radUpload, eventArgs) { var input = eventArgs.get_fileInputField(); var fileExtension = input.value.substr(input.value.length - 3, 3); if (fileExtension != "xml") { alert(input.value + " does not have a valid extension."); radUpload.deleteFileInputAt(0); } }function ImportData() { if ($fileInput != null) { //open dialog box for file selection. $fileInput.click(); } }
function onClientFileUploaded(sender, args) {
//check file is uploaded properly then perform import process.
if (sender.getUploadedFiles().length > 0) {
$(".jImport").css('display', 'none');
$('.jImportButton').click();
}
} Hi Telerik team, I have the following problem.
I'm using Drag and drop in my solution and works perfect, but I have the option to UPDATE the RadGrid (original) from a RadWindow.
I don't know where is the problem, because in other radgrid without drag and drop works perfect,here is my code:
This is the main page:
<
telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="Gridfungenericasoriginal" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="Gridfungenericasoriginal">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="Gridfungenericasoriginal" />
<telerik:AjaxUpdatedControl ControlID="Gridfungenericascopia" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="Gridfungenericascopia">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="Gridfungenericascopia" />
<telerik:AjaxUpdatedControl ControlID="msggenericas" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<div>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function ShowCatalogoGenericas()
{
window.radopen(
"Default4.aspx", "UserListDialog");
return false;
}
function refreshGrid(arg)
{
if(!arg)
{
$find(
"<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
}
else
{
$find(
"<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
}
}
</script>
</telerik:RadCodeBlock>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
<Windows>
<telerik:RadWindow ID="UserListDialog" runat="server" Title="Editing record" Height="400px"
Width="300px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" />
</Windows>
</telerik:RadWindowManager>
<asp:Button ID="Button3" runat="server" Text="genericas" OnClientClick="return ShowCatalogoGenericas();" /><br />
<div>
<telerik:RadScriptBlock runat="server" ID="scriptBlockGenericas">
<script type="text/javascript">
<!--
function onRowDroppingGenericas(sender,args) {
if(sender.get_id()=="<%=Gridfungenericasoriginal.ClientID %>") {
var node=args.get_destinationHtmlElement();
if(!isChildOf('<%=Gridfungenericascopia.ClientID %>',node)&&!isChildOf('<%=Gridfungenericasoriginal.ClientID %>',node)) {
args.set_cancel(
true);
}
}
else {
var node=args.get_destinationHtmlElement();
if(!isChildOf('trashCanGenericas',node)) {
args.set_cancel(
true);
}
else {
if(confirm("¿Eliminar datos?"))
args.set_destinationHtmlElement($get(
'trashCanGenericas'));
else
args.set_cancel(
true);
}
}
}
function isChildOf(parentId,element) {
while(element) {
if(element.id&&element.id.indexOf(parentId)> -1) {
return true;
}
element=element.parentNode;
}
return false;
}
-->
</script>
</telerik:RadScriptBlock>
<div style="float:left; padding:0 6px 0 10px">
<telerik:RadGrid ID="Gridfungenericasoriginal" runat="server" AllowMultiRowSelection="True" AllowFilteringByColumn="True" Width="430px" Font-Bold="True" Font-Names="Tahoma" Font-Size="Small" OnNeedDataSource="Gridfungenericasoriginal_NeedDataSource" OnRowDrop="Gridfungenericasoriginal_RowDrop" OnColumnCreated="Gridfungenericasoriginal_ColumnCreated">
<MasterTableView DataKeyNames="clave_divis,clave_pues,clave_funcion_generica,grupo_orga" TableLayout="Fixed" NoMasterRecordsText="No hay datos para mostrar." Font-Bold="True" Font-Names="Tahoma" Font-Size="X-Small" CommandItemDisplay="Top">
<HeaderStyle Font-Bold="True" Font-Names="Tahoma" Font-Size="Small" />
<FooterStyle Font-Bold="True" Font-Names="Tahoma" Font-Size="Medium" />
<ItemStyle Font-Bold="True" Font-Names="Tahoma" Font-Size="X-Small" />
</MasterTableView>
<ClientSettings AllowRowsDragDrop="True">
<Selecting AllowRowSelect="True" EnableDragToSelectRows="False"/>
<ClientEvents OnRowDropping="onRowDroppingGenericas" />
<Scrolling AllowScroll="True" UseStaticHeaders="True"/>
<DataBinding FilterParameterType="String" SortParameterType="String">
</DataBinding>
</ClientSettings>
</telerik:RadGrid>
</div>
<br />
<div style="float:right; padding:0 10px 0 6px; font-weight: bolder; color: black;">
Para agregar funcion generica a este perfil arrastre elementos de la tabla izquierda.
<br />
<telerik:RadGrid ID="Gridfungenericascopia" runat="server" AllowMultiRowSelection="True" GridLines="None" Width="400px" OnNeedDataSource="Gridfungenericascopia_NeedDataSource" OnRowDrop="Gridfungenericascopia_RowDrop" OnColumnCreated="Gridfungenericascopia_ColumnCreated">
<MasterTableView DataKeyNames="clave_divis, clave_pues,clave_funcion_generica, grupo_orga" HeaderStyle-Font-Bold="true" HeaderStyle-Font-Names="Tahoma" HeaderStyle-Font-Size="Small" ItemStyle-Font-Bold="true" ItemStyle-Font-Names="Tahoma" ItemStyle-Font-Size="Small" Font-Bold="true" Font-Names="Tahoma" Font-Size="Small">
<NoRecordsTemplate>
<div style="height: 30px; cursor: pointer;">
No hay datos para mostrar
</div>
</NoRecordsTemplate>
<HeaderStyle Font-Bold="True" Font-Names="Tahoma" Font-Size="Small" />
</MasterTableView>
<ClientSettings AllowRowsDragDrop="True">
<Selecting AllowRowSelect="True" EnableDragToSelectRows="False" />
<ClientEvents OnRowDropping="onRowDroppingGenericas" />
<Scrolling AllowScroll="True" UseStaticHeaders="True" />
</ClientSettings>
</telerik:RadGrid>
</div>
<br />
<br />
<br />
<div style="clear: both;">
<!-- -->
</div>
<div class="exFooter">
<br />
<a id="trashCanGenericas" href="#" onclick="return false;">Papelera de reciclaje</a>
<div class="exMessage" runat="server" id="msggenericas" visible="false" enableviewstate="false">
Dato(s) eliminados con exito
</div>
</div>
</div>
</div>
protected
void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
if (e.Argument == "Rebind")
{
Gridfungenericasoriginal.MasterTableView.SortExpressions.Clear();
Gridfungenericasoriginal.MasterTableView.GroupByExpressions.Clear();
Gridfungenericasoriginal.Rebind();
}
else if (e.Argument == "RebindAndNavigate")
{
Gridfungenericasoriginal.MasterTableView.SortExpressions.Clear();
Gridfungenericasoriginal.MasterTableView.GroupByExpressions.Clear();
Gridfungenericasoriginal.MasterTableView.CurrentPageIndex = Gridfungenericasoriginal.MasterTableView.PageCount - 1;
Gridfungenericasoriginal.Rebind();
}
}
And here is my RadWindow to edit Gridfungenericasoriginal (drag and drop)
<
script type="text/javascript">
function CloseAndRebind(args)
{
GetRadWindow().Close();
GetRadWindow().BrowserWindow.refreshGrid(args);
}
function GetRadWindow()
{
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow;
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return oWindow;
}
function CancelEdit()
{
GetRadWindow().Close();
}
</script>
<br />
<br />
<telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticUpdates="True" AllowPaging="True"
AutoGenerateEditColumn="True" DataSourceID="SqlDataSource1" GridLines="None" OnItemUpdated="RadGrid1_ItemUpdated">
<MasterTableView AutoGenerateColumns="False" DataKeyNames="clave_divis,grupo_orga,clave_pues,clave_funcion_generica"
DataSourceID="SqlDataSource1">
<RowIndicatorColumn>
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<Columns>
<telerik:GridBoundColumn DataField="clave_divis" HeaderText="clave_divis" ReadOnly="True"
SortExpression="clave_divis" UniqueName="clave_divis">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="grupo_orga" DataType="System.Int32" HeaderText="grupo_orga"
ReadOnly="True" SortExpression="grupo_orga" UniqueName="grupo_orga">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="clave_pues" HeaderText="clave_pues" ReadOnly="True"
SortExpression="clave_pues" UniqueName="clave_pues">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="clave_funcion_generica" DataType="System.Int32"
HeaderText="clave_funcion_generica" ReadOnly="True" SortExpression="clave_funcion_generica"
UniqueName="clave_funcion_generica">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="puesto" HeaderText="puesto" SortExpression="puesto"
UniqueName="puesto">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="funcion_generica" HeaderText="funcion_generica"
SortExpression="funcion_generica" UniqueName="funcion_generica">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:perfiles_dnConnectionString %>"
ProviderName="<%$ ConnectionStrings:perfiles_dnConnectionString.ProviderName %>"
SelectCommand="SELECT * FROM funciones_genericas" UpdateCommand="UPDATE funciones_genericas SET funcion_generica=@funcion_generica WHERE clave_divis=@clave_divis AND grupo_orga=@grupo_orga AND clave_pues=@clave_pues AND clave_funcion_generica=@clave_funcion_generica">
</asp:SqlDataSource>
protected
void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
{
ClientScript.RegisterStartupScript(Page.GetType(),
"mykey", "CloseAndRebind();", true);
}
please help me.
Thanks in advance.

I am using radtree view in my application.
I have a scenario in that on one tab selection the tree should show checkboxes & on other tab It shouldn’t display the check boxes.
Which I am handling through the tree.CheckBoxes Property making it true or false I am not even binding the tree again.
But at that time trees checkboxes is losing its state.(i.e. whatever nodes I have selected become unselected when I come to previous tab)
Is there any way to maintain the state of checkboxes of tree?
Thanks in advance


<telerik:GridTemplateColumn UniqueName="Notes">
<ItemTemplate>
<asp:Label ID="test" runat="server" Text='<%# Eval("NOTE_DESC") %>' />
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="tnotes" runat="server" TextMode="MultiLine" Text='<%# Bind("NOTE_DESC") %>' Width="300px" Height="200px">
</telerik:RadTextBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
Am I missing some settings here.
Thanks
Hi Team,
I need to get the GridBoundColumn values into the new record row when we click the Add Record button.
I am able to find the previous values of lables under GridTemplateColumn but above mention is not clear.
Please let me know how it could be handled.
Regards
SS Bhogal
<PlotArea XAxis-LayoutMode="Normal">
<XAxis LayoutMode="Normal" Appearance-ValueFormat="Currency" Appearance-EndCap="AnchorMask" Visible="True" VisibleValues="Positive">
<AxisLabel><TextBlock Text="Actual Price" Appearance-Position-AlignedPosition=Bottom Visible="true" Appearance-Border-PenStyle="Solid" Appearance-FillStyle-MainColor="Black"></TextBlock></AxisLabel>
</XAxis>
<YAxis AxisMode="Extended" Appearance-ValueFormat="Currency" Appearance-EndCap="AnchorMask" Visible="True" VisibleValues="Positive">
<AxisLabel><TextBlock Text="Predicted Price" Appearance-Position-AlignedPosition=Bottom Visible="true" Appearance-Border-PenStyle="Solid" Appearance-FillStyle-MainColor="Black"></TextBlock></AxisLabel>
</YAxis>
</PlotArea>
I am baffled, no matter how I set it, the labels just dont show up.
Any suggestions would be appreciated.
Thanks
Amol Ajgaonkar
| <form id="form1" runat="server"> |
| <asp:ScriptManager ID="ScriptManager1" runat="server"> |
| </asp:ScriptManager> |
| <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Width="100%"> |
| <Items> |
| <telerik:RadPanelItem runat="server" Text="Panel 1" Expanded="true"> |
| <Items> |
| <telerik:RadPanelItem runat="server" Expanded="true"> |
| <ItemTemplate> |
| some text and controls some text and controls |
| <br /> |
| some text and controls some text and controls |
| <br /> |
| <telerik:RadPanelBar ID="RadPanelBar2" runat="server" Width="100%"> |
| <Items> |
| <telerik:RadPanelItem runat="server" Text="Sub Panel 1" Expanded="true"> |
| <Items> |
| <telerik:RadPanelItem runat="server" Expanded="true"> |
| <ItemTemplate> |
| some text and controls some text and controls |
| <br /> |
| some text and controls some text and controls |
| <br /> |
| </ItemTemplate> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelBar> |
| some text and controls some text and controls |
| <br /> |
| some text and controls some text and controls |
| <br /> |
| </ItemTemplate> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelItem> |
| </Items> |
| </telerik:RadPanelBar> |
| </form> |