Quantcast
Channel: Telerik Forums RSS
Viewing all 94857 articles
Browse latest View live

EditForm Template editedItem FindControl doesn't work

$
0
0

I am still not able to retrieve new value from edit form template. Please help.

If e.CommandName = "Update" Then
            Try
                If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
                    Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)
                    Dim OprCount As TextBox = CType(editedItem.FindControl("txtOprCount"), TextBox)
                    Dim strRcvCount As String = OprCount.Text
                    MsgBox(strRcvCount)
                    Exit Sub
                    Dim strUserName As String = Session("USERNAME")
                    Dim strSYSID As String = rgRtnDetail.MasterTableView.DataKeyValues(e.Item.ItemIndex)("SYS_ID")

                    strSQlData = "EXECUTE SP_IB_RETURNS_DET_UPDATE '" & strUserName & "' ,'" & strSYSID & "', '" & strRcvCount & "'"

                    Dim errcode As String
                    Dim nRecCount As Integer

                    Dim myCommand As New SqlCommand(strSQlData, oConn)
                    Dim da = New SqlDataAdapter(strSQlData, oConn)
                    Dim ds = New DataSet
                    da.Fill(ds, "ERROR")
                    dt = ds.Tables(0)
                    nRecCount = dt.Rows.Count

                    Response.Redirect(Request.RawUrl)
                End If
            Catch ex As Exception
                RadWindowManager1.RadAlert("Problem Updating the Record!", 250, 150, "ERROR", "")
            End Try
        End If

 


EditForm Template editedItem FindControl doesn't work

$
0
0

I am still not able to resolve this. Textbox of edit form template nottaking the latest value to update.

 

If e.CommandName = "Update" Then
            Try
                If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
                    Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)
                    Dim OprCount As TextBox = CType(editedItem.FindControl("txtOprCount"), TextBox)
                    Dim strRcvCount As String = OprCount.Text
                    MsgBox(strRcvCount)
                    Exit Sub
                    Dim strUserName As String = Session("USERNAME")
                    Dim strSYSID As String = rgRtnDetail.MasterTableView.DataKeyValues(e.Item.ItemIndex)("SYS_ID")

                    strSQlData = "EXECUTE SP_IB_RETURNS_DET_UPDATE '" & strUserName & "' ,'" & strSYSID & "', '" & strRcvCount & "'"

                    Dim errcode As String
                    Dim nRecCount As Integer

                    Dim myCommand As New SqlCommand(strSQlData, oConn)
                    Dim da = New SqlDataAdapter(strSQlData, oConn)
                    Dim ds = New DataSet
                    da.Fill(ds, "ERROR")
                    dt = ds.Tables(0)
                    nRecCount = dt.Rows.Count

                    Response.Redirect(Request.RawUrl)
                End If
            Catch ex As Exception
                RadWindowManager1.RadAlert("Problem Updating the Record!", 250, 150, "ERROR", "")
            End Try
        End If

EditForm Template editedItem FindControl doesn't work

EditForm Template editedItem FindControl doesn't work

$
0
0
If e.CommandName = "Update" Then
            Try
                If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
                    Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)
                    Dim OprCount As TextBox = CType(editedItem.FindControl("txtOprCount"), TextBox)
                    Dim strRcvCount As String = OprCount.Text
                    MsgBox(strRcvCount)
                    Exit Sub
                    Dim strUserName As String = Session("USERNAME")
                    Dim strSYSID As String = rgRtnDetail.MasterTableView.DataKeyValues(e.Item.ItemIndex)("SYS_ID")

                    strSQlData = "EXECUTE SP_IB_RETURNS_DET_UPDATE '" & strUserName & "' ,'" & strSYSID & "', '" & strRcvCount & "'"

                    Dim errcode As String
                    Dim nRecCount As Integer

                    Dim myCommand As New SqlCommand(strSQlData, oConn)
                    Dim da = New SqlDataAdapter(strSQlData, oConn)
                    Dim ds = New DataSet
                    da.Fill(ds, "ERROR")
                    dt = ds.Tables(0)
                    nRecCount = dt.Rows.Count

                    Response.Redirect(Request.RawUrl)
                End If
            Catch ex As Exception
                RadWindowManager1.RadAlert("Problem Updating the Record!", 250, 150, "ERROR", "")
            End Try
        End If

EditForm Template editedItem FindControl doesn't work

$
0
0

