Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
174 views

     In itemDataBound I am conditionally changing an integer column, but the sum aggregate footer reflects the original values from the query. How do I get the changed value reflected in the sum?

 

david
Top achievements
Rank 1
 answered on 04 Dec 2020
5 answers
234 views

Hi,

i would like to know if it is possible to include in the individual 'cells' of a diagram any HTML content or better still other UI controls, such as Cards, even better at runtime.

Thank you

Vessy
Telerik team
 answered on 04 Dec 2020
1 answer
172 views

i would like to set the text of the the "Day/Week/Month/Year"-Buttons in the top right corner

Can this simple be done in code behind without using a resx file as I've already have a custom localization provider linked to a database

i.e. GanttChart.ToolbarButtons[0].text = "test"

Peter Milchev
Telerik team
 answered on 04 Dec 2020
4 answers
368 views
I am using the DropDownTree to display nested items. Sometimes parents are selectable, sometimes they are not.

In the dataset being returned, I have 3 columns:  Text, Value, IsSelectable.

Is there a way to pass the IsSelectable property through to the DropDownTree and then make the items selectable based on that property?  It seems like it only takes Value and Text.  

Please let me know if there is a way for this to work!  Thank you!
Peter Milchev
Telerik team
 answered on 03 Dec 2020
1 answer
216 views

Hello Telerik-Team,

Could you tell me, how I can change the title text of the time selection?
I want to translate it to my language. I added a screenshot, where I marked, what I mean.

Regards

Peter Milchev
Telerik team
 answered on 03 Dec 2020
1 answer
215 views

Hi,
I have a master page with a grid that inherits the form template from a content page. The fields are displayed correctly in edit and all valued but when I press update it says that the fields cannot be null.
This problem occurs only if the form template is on the content page while if you put the template directly on the master page then everything works.
I used a code similar to the demo https://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/form-template-update/defaultcs.aspx as an example.
What I do wrong and how I can fix it?
Thanks

 

ASPX Content Page

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/MasterTKTest2.master" AutoEventWireup="true" CodeFile="ChildTKTest2.aspx.cs" Inherits="ChildTKTest2" %>
 
<asp:Content ID="mycontent" ContentPlaceHolderID="FormTemplatePlaceHolder" runat="server">
     
   <table id="Table2" cellspacing="2" cellpadding="1" width="100%" border="0" rules="none"
    style="border-collapse: collapse;">
    <tr class="EditFormHeader">
        <td colspan="2">
            <b>Cat1</b>
        </td>
    </tr>
    <tr>
        <td>
            <table id="Table3" width="450px" border="0" class="module">
                <tr>
                    <td class="title" style="font-weight: bold;" colspan="2">Company Info:</td>
                </tr>
                <tr>
                    <td>Descrizione:
                    </td>
                    <td>
                        <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("CatDesc1") %>'>
                        </asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>Libero 1a:
                    </td>
                    <td>
                        <asp:TextBox ID="TextBox8" runat="server" Text='<%# Bind("Libero1a") %>' TabIndex="1">
                        </asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>Libero 1b:
                    </td>
                    <td>
                        <asp:TextBox ID="TextBox9" runat="server" Text='<%# Bind("Libero1b") %>' TabIndex="2">
                        </asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <b>Campi default:</b>
                    </td>
                </tr>
                <tr>
                    <td>Data ora ins:
                    </td>
                    <td>
                        <telerik:RadDatePicker RenderMode="Lightweight" ID="BirthDatePicker" runat="server" MinDate="1/1/1900" DbSelectedDate='<%# Bind("DataOraIns") %>'
                            TabIndex="4">
                        </telerik:RadDatePicker>
                    </td>
                </tr>
                <tr>
                    <td>Data ora mod:
                    </td>
                    <td>
                        <telerik:RadDatePicker RenderMode="Lightweight" ID="HireDatePicker" DbSelectedDate='<%# Bind( "DataOraMod") %>'
                            runat="server" TabIndex="10">
                        </telerik:RadDatePicker>
                    </td>
                </tr>
                <tr>
                    <td>Utente:
                    </td>
                    <td>
                        <asp:TextBox ID="TextBox4" Text='<%# Bind( "IDUtente") %>' runat="server" TabIndex="11">
                        </asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:TextBox ID="TextBox2" Text='<%# Bind( "IDUtenteUltimaMod") %>' runat="server" TabIndex="12">
                        </asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:TextBox ID="TextBox3" Text='<%# Bind( "NumMod") %>' runat="server" TabIndex="13">
                        </asp:TextBox>
                    </td>
                </tr>
            </table>
        </td>
                                 
    </tr>
    <tr>
        <td colspan="2"></td>
    </tr>
    <tr>
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td align="right" colspan="2">
            <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button
            <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                CommandName="Cancel"></asp:Button>
        </td>
    </tr>
</table>
            
        
</asp:Content>

 

CS Master Page

