Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
182 views

Hello,

The Update command does not work when I try to update values inside a RadGrid that resides inside a UserControl.  

The UserControl is loaded into a TabStrip tab when the tab is clicked by the user.  This is the code that loads the user control:

parent.Controls.Clear();
UserControl ctrl = (UserControl)LoadControl(controlName);
string userControlID = controlName.Split('.')[0];
userControlID = userControlID.Replace("/", "").Replace("~", "") + "_UC";
ctrl.ID = userControlID;
parent.Controls.Add(ctrl);

I'm using Advanced Databinding for the Radgrid like so:

protected void rgdHousingVersion_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    rgdHousingVersion.DataSource = BLL.GetAHUHousingVersions();
}

And here's the HTML for the UserControl:

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<telerik:RadAjaxManagerProxy ID="rampAdminHousingVersion" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="rgdHousingVersion">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rgdHousingVersion" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
 
<telerik:RadGrid ID="rgdHousingVersion" runat="server"
    OnNeedDataSource="rgdHousingVersion_NeedDataSource"
    OnEditCommand="rgdHousingVersion_EditCommand" OnUpdateCommand="rgdHousingVersion_UpdateCommand"
    AutoGenerateColumns="false"
    AllowPaging="false">
    <MasterTableView DataKeyNames="HousingID" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage" EditMode="InPlace" EnableViewState="true">
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" EditImageUrl="~/Images/Graphics/16/Change_16.png"></telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn DataField="HousingID" HeaderText="Housing ID" UniqueName="HousingID"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Reference" HeaderText="Reference" UniqueName="Reference"></telerik:GridBoundColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn ButtonType="ImageButton" />
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>

Here's the code-behind for the OnEditCommand and OnUpdateCommand:

protected void rgdHousingVersion_EditCommand(object sender, GridCommandEventArgs e)
{
    //Does fire
}
 
protected void rgdHousingVersion_UpdateCommand(object sender, GridCommandEventArgs e)
{
    //Does NOT fire
}

I'm really not sure what I'm doing wrong.  Why is the UpdateCommand not firing?  Any help is appreciated.  I have not been able to find an answer to this problem anywhere.  Thanks!

 

Kostadin
Telerik team
 answered on 29 Sep 2015
5 answers
156 views
Hi,
I have set 
EnableRangeFiltering="true"
and fetching filter expression as string on ClientEvents>OnCommand event with code as
sender.get_masterTableView().get_filterExpressions().toString()


Output of above is:
([CreatedDate] >= '01,Aug,,2013') AND ([CreatedDate] <= '09,Aug,,2013')

I dont know why that comma(,) appears.
Eyup
Telerik team
 answered on 29 Sep 2015
1 answer
88 views

Hello,

 I have Q1 2015 and I added the RadMap to another project and used it. Now when I created another project I cannot find it to add to the toolbox. I added the Telerik.Web.UI.DLL and then went to choose items for the toolbox and RadMap is no where to be found. How can I get it added so I can use it?

Thanks,

Warren

 

Ianko
Telerik team
 answered on 29 Sep 2015
1 answer
53 views

I am using  external css for editor , but it doesn't work with Mozila , and working fine with Chrome

So, please provide me the solution  for this strange issue

 

 

 

Ianko
Telerik team
 answered on 29 Sep 2015
1 answer
56 views

Hi,

I want to change skin file in my website without affect web.config file. now i declare  <appSettings><add key="Telerik.Skin" value="WebBlue" /></appSettings>. In this case i am not able to change skin without affecting web,config file. if any changes done in web.config file the website should logout. i want this feature?

Please help anyone ASAP,

 

Thanks,

Marin Bratanov
Telerik team
 answered on 29 Sep 2015
4 answers
322 views

Running 2015.2.826.45

This used to work, but we recently changed environments and I am not sure where to check for problems.

<telerik:RadAsyncUpload runat="server" Width="300" SkinID="defaultUpload" ID="uImportFile" OnFileUploaded="fileUploaded" AllowedFileExtensions=".xls,.xlsx"  OverwriteExistingFiles="True" AutoAddFileInputs="False" MaxFileInputsCount="1"                    TargetFolder="~/UploadedFiles" OnClientFileUploadFailed="uploadFailed">
</telerik:RadAsyncUpload>