If e.CommandName = "Update" Then
            Try
                If (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
                    Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)
                    Dim OprCount As TextBox = CType(editedItem.FindControl("txtOprCount"), TextBox)
                    Dim strRcvCount As String = OprCount.Text
                    MsgBox(strRcvCount)
                    Exit Sub
                    Dim strUserName As String = Session("USERNAME")
                    Dim strSYSID As String = rgRtnDetail.MasterTableView.DataKeyValues(e.Item.ItemIndex)("SYS_ID")

                    strSQlData = "EXECUTE SP_IB_RETURNS_DET_UPDATE '" & strUserName & "' ,'" & strSYSID & "', '" & strRcvCount & "'"

                    Dim errcode As String
                    Dim nRecCount As Integer

                    Dim myCommand As New SqlCommand(strSQlData, oConn)
                    Dim da = New SqlDataAdapter(strSQlData, oConn)
                    Dim ds = New DataSet
                    da.Fill(ds, "ERROR")
                    dt = ds.Tables(0)
                    nRecCount = dt.Rows.Count

                    Response.Redirect(Request.RawUrl)
                End If
            Catch ex As Exception
                RadWindowManager1.RadAlert("Problem Updating the Record!", 250, 150, "ERROR", "")
            End Try
        End If

 

Tri-State RadConfirm

$
0
0

Personally, I think this is absolutely a horrible solution to this problem.

 

Anyway, for me I need to add a third button to a RadWindow.Confirm dialog. I have a custom template in a style already, I can easily add the third button. What I'm not sure about is how I can add a clicked event handler to that third dialog button. Any suggestions? Thanks.

Multiple RadHtmlChart user controls with drill-downs on same page

$
0
0
Hello,

The following article explains how you can trigger the ajaxRequest() from the client through the RadAjaxManager, but handle the server event in the user control: https://docs.telerik.com/devtools/aspnet-ajax/controls/ajaxmanager/how-to/radajax-and-webusercontrols.

An alternative is to use hidden buttons on the user controls that will do the postbacks. Something like this:

<!-- on the user control itself -->
<telerik:RadAjaxManagerProxy runat="server" ID="ramp1">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btn1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rhc1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
<asp:Button Text="" style="display: none;" ID="btn1" OnClick="btn1_Click" runat="server" />
<telerik:RadHtmlChart runat="server" ID="rhc1"></telerik:RadHtmlChart>
<script>
    function drillDownChart_<%=this.ClientID%>() {
        __doPostBack("<%=btn1.UniqueID%>", "");
        //OR something like
        document.getElementById("<%=btn1.ClientID%>").click();//you can use any DOM traversal here to get the button from the current DOM, like during the chart seriesClick event
    }
 
    //the way the function above is called depends entirely on the project logic/architecture
    function theGenericHandlerDispatchingDrilldowns() {
        drillDownChart_<%=this.ClientID%>();
    }
</script>
protected void btn1_Click(object sender, EventArgs e)
{
    //do the drilldown with the chart here
}

Ultimately, there are many different ways to invoke a postback or get new data from the server and it mostly depends on the project. The chart drilldown example is merely a postback that includes the chart in the response and changes its settings/series/data on the server, so you can implement this in any way suitable for your case, it does not have to be a RadAjaxManager.

 

Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.

Table Item That Contains Unique List

$
0
0
Attached is a picture of what I'd like to accomplish. Below, I have listed two CSV data sources that emulate what is getting returned from each query.

TASK_TABLE:

TASK_TITLE,ASSESSMENT_ID,ASSESSMENT_TASK_ID,DESCR
TASK_TITLE1,5,19,Some additional field that gets pulled from TASK_TABLE. It is TASK_ID specific, but is not a list like EXPOSURE_CODE.
TASK_TITLE2,5,20,Some additional field that gets pulled from TASK_TABLE. It is TASK_ID specific, but is not a list like EXPOSURE_CODE.
TASK_TITLE3,5,21,Some additional field that gets pulled from TASK_TABLE. It is TASK_ID specific, but is not a list like EXPOSURE_CODE.

SUB_TASK_TABLE:

TASK_ID,EXPOSURE_CODES
19,EXPOSURE_CODE1
19,EXPOSURE_CODE2
19,EXPOSURE_CODE3
20,EXPOSURE_CODE2
20,EXPOSURE_CODE5
20,EXPOSURE_CODE6



Adding content to exported pdf, on the last page

$
0
0

Hi,

Is there a way to add content to the end of a pdf document? I wish to show a signature at the end of the document only. Every time I try this, the signature is added at the end of every page. I only want to show it on the last page. Is this possible?

I am using the pdf export from the kendo ui grid.

radgrid custom grouping when custom paging

$
0
0
Hi Himanshu,

The built-in filtering of RadGrid for ASP.NET AJAX requires that it has all the records and then it uses filtering in-memory. Thus, optimizing the data retrieval logic is the best way to optimize those queries.

