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

I really like the popup window that is used in the RadFileExplorer control. The look and feel and all that.

 

I was wondering if it's possible to re-use this popup window with the RadGrid. For each row, I have a column for a specific file attachment. Ideally I would like to have a image button column that when clicked, will popup the upload window. Once the user does their thing and close the window, the Radgrid would refresh. 

 

I would prefer not to create my own custom page for the async upload.

Is this possible?

Vessy
Telerik team
 answered on 26 Apr 2021
1 answer
949 views

I ran into an issue where I needed the Checkbox column of my radgrid to look like it was enabled (because it was hard to see the disabled checkboxes), but not act like it was enabled.

The reason I'm posting this here is because I couldn't find any easy solution on the internet or forum searches.

The first thing I did was not use a GridCheckboxColumn, I used a GridTemplateColumn with a checkbox template.

I then put onclick="return false;" in the checkbox attributes so that it doesn't do anything - effectively disabling the checkbox.

Here's the code in case it can help someone else:

<telerik:GridTemplateColumn DataField="MyDataField" DataType="System.Boolean" FilterControlAltText="Filter MyDataField column" HeaderText="My Data Field" SortExpression="MyDataField" UniqueName="MyDataField" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true">
         <ItemTemplate>
             <asp:CheckBox ID="MyDataField" Checked='<%# Eval("MyDataField") %>' runat="server"  onclick="return false;"  />
         </ItemTemplate>
</telerik:GridTemplateColumn>

 

 

 

 

Attila Antal
Telerik team
 answered on 26 Apr 2021
12 answers
3.7K+ views

Hi,

 

Yesterday I discovered in the web.config on one of our webs the following:

 

<add name="Telerik_Web_UI_DialogHandler_aspx" path="me.hochalla.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode" />

 

normally this is:

 

<add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode" />

 

What do you think this is?

Strangest thing is I removed the line yesterday but now it is in again.

Please respond soonest.

Marc

Rumen
Telerik team
 answered on 26 Apr 2021
7 answers
319 views
Hi,
I am facing issue to get uploaded file from FileUpload control embeded in a popup dialog box. This popup is rendered using EditFormSettings
for RadGrid.

My RadGrid look like this:

DocumentList.aspx
<telerik:RadGrid ID="RadGridDocuments" runat="server" Visible="true"
        Skin="Simple" EnableEmbeddedSkins="false" CssClass="CustomGrid"
        OnInsertCommand="RadGridDocuments_InsertCommand">
    <MasterTableView CommandItemDisplay="Top" DataKeyNames="DocumentId" EditMode="PopUp">
        <CommandItemTemplate>
            <table class="rgCommandTable" style="width: 100%;" cellpadding="0" cellspacing="0" border="0" id="customGridHeader">
            <tr>
                <td align="right" class="block-title">
                    <asp:Button runat="server" ID="buttonAddNewRecord" CommandName="InitInsert" CssClass="rgAdd" Text=" " Visible="true" />
                    <asp:LinkButton runat="server" ID="linkbuttionInitInsert" CommandName="InitInsert" CommandArgument="TestPlan" Text="Upload Document" Visible="true"></asp:LinkButton>
                </td>
            </tr>
            </table>
        </CommandItemTemplate>
        <Columns>
            <telerik:GridBoundColumn UniqueName="DocumentName" HeaderText="Document Name" DataField="DocumentName" ItemStyle-Width="350px"></telerik:GridBoundColumn>
            <telerik:GridButtonColumn UniqueName="DeleteColumn" CommandName="Delete" Text="Delete" ConfirmDialogType="Classic" ConfirmText="Are you sure you want to delete this document?" ItemStyle-Width="10px" ItemStyle-CssClass="rgAction"></telerik:GridButtonColumn>
        </Columns>
        <EditFormSettings InsertCaption="Upload Document" EditFormType="WebUserControl" PopUpSettings-Modal="true" UserControlName = "~/UserControls/UploadDocument.ascx">
            <FormTemplate>
            </FormTemplate>
        </EditFormSettings>                   
    </MasterTableView>
    <ClientSettings>
        <ClientEvents OnPopUpShowing="PopUpShowing" />
    </ClientSettings>               