public partial class MasterPages_MasterTKTest2 : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        SqlDataSource1.ConnectionString = Siseco.GatEnv.Environment.Database.GetConnectionString(string.Empty, false);
    }
 
    protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
    {
        if (e.Exception != null)
        {
            e.KeepInEditMode = true;
            e.ExceptionHandled = true;
            DisplayMessage(true, "Cat1 " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["IDCat1"] + " cannot be updated. Reason: " + e.Exception.Message);
        }
        else
        {
            DisplayMessage(false, "Cat1 " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["IDCat1"] + " updated");
        }
    }
 
    protected void RadGrid1_ItemInserted(object source, GridInsertedEventArgs e)
    {
        if (e.Exception != null)
        {
            e.ExceptionHandled = true;
            e.KeepInInsertMode = true;
            DisplayMessage(true, "Cat1 cannot be inserted. Reason: " + e.Exception.Message);
        }
        else
        {
            DisplayMessage(false, "Cat1 inserted");
        }
    }
 
    protected void RadGrid1_ItemDeleted(object source, GridDeletedEventArgs e)
    {
        if (e.Exception != null)
        {
            e.ExceptionHandled = true;
            DisplayMessage(true, "Cat1 " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["IDCat1"] + " cannot be deleted. Reason: " + e.Exception.Message);
        }
        else
        {
            DisplayMessage(false, "Cat1 " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["IDCat1"] + " deleted");
        }
    }
 
    private void DisplayMessage(bool isError, string text)
    {
        Label label = (isError) ? this.Label1 : this.Label2;
        label.Text = text;
    }
 
 
 
    protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
    {
        if (e.CommandName == RadGrid.InitInsertCommandName) //"Add new" button clicked
        {
            GridEditCommandColumn editColumn = (GridEditCommandColumn)RadGrid1.MasterTableView.GetColumn("EditCommandColumn");
            editColumn.Visible = false;
        }
        else if (e.CommandName == RadGrid.RebindGridCommandName && e.Item.OwnerTableView.IsItemInserted)
        {
            e.Canceled = true;
        }
        else
        {
            GridEditCommandColumn editColumn = (GridEditCommandColumn)RadGrid1.MasterTableView.GetColumn("EditCommandColumn");
            if (!editColumn.Visible)
                editColumn.Visible = true;
        }
 
    }
    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            RadGrid1.EditIndexes.Add(0);
            RadGrid1.Rebind();
        }
    }
}

 