Alternatively, you can use the ItemCommand event, capture the filter command and cancel the event, so you can .Rebind() the grid and filter the data prior to giving it to the grid so you can perform the filtering operations as your data source level. You can find the basics in the following article: https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/how-to/Filtering/operate-with-the-filterexpression-manually.

Another approach is to use RadFilter to build up a query for the SqlDataSource (or other declarative data source): https://demos.telerik.com/aspnet-ajax/filter/examples/integration/defaultcs.aspx?product=filter.

A third approach is to build up a set of filter controls that provide filter parameters to the data source, like the combo box is used in this example: https://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridcomboajax/defaultcs.aspx?product=combobox.


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.

Failing to correctly position pie chart labels

$
0
0
Hello, 
Please review the following dojo: https://dojo.telerik.com/EFuQANOF/2 
As you can see the upper labels look good (correct distance from chart as we need them to be) but the lower labels are incorrectly positioned over the chart itself.


It looks better in this other dojo: https://dojo.telerik.com/oWAWilAt 
But here we do not want the lines to be shown at all (we want the numbers to “float” next to the chart, like in the first dojo).


Can you please advise how we may fix the lower labels position of the first dojo so they will not override the chart but instead will appear outside the chart, similarly to the uppper labels?


Thanks

Delete Row

$
0
0
Hi Nina,

The .deleteRow() method only takes an index and it is up to the developer to decide what index to pass to it, it cannot determine that on its own: https://docs.telerik.com/kendo-ui/api/javascript/spreadsheet/sheet/methods/deleterow. The definition of "correct" is up to the project's logic.

If you want to prevent the deletion of rows based on a condition, you should use the deleteRow event: https://docs.telerik.com/kendo-ui/api/javascript/ui/spreadsheet/events/deleterow. Here's how to attach it after the widget initialization: https://docs.telerik.com/kendo-ui/intro/widget-basics/events-and-methods#event-binding-after-initialization. Here's an example:

<telerik:RadSpreadsheet runat="server" ID="RadSpreadsheet1">
</telerik:RadSpreadsheet>
<script>
    Sys.Application.add_load(function () {
        var kSpreadsheet = $find("<%=RadSpreadsheet1.ClientID%>").get_kendoWidget();
        kSpreadsheet.bind("deleteRow", onDeleteRow);
    });
 
    function onDeleteRow(arg) {
        //see the event arguments here and how to cancel it:
 
        arg.preventDefault();
 
        console.log("The row at index " + arg.index + " on sheet " + arg.sheet.name() + " was about to be deleted but the code prevented it");
         
    }
</script>
which can work with the built-in commands on a customized menu as well:

<telerik:RadSpreadsheet runat="server" ID="RadSpreadsheet1">
       <ContextMenus>
        <CellContextMenu OnClientItemClicked="CellContextMenuItemClicked">
            <Items>
                <telerik:RadMenuItem Text="Copy" Value="CommandCopy"></telerik:RadMenuItem>
                <telerik:RadMenuItem Text="Paste" Value="CommandPaste"></telerik:RadMenuItem>
                <telerik:RadMenuItem Text="HideRow" Value="CommandHideRow"></telerik:RadMenuItem>
                <telerik:RadMenuItem Text="HideColumn" Value="CommandHideColumn"></telerik:RadMenuItem>
                <telerik:RadMenuItem Text="Alert" Value="CustomAlert"></telerik:RadMenuItem>
            </Items>
        </CellContextMenu>
        <RowHeaderContextMenu OnClientItemClicked="CellContextMenuItemClicked">
            <Items>
                <telerik:RadMenuItem Text="HideRow" Value="CommandHideRow"></telerik:RadMenuItem>
                <telerik:RadMenuItem Text="DeleteRow" Value="CommandDeleteRow"></telerik:RadMenuItem>
            </Items>
        </RowHeaderContextMenu>
        <ColumnHeaderContextMenu>
            <Items>
                <telerik:RadMenuItem Text="HideColumn" Value="CommandHideColumn"></telerik:RadMenuItem>
                <telerik:RadMenuItem Text="DeleteColumn" Value="CommandDeleteColumn"></telerik:RadMenuItem>
            </Items>
        </ColumnHeaderContextMenu>
    </ContextMenus>
</telerik:RadSpreadsheet>
<script>
    Sys.Application.add_load(function () {
        var kSpreadsheet = $find("<%=RadSpreadsheet1.ClientID%>").get_kendoWidget();
        kSpreadsheet.bind("deleteRow", onDeleteRow);
    });
 
    function onDeleteRow(arg) {
        //see the event arguments here and how to cancel it:
 
        arg.preventDefault();
 
        console.log("The row at index " + arg.index + " on sheet " + arg.sheet.name() + " was about to be deleted but the code prevented it");
         
    }
 
    function CellContextMenuItemClicked(sender, args) {
        alert(args.get_item().get_value());
    }