As soon as the user selects the file to be uploaded, a temp file is created based on the name of the upload in App_Data/RadUploadTemp.  But then a postback happens, the file is removed from RadUPloadTemp, but it not moved into the UploadedFiles folder. â€‹This happens on a production server as well as locally.  I have set permissions on the folder to full control.  Tried Chrome, IE, FireFox and got the same results.  The OnClientUploadFailed event is not firing.  The OnFileUploaded even is firing.  What am I missing?

Thanks,

Randy

Ivan Danchev
Telerik team
 answered on 28 Sep 2015
11 answers
446 views

I've followed the instructions on extending the RadAsyncUploadHandler here, and I've encountered a very similar problem to this thread.

If you implement a custom
AsyncUploadHandler and upload a file it works the first time, but each subsequent time you upload a file it fails with no explanation as why it failed. It works again after IISRESET or process reset. It seems this may have something to do with first upload session not being properly terminated, session or something along those lines. 

It appears that this problematic behavior is also 
occurring on the latest Telerik assemblies too. I've included a simple project that reproduces the said behavior. Could you please let me know how to fix this? I need to use this feature of the RadAsycUpload so I can provide data about the parsed upload file back to the client without full page postback. Please let me know how I can get this working.

Thanks,
-James

[Files]
Project Files
Upload Test File

saravanan
Top achievements
Rank 1
 answered on 28 Sep 2015
5 answers
519 views

I'm fairly new to Telerik so please bear with me.

 

I have two buttons: One does a SQL Insert and the other does a SQL Update, both work correctly as they currently are.  The update button is currently hidden from the user.  What I want to happen is if the user clicks the EditCommand link in the RadGrid, I want the Insert button to hide and the Update button to become visible. My question is - how do you interact with the EditCommand in C#?

Konstantin Dikov
Telerik team
 answered on 28 Sep 2015
1 answer
156 views

Hi Team,

 Please find the below code, the drag and drop event is not firing in the radgrid.

Please give provide me the solutions.

Thanks,

Rajesh

 

<telerik:RadGrid ID="Parts" ClientIDMode="Static" runat="server" AllowPaging="True" AllowSorting="True" ClientSettings-AllowAutoScrollOnDragDrop="true"
AutoGenerateColumns="False" GridLines="None" ShowStatusBar="True" CssClass="Parts" ClientSettings-AllowDragToGroup="true" ClientSettings-AllowRowsDragDrop="true">
<ClientSettings AllowRowsDragDrop="true">
<Selecting AllowRowSelect="True" EnableDragToSelectRows="false" />
</ClientSettings>
<MasterTableView Name="PartsTableView" DataKeyNames="InventoryID" AllowSorting="True" NoDetailRecordsText="No Items" HierarchyLoadMode="ServerBind"
NoMasterRecordsText="No Items Added" CommandItemDisplay="Bottom" EditMode="Batch">
<CommandItemSettings ShowAddNewRecordButton="false" />
<BatchEditingSettings EditType="Cell" />
<DetailTables>
<telerik:GridTableView Name="ComponentDetails" Caption="Component Details" DataKeyNames="InventoryID"
runat="server">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="ParentID" MasterKeyField="InventoryID" />
</ParentTableRelation>
<Columns>
<telerik:GridBoundColumn DataField="ParentID" Display="false" UniqueName="ParentID" />
<telerik:GridBoundColumn DataField="InventoryID" HeaderText="InventoryID" ReadOnly="true"
UniqueName="InventoryID" />
<telerik:GridBoundColumn DataField="FormNumber" HeaderText="Form #" UniqueName="FormNumber" />
<telerik:GridBoundColumn DataField="Description" HeaderText="Description" ReadOnly="true"
UniqueName="Description" Display="True" />
</Columns>
</telerik:GridTableView>
</DetailTables>
<Columns>
<telerik:GridTemplateColumn UniqueName="ThumbNail">
<ItemTemplate>
<asp:Image ID="imgThumbNail" runat="server" ImageUrl='<%#Eval("ImageUrl")%>' />
</ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="InventoryID" UniqueName="FormNumber" Display="false" />
<telerik:GridBoundColumn DataField="Text" HeaderText="Product Code" />
<telerik:GridBoundColumn DataField="Description" Display="false" />
<telerik:GridTemplateColumn UniqueName="Description" HeaderText="Title">
<ItemTemplate>
<asp:Label ID="lblDescription" runat="server" Text='<%#Eval("Description") %>'>
</asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtDescription" runat="server" Text='<%#Eval("Description") %>'>
</asp:TextBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn DataField="Type" Display="false" />
<telerik:GridEditCommandColumn ButtonType="ImageButton" EditText="Edit" UniqueName="EditCommandColumn">
</telerik:GridEditCommandColumn>
<telerik:GridButtonColumn ButtonType="ImageButton"
CommandName="DeleteInventory" Text="Remove" UniqueName="Delete">
<ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle>
<HeaderStyle Width="20px"></HeaderStyle>
</telerik:GridButtonColumn>
<telerik:GridDragDropColumn HeaderStyle-Width="18px" Visible="false">
</telerik:GridDragDropColumn>
</Columns>
</MasterTableView>
<ClientSettings AllowRowsDragDrop="True" AllowColumnsReorder="true" ReorderColumnsOnClient="true">
<Selecting AllowRowSelect="True" EnableDragToSelectRows="false"></Selecting>
<ClientEvents OnRowDropping="demo.onRowDropping"></ClientEvents>
<Scrolling AllowScroll="true" UseStaticHeaders="true"></Scrolling>
</ClientSettings>
</telerik:RadGrid>
<asp:XmlDataSource ID="XMLBookBuilderSource" runat="server" EnableCaching="false">
</asp:XmlDataSource>
<telerik:GridTextBoxColumnEditor ID="GridTextBoxEditor" runat="server" TextBoxStyle-Width="230px"></telerik:GridTextBoxColumnEditor>

 