ASPX Master Page

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterTKTest2.master.cs" Inherits="MasterPages_MasterTKTest2" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function RowDblClick(sender, eventArgs) {
                sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
            }
        </script>
    </telerik:RadCodeBlock>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <p id="divMsgs" runat="server">
        <asp:Label ID="Label1" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#FF8080">
        </asp:Label>
        <asp:Label ID="Label2" runat="server" EnableViewState="False" Font-Bold="True" ForeColor="#00C000">
        </asp:Label>
    </p>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="divMsgs"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadFormDecorator RenderMode="Lightweight" ID="RadFormDecorator1" runat="server" DecorationZoneID="demo" DecoratedControls="All" EnableRoundedCorners="false" />
    <div id="demo" class="demo-container no-bg">
        <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" runat="server" CssClass="RadGrid" GridLines="None"
            AllowPaging="True" PageSize="20" AllowSorting="True" AutoGenerateColumns="False"
            ShowStatusBar="true" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
            AllowAutomaticUpdates="True" DataSourceID="SqlDataSource1" OnItemDeleted="RadGrid1_ItemDeleted"
            OnItemInserted="RadGrid1_ItemInserted" OnItemUpdated="RadGrid1_ItemUpdated" OnItemCommand="RadGrid1_ItemCommand"
            OnPreRender="RadGrid1_PreRender">
            <MasterTableView CommandItemDisplay="TopAndBottom" DataSourceID="SqlDataSource1"
                DataKeyNames="IDCat1">
                <Columns>
                    <telerik:GridEditCommandColumn>
                    </telerik:GridEditCommandColumn>
                    <telerik:GridBoundColumn UniqueName="IDCat1" HeaderText="ID" DataField="IDCat1">
                        <HeaderStyle Width="70px"></HeaderStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="CatDesc1" HeaderText="Desc" DataField="CatDesc1">
                        <HeaderStyle Width="80px"></HeaderStyle>
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="Libero1a" HeaderText="Libero1a" DataField="Libero1a">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="Libero1b" HeaderText="Libero1b" DataField="Libero1b">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="DataOraIns" HeaderText="DataOraIns" DataField="DataOraIns"
                        DataFormatString="{0:d}">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="DataOraMod" HeaderText="DataOraMod" DataField="DataOraMod"
                        DataFormatString="{0:d}">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="IDUtente" HeaderText="IDUtente" DataField="IDUtente">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="IDUtenteUltimaMod" HeaderText="IDUtenteUltimaMod" DataField="IDUtenteUltimaMod">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="NumMod" HeaderText="NumMod" DataField="NumMod">
                    </telerik:GridBoundColumn>
                     
                    <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="column">
                    </telerik:GridButtonColumn>
                </Columns>
                <EditFormSettings EditFormType="Template">
                    <FormTemplate>
                        <asp:ContentPlaceHolder ID="FormTemplatePlaceHolder" runat="server">
                        </asp:ContentPlaceHolder>
                    </FormTemplate>
                </EditFormSettings>
            </MasterTableView>
            <ClientSettings>
                <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents>
            </ClientSettings>
        </telerik:RadGrid>
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        DeleteCommand="DELETE FROM [Cat1] WHERE [IDCat1] = @IDCat1"
        InsertCommand="INSERT INTO [Cat1] ([CatDesc1], [Libero1a], [Libero1b], [DataOraIns], [DataOraMod], [IDUtente], [IDUtenteUltimaMod], [NumMod]) VALUES (@CatDesc1, @Libero1a, @Libero1b, @DataOraIns, @DataOraMod, @IDUtente, @IDUtenteUltimaMod, @NumMod)"
        SelectCommand="SELECT * FROM [Cat1]" UpdateCommand="UPDATE [Cat1] SET [CatDesc1] = @CatDesc1, [Libero1a] = @Libero1a, [Libero1b] = @Libero1b, [DataOraIns] = @DataOraIns, [DataOraMod] = @DataOraMod, [IDUtente] = @IDUtente, [IDUtenteUltimaMod] = @IDUtenteUltimaMod, [NumMod] = @NumMod WHERE [IDCat1] = @IDCat1">
        <DeleteParameters>
            <asp:Parameter Name="IDCat1" Type="Int32"></asp:Parameter>
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="CatDesc1" Type="String"></asp:Parameter>
            <asp:Parameter Name="Libero1a" Type="String"></asp:Parameter>
            <asp:Parameter Name="Libero1b" Type="String"></asp:Parameter>
            <asp:Parameter Name="DataOraIns" Type="DateTime"></asp:Parameter>
            <asp:Parameter Name="DataOraMod" Type="DateTime"></asp:Parameter>
            <asp:Parameter Name="IDUtente" Type="String"></asp:Parameter>
            <asp:Parameter Name="IDUtenteUltimaMod" Type="String"></asp:Parameter>
            <asp:Parameter Name="NumMod" Type="String"></asp:Parameter>
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="CatDesc1" Type="String"></asp:Parameter>
            <asp:Parameter Name="Libero1a" Type="String"></asp:Parameter>
            <asp:Parameter Name="Libero1b" Type="String"></asp:Parameter>
            <asp:Parameter Name="DataOraIns" Type="DateTime"></asp:Parameter>
            <asp:Parameter Name="DataOraMod" Type="DateTime"></asp:Parameter>
            <asp:Parameter Name="IDUtente" Type="String"></asp:Parameter>
            <asp:Parameter Name="IDUtenteUltimaMod" Type="String"></asp:Parameter>
            <asp:Parameter Name="NumMod" Type="String"></asp:Parameter>
            <asp:Parameter Name="IDCat1" Type="Int32"></asp:Parameter>
        </UpdateParameters>
    </asp:SqlDataSource>
    <br />
    </form>
</body>
</html>
Doncho
Telerik team
 answered on 03 Dec 2020
7 answers
221 views

We use the NextPrevNumericAndAdvanced pager, and need to add a textbox / button similar to Page Size, which we want to use for number of rows displayed (effectively changing grid height)

I'm guessing we need to use a custom pagertemplate, but don't want to try and recreate the NextPrevNumericAndAdvanced from scratch, so do you have the html content for the default, so that we can modify that?

 

Attila Antal
Telerik team
 answered on 02 Dec 2020
9 answers
980 views
One of our testers just caught an issue with RadGrid where Oracle is returning the data set sorting NULL values last.  RadGrid, however, is positioning null values first.  It appers to be an option on the Oracle side that can be controlled.  In our app I think the thing that makes sense is to sort the null's last.  Is it possible to modify the RadGrid behavior to treat NULL values in this manner?

Thanks,
Colin
Attila Antal
Telerik team
 answered on 02 Dec 2020
2 answers
170 views

I'd like to create a tag/keyword editor similar to the one used on sites like StackOverflow, where tags are formatted differently into the textbox and autocomplete is available as the user types (see attached screenshot).

What's the best way to do something like this with Telerik UI for ASP.NET?

 

 

Bryce
Top achievements
Rank 1
 answered on 02 Dec 2020
1 answer
124 views

Hello Telerik-Team,

I am trying to find a way to enable rotate option in diagram.
Saw this example: https://www.telerik.com/forums/shape-rotate-style
There you can see a rotate button, but on my project rotate button doesn't appear.

A toolbar like in kendo ui would be even better as the aspnet variant is based on kendo.

Regards

 

Vessy
Telerik team
 answered on 02 Dec 2020
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?