</script>

Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.

Lost mouse movement of RadRangeSelector during real time updating

$
0
0

Hello Hristo,

I've tried deferred update mode. It cannot resolved the problem.

UpdateMode works for the direction "rangeselector to chartview". Deferred mode does stop refreshing the chartview when range selector is moving. But the mouse move in the rangeselector is always blocking sometimes.

My problem is quite in the opposite update direction "chartview to rangeselector". My chartview is in live data mode, but when I use 

RadRangeSelector1.RangeSelectorElement.InitializeElements() in my refresh timer to update RangeSelector ,RangeSelector draws well but the mouse moving performs badly. I think the function InitializeElements does something to mouse moving handler. Without InitializeElements, the dragging works perfect, but no mirroring display effect.

So I've found another solution. I create my own deferred mode in direction "chartview to rangeselector" for RadRangeSelector.

I do RadRangeSelector.RangeSelectorElement.InitializeElements() when mouse is not down.

It works perfect. When I drag the selector, the rangeselector stops drawing but it change the range of the chartview. And new data continues loading in the chart serie. The move is smoothly.

 

Regards,

RadGrid refresh via asp:Timer and v-scrollbar problem

$
0
0
Hello Didier,

The postback, even if it is asynchronous, re-renders the entire grid, and this takes time, especially with larger data sets or a large page size, or with many columns. The browser speed and how heavy the entire page is are also factors. A two-second interval is extremely short and such a flicker during re-render is to be expected.

What I can suggest is the following:

  • increase the interval so the user can see things
  • make sure the grid has height and scrollheight set, and make sure that its parent element that is not disposed with the postback also has matching dimensions, so it will not flicker when its contents are removed from the DOM and then re-created
  • add a loading panel that will cover the grid during the postback to reduce the visibility of the DOM update for the end user

I would also suggest that you consider using a kendo grid with client-side binding so a service endpoint is called which is usually significantly faster than a postback on a WebForm.


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.

is UploadedFile.SaveAs asynchronous?

$
0
0
Hello Swapnil,

You need to open a new stream from the new file you just created, the old file (in the temporary folder) is now deleted (that's what file.SaveAs() does) and so its stream should be expected to be null as it does not exist anymore.

An alternative is to use the stream to do the desired operation (e.g., write the files somewhere else, like in a database) and only then call .SaveAs().


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.

Table Item That Contains Unique List

$
0
0
Note:Formatting for the DESCR field cuts off at the comma.

IOException when saving

nuget can't connect to https://nuget.telerik.com/nuget

$
0
0
Hello Teemee,

I've discovered the reason for your trouble, it seems you have two accounts with us:

- One account, which appears to be your work account, has a trial license that was started yesterday
- The other account (yahoo email) has no licenses.

This is the main reason why you won't see the Xamarin package in the Telerik NuGet feed. The Telerik NuGet server checks your account for licenses, and only shows the products that account can install.


Important - Licensed User

It is not uncommon for an employer to purchase the license, but you are the developer who needs to use it. If this is the case, have your employer/purchaser assign you as a Licensed User in the Manage Licensed Users portal

Once you're assigned as a Licensed User, you will see the items in the NuGet feed for the account that has the licenses. Additionally, when you're assigned a license, you get to use that license's support package an open support tickets.


I hope this information was helpful.

Regards,
Lance | Technical Support Engineer, Principal
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

Rad Grid Pagination and Sorting,

$
0
0
Hello Mathieu,

Paging and sorting are done by the grid in the front-end server memory - it requests all the data from the data source and then filters, pages, groups and sorts as needed.

We don't have examples with stored procedures because they are hard to run and copy, so they serve as rather poor examples. Nevertheless, you should be able to use a standard <asp:SqlDataSource> control to bind to a stored procedure by setting SelectCommandType="StoredProcedure". Then, you only need to set the DataSourceID property of the grid to the ID of the SqlDataSource instance.

An alternative is to use the NeedDataSource server event of the grid and call the stored procedure from your own C#/VB code. Here are more details on using this event and an example that calls an SQL server (even through it is not a stored proc): https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/data-binding/understanding-data-binding/server-side-binding/advanced-data-binding-(using-needdatasource-event).


Regards,
Marin Bratanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.

Custom Commands

$
0
0
I got it to work now, setting my main page as a navigation page.
Viewing all 94857 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>