</telerik:RadGrid>

UploadDocument.ascx
<asp:FileUpload runat="server" ID="fileUploadDocument" Width="220px" />
<asp:Button ID="buttonUpload" Text="Upload" runat="server"
    CausesValidation="true" CommandName="Upload" Width="80px"
    onclick="buttonUpload_Click"></asp:Button>

When I hit Upload button, page is properly postback but I unable to get uploaded file in buttonUpload_Click event of the button. fileUploadDocument.PostedFile property is showing null in this event.

Please advice.

Thanks very much in advance for your help.
John
Top achievements
Rank 1
 answered on 26 Apr 2021
5 answers
474 views
I have sserious problem. I have placed a grid with an EditInForm. In the form one of the fields is a template form that has a FileUpload control. I want to read and save the file name then save the path to the database. My problem is that I cannot locate the FileUpload control in the itemcommand event handler. HELP!

 

<rad:GridTemplateColumn DataField="Attachment" FilterImageUrl="\\we03vdchc\RadControls\Skins\Vista\Filter.gif"

 

 

HeaderText="Attachment" SortAscImageUrl="\\we03vdchc\RadControls\Skins\Vista\SortAsc.gif"

 

 

SortDescImageUrl="\\we03vdchc\RadControls\Skins\Vista\SortDesc.gif" UniqueName="Attachment" ColumnEditorID="Attachment">

 

 

<EditItemTemplate>

 

 

<asp:FileUpload ID="detailFileAttachmentUL" runat="server" />

 

 

<asp:Label ID="attachNameLBL"

 

 

runat="server" Text='<%# Bind("Attachment") %>'>

 

 

</asp:Label><br />

 

 

<asp:LinkButton ID="attachLB"

 

 

runat="server"

 

 

CommandArgument='<%# Bind("MuniTransactionID") %>'

 

 

CommandName="AttachDetailDoc"

 

 

OnCommand="attachLB_Command"

 

 

Text="Attach Document"></asp:LinkButton>

 

 

</EditItemTemplate>

 

 

</rad:GridTemplateColumn>

 

 

</Columns>

 


I have not posted the entire control because of the size. Any help on the code behind would be appreciated.
John
Top achievements
Rank 1
 answered on 26 Apr 2021
1 answer
144 views

I have a telerik :RadGrid in my project with a Master, Detail configuration. Both Master and Detail tables are have EditMode='Batch'

 I need to dynamically set some columns to readonly on a per row basis. I used BatchEditOpening() to acheive this by setting args._cancel to true on the columns that need to be read only. There is more logic to determine the editability than in the example but the end result is the same: setting args._cancel = true if the field needs to be not editable. 

To replicate the issue:

click the built in 'Add new record' button 3 times. 3 rows are created as expected. 

Then click any where in any of those rows, which should open the row for edit which it does. An error in the telerik function _openCellinEditMode()

It calls this function for the cells that were set to args._cancel = true in the BatchEditOpeining function. The _openCellinEditMode function fails when the following line is executed if (o && $telerik.getElementByClassName(o.cell, e).style.display === "")  because there is no element with the rgBatchContainer class that it is looking for because this cell is no longer editable. 

Is anyone aware of this issue? and is there a workaround / fix for it?

If I take the code out of the  BatchEditOpening function, the error does not occur. It also doesnt occur as each row is added. I have stepped through the code and for each new row added it only calls _openCellinEditMode() for the appropriate editable columns. Then when you click on a cell to edit it will fail by calling the function for a column that has edit cancelled.

 

 

function BatchEditOpening(sender, args) {
                var row = args.get_row();
                //var cell = args.get_cell();
                tableView = args.get_tableView();
                //var column = args.get_column();
                var columnUniqueName = args.get_columnUniqueName();
                args._cancel = false;
 
                var rowstatus = '';
                 
                  if (columnUniqueName == "NotEditableColumn") {
                    args._cancel = true;
                }
 
            }

 

 