DragDrop.js:

 

(function ($, undefined) {
var grdPendingOrders;
var grdShippedOrders;

var demo = window.demo = {};

demo.onGridCreated = function (sender, args) {
grdPendingOrders = $telerik.findControl(document, "Parts");
grdShippedOrders = sender;
}
demo.onRowDropping = function (sender, args) {
if (sender.get_id() == Parts.get_id()) {
var node = args.get_destinationHtmlElement();
if (!isChildOf(grdShippedOrders.get_id(), node) && !isChildOf(Parts.get_id(), node)) {
args.set_cancel(true);
}
}
else {
var node = args.get_destinationHtmlElement();
if (!isChildOf('trashCan', node)) {
args.set_cancel(true);
}
else {
if (confirm("Are you sure you want to delete this order?"))
args.set_destinationHtmlElement($get('trashCan'));
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;
};
})($telerik.$);

 

code behind:

-----------------

 

Protected Sub Parts_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles Parts.ItemCommand
If e.CommandName = "DeleteInventory" Then
Dim filename As String = _uploadSystemPath & "tree.xml"
Dim XMLDoc As XDocument = XDocument.Load(_uploadSystemPath & "tree.xml")
XMLDoc.Root.Elements("Node")(e.Item.ItemIndex).Remove()
XMLDoc.Save(filename)
'Parts.DataSource = Nothing
Parts.Rebind()
End If
End Sub
Protected Sub Parts_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs) Handles Parts.NeedDataSource
If File.Exists(_uploadSystemPath & "tree.xml") Then
XMLBookBuilderSource.DataFile = _uploadSystemPath & "tree.xml"
Parts.DataSource = Nothing
Parts.DataSource = XMLBookBuilderSource
End If
End Sub
Protected Sub Parts_UpdateCommand(sender As Object, e As GridCommandEventArgs) Handles Parts.UpdateCommand
If e.CommandName = "Update" Then
Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
Dim strTitle As String = DirectCast(editedItem.FindControl("txtDescription"), TextBox).Text
Dim XMLDoc As XDocument = XDocument.Load(_uploadSystemPath & "tree.xml")
XMLDoc.Root.Elements("Node")(e.Item.ItemIndex).SetAttributeValue("Description", strTitle)
XMLDoc.Save(filename)
Parts.Rebind()
End If
End Sub
Protected Sub Parts_RowDrop(sender As Object, e As GridDragDropEventArgs) Handles Parts.RowDrop
Dim i As Integer = e.DropPosition
End Sub

Viktor Tachev
Telerik team
 answered on 28 Sep 2015
3 answers
103 views

Hi,

 

In our CMS I always used

 

RadFileExplorer1.Upload.Width = 440

This now breaks the FileExplorer in newest dll 4.5

Amending it to RadFileExplorer1.Upload.Width = Unit.Pixel(440)

 

to no avail...

 

Marc

Vessy
Telerik team
 answered on 28 Sep 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?