_openCellInEditMode: function(q) {
           var u = this;
           var n = q.cell;
           var s = u._getEditorControlsContainer(q.tableView, q.column.get_uniqueName(), n);
           var r = u._getDataControl(s);
           var t = s.parentNode;
           var p = u._getSetCellValue(n);
           var o;
           if (t.tagName.toLowerCase() === "td" || (u._currentlyEditedRow && n.parentNode.id !== u._currentlyEditedRow.id)) {
               if (u._currentlyEditedRow && n.parentNode.id !== u._currentlyEditedRow.id) {
                   t = u._currentlyEditedRow.cells[n.cellIndex];
               }
               o = u._getCellDataToOpenEdit(t);
               if (o && $telerik.getElementByClassName(o.cell, e).style.display === "") {
                   if (!u._updateCellValue(o)) {
                       return false;
                   }
                   u._currentlyEditedCellInfo = null;
               }
           }
Attila Antal
Telerik team
 answered on 23 Apr 2021
7 answers
447 views
Dear All,

Is that a possible way that I can pull the exact function of the "Refresh" as shown in the attachment?

Thank you and Regards.
Prof. Francisco Araújo
Top achievements
Rank 2
Iron
 answered on 22 Apr 2021
2 answers
499 views

Hello, new to Telerik and have what I think it a pretty basic question.

I've inherited a site where the business wants some more functionality on the page.  One of the items is to make it more reactive.  Telerik looks like it has some great options.  My challenge is, the current page calls a sp that returns multiple unnamed tables.

I can connect the grid to it fine and it binds to the first table (as I understand is the default behavior)  

Can someone please tell me how I can reference the subsequent tables via index?

I think it's something like below to get the 4th table from the SP for example but when I run it, I get:

Type 'System.Web.UI.WebControls.SqlDataSource' does not have a public property named 'DataSource'.

 

can someone please point me in the right direction?

thank you for your help

Paul

 

 

        <asp:SqlDataSource ID="AvailablePlans" DataSource ="[3]" runat="server" ConnectionString="<%$ ConnectionStrings:///////////////// %>" SelectCommand="ListDataForElections" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:Parameter DefaultValue="123456" Name="customer_id" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>

Paul
Top achievements
Rank 1
 answered on 22 Apr 2021
2 answers
166 views

Greetings to all, 

Quick question:

Is the overflow property always set to "hidden" according to your framework?  I've been commissioned to work on a project that is using Telerik.

I need to set it up to "visible" because it's eating up a tab menu after the user clicks on a anchor hyperlink type of link on the bottom pane. 

 

Nothing is set up on <telerik:RadPane ID="radPaneBottom" runat="server" Width="100%" height="64%"  OnClientLoaded="SplitterLoaded"  scrolling="None"   >

that points out to the overflow being directly set to "hidden" but looking using the inspect option for browser debugging, there is a div container named: 

 

<div id="RAD_SPLITTER_PANE_CONTENT_radPaneBottom" style="width: 434px; height: 510px; overflow: hidden;"> 

If I set the overflow to 'visible' on the debugger (Elements) from google chrome, then the problem is gone.

 

Is there something I am missing here? Would there be a RadPane property that would allow me to set the overflow to "visible"?

 

Please advice.

Vessy
Telerik team
 answered on 22 Apr 2021
5 answers
2.5K+ views

On my web application I need to offer users a way to print a pane, and I have been using the javascript function to do that( https://docs.telerik.com/devtools/aspnet-ajax/controls/splitter/panes/printing-content ). But the problem is that there is a popup of the pane contents that remains after they have finished printing. And this can be confusing for some people as they may still think the popup is an editable form.

I have been using the code from this forum post: https://www.telerik.com/forums/radpane-close-after-print 

But it only works on IE, which is now obsolete and removed from all of our employee's machines. On Chrome and Edge it will simply try to print a blank page, as the print dialog appears before the popup is actually rendered.

Is there any solution for this that works properly on Edge and Chrome?

 

 

 

Vessy
Telerik team
 answered on 22 Apr 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?