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

Hello,

I have the following FormTemplate that I am using to update/insert. However, I am having issues attempting to read the values of the control. Can someone please advise on how to read controls best, so that I can add these values to the SQL database? I cannot automatically add the values due to having some conditions before adding. Thank you!

 

   <EditFormSettings EditFormType="Template">     
                <FormTemplate>                   
                    <asp:Label runat="server" Text="Closure Location: " Font-Bold="true">
                        <telerik:RadComboBox ID="ddSiteList" runat="server" CheckBoxes="true" EnableCheckAllItemsCheckBox="true">                     
                            </telerik:RadComboBox>                    
                    </asp:Label>
                    <asp:Label runat="server" Font-Bold="true" Text="Order Type">
                        <telerik:RadDropDownList ID="ddType" runat="server" DefaultMessage="Select Order Types">             
                            <Items>                            
                            <telerik:DropDownListItem Text="All Types" Value="0"></telerik:DropDownListItem>
                            <telerik:DropDownListItem Text="Online Only" Value="1"></telerik:DropDownListItem>
                            </Items>
                        </telerik:RadDropDownList>
                    </asp:Label>
                    <asp:Label ID="lblReason" runat="server" Text="Closure Reason: " Font-Bold="true"> 
                        <asp:DropDownList ID="ddReasons" runat="server">
                            <asp:ListItem Text="Please select a reason" Value=""></asp:ListItem>
                        </asp:DropDownList>
                    </asp:Label>   
                    <asp:Label ID="lblFullDay" runat="server" Text="Duration: " Font-Bold="true">
                        <telerik:RadDropDownList ID="ddDuration" runat="server">
                            <Items>
                            <telerik:DropDownListItem Text="Please Select" Value=""></telerik:DropDownListItem>
                            <telerik:DropDownListItem Text="Partial" Value="0"></telerik:DropDownListItem>
                            <telerik:DropDownListItem Text="Full Day" Value="1"></telerik:DropDownListItem>
                            </Items>
                        </telerik:RadDropDownList>
                    </asp:Label>
                    <asp:Label runat="server" Text="Start Time: ">
                        <telerik:RadDateTimePicker RenderMode="Lightweight"  runat="server" ID="timeStart" ></telerik:RadDateTimePicker>
                    </asp:Label>
                    <asp:Label runat="server" Text="End Time: ">
                        <telerik:RadDateTimePicker RenderMode="Lightweight"   runat="server" ID="timeEnd"></telerik:RadDateTimePicker>
                    </asp:Label>
                    <asp:Label ID="lblDescription" runat="server" Text="Closure Reason: ">
                        <telerik:RadTextBox ID="txtDescription" runat="server"></telerik:RadTextBox>
                    </asp:Label>
                    <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                        runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:Button>&nbsp;
                    <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button>                    
                </FormTemplate>
            </EditFormSettings>

 

C# 

  protected void rgClosureList_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == "PerformInsert")
            {
                if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode))
                {                 
                    RadTextBox ddValue = FindControl("txtDescription") as RadTextBox;
                    string sValue = ddValue.Text;

                  //Open Sql connection and insert values into DB

                }

                if (e.CommandName == "Update")
                {
                  //Open Sql connection and insert values into DB
                }

            }

 

Vessy
Telerik team
 answered on 26 Mar 2019
1 answer
138 views

Hello all,

I'm having a frustrating time with the asyncupload control while using bootstrap.  They apparently do not play well together?

I found the box-sizing css work-around, which does fix the text/button, but I'm having issues with the upload progress/remove controls.

See attached.

 

Any advice or solutions?

Thanks.

Peter Milchev
Telerik team
 answered on 26 Mar 2019
2 answers
290 views

On a website I have a search page where the user will type in key=value pairs.  For example, "Software=SQL" would be a token.  I have the auto complete showing the options as they type.  I want to see if I can via the web service make two tokens as the user types in "software=SQL software=windows"  (Token 1 = "software=SQL" and Token 2="software=windows").  I know they can select from the drop down box to get the token, but I would like to be able to "token" the string as the user types in the string without them needing to select the item from the drop down box.  As the user types in "software=SQL software=windows"  the UI would show a token for "software=SQL" and a 2nd token for "software=windows".  The web service (i.e. server side) will handle the logic to determine on breaking the typed in string into the respective tokens

Peter Milchev
Telerik team
 answered on 26 Mar 2019
2 answers
333 views
Hi,

I have done Radwindow confirm example by following this link :
Using A Custom RadWindow And Its ContentTemplate

<telerik:RadWindowManager runat="server" ID="RadWindowManager1">
    <Windows>
        <telerik:RadWindow ID="rw_customConfirm" Modal="true" Behaviors="Close, Move" VisibleStatusbar="false"
            Width="300px" Height="200px" runat="server">
            <ContentTemplate>
                <div class="rwDialogPopup radconfirm">
                    <div class="rwDialogText">
                        <asp:Literal ID="confirmMessage" Text="" runat="server" />
                    </div>
                    <div>
                        <telerik:RadButton runat="server" ID="rbConfirm_OK" Text="OK" OnClick="rbConfirm_OK_Click">
                        </telerik:RadButton>
                        <telerik:RadButton runat="server" ID="rbConfirm_Cancel" Text="Cancel" OnClientClicked="closeCustomConfirm">
                        </telerik:RadButton>
                    </div>
                </div>
            </ContentTemplate>
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>
<asp:Button ID="Button4" Text="call the RadConfirm" OnClick="Button4_Click" runat="server" />
<script type="text/javascript">
    function closeCustomConfirm()
    {
        $find("<%=rw_customConfirm.ClientID %>").close();
    }
</script>

It''s working fine. but rbConfirm_OK_Click event is calling at page refresh also.. I want call this event only once that is click on confirm button (OK).. Please help me to solve this..

Pranitha Jugge
Top achievements
Rank 1
 answered on 25 Mar 2019
3 answers
944 views
How to pass value from child window to parent window when the child window is closed ?
Vessy
Telerik team
 answered on 25 Mar 2019
10 answers
1.8K+ views
After spending hours looking through documentation and the forums I can't figure out why my edit form doesn't close.
In my RadGrid I include an EditFormSettings tag, specifying EditFormType="WebUserControl" and the name of the control. Nested in this tag I have an EditColumn tag.
In the RadGrid Columns collection I have a GridEditCommandColumn tag.
The User Control I'm using for editing has a DataItem public property which is used to populate the editing controls (textboxes and comboboxes).
In the User Control I have two buttons. The "Save" button has OnClick="BtnSaveClick" and CommandName="Update". The BtnSaveClick method in the user control's code-behind updates the database using Entity Framework. The "Cancel" button has CommandName="Cancel".
I am able to edit and successfully update records.
The problem is that after updating the database, or if the user clicks the Cancel button, the edit form remains visible.
How do I cause the edit form to close after an update or after clicking the Cancel button?
Thanks in advance for your help. This is driving me nuts.

Here is an excerpt from the page:
<MasterTableView DataKeyNames="AccessRequestId, ContractorId" AllowAutomaticUpdates="False">
  <EditFormSettings UserControlName="~/UserControls/AccessRequestEditForm.ascx" EditFormType="WebUserControl" >
    <EditColumn UniqueName="EditCommandColumn1" ></EditColumn>
  </EditFormSettings>
<Columns>
  <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
  </telerik:GridEditCommandColumn>
  ...more columns...
</Columns>
</MasterTableView>

Here are the buttons in my user control:

<div runat="server" id="divButtons">
      <asp:Button runat="server" ID="btnSave" Text="Save" OnClick="BtnSaveClick" CommandName="Update" CausesValidation="true" />
      <asp:Button runat="server" ID="btnCancel" Text="Cancel" OnClick="BtnCancelClick" CommandName="Cancel" CausesValidation="false"/>
   </div>

CB
Top achievements
Rank 2
 answered on 24 Mar 2019
12 answers
598 views

Hi,

My client want the option to have bullets in her text.  But when she select a part of text and click on "InsertUnorderedList", only one bullet is generated at the beginning of the text (for the entire paragraph).

This behavior is also reproduced in your examples (and this editor).
http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx

If the copy/paste this text:
The services provided included <br>studies, <br>detailed design and complete project management services, <br>including specifications, <br>tender documents, <br>procurement, <br>inspection, <br>construction supervision <br>commissioning.

and I select some lines and I click on "InsertUnorderedList", I have the following result:
<ul><li>The services provided included <br>studies, <br>detailed design and complete project management services, <br>including specifications, <br>tender documents, <br>procurement, <br>inspection, <br>construction supervision <br>commissioning.</li></ul>

My example is attached to this thread.

So, I want to generate bullets only for the selected text (or for the line where the cursor is located)

Thank you

Steeve

Marin Bratanov
Telerik team
 answered on 22 Mar 2019
1 answer
239 views

I'm having an issue I can't find any similar posts to so here goes.

I am generating a pivot table using Linq where I won't know the column names until run-time.  So I am creating the data series in codebdhind and then binding the Radhtmlchart to the data table.  Things work somewhat well but for one problem.  Each new series I add changes the Y-Axis scale by a factor of 10.  I have added images below to show how it grows (data points are set to 1 or 2 in each case for simplicity).  Note that the Y-axis grows from roughly 1 to 10 to 100 and the column height of each successive series is correspondingly bigger. 

Here is the aspx for the Chart:

<telerik:RadHtmlChart ID="RadHtmlChart1" runat="server">
    <PlotArea>
        <XAxis DataLabelsField="DayHour">
            <LabelsAppearance Step="4">
            </LabelsAppearance>
        </XAxis>
        <YAxis Type="Numeric">
            <LabelsAppearance Step="1">
            </LabelsAppearance>
        </YAxis>
    </PlotArea>
    <Appearance>
        <FillStyle BackgroundColor="Transparent"></FillStyle>
    </Appearance>
    <ChartTitle Text="Hourly Clicks">
        <Appearance Align="Center" BackgroundColor="Transparent" Position="Top">
            <TextStyle Bold="true" FontSize="24px" />
        </Appearance>
    </ChartTitle>
    <Legend>
        <Appearance BackgroundColor="Transparent" Position="Bottom"></Appearance>
    </Legend>
</telerik:RadHtmlChart>

 

And here is the codebehind where I generate the ColumnSeries dynamically and bind.  There is some code to test different configurations of the 'stacked' attribute based on some older articles I saw but it was not helpful.  T is the Data Table and looks exactly as it should.

int i = T.Columns.Count;
bool bstacked = true;
foreach (DataColumn col in T.Columns)
{
    if (col.ColumnName == "DayHour") continue;
    ColumnSeries newSeries = new ColumnSeries();
    newSeries.Name = col.ColumnName;
    newSeries.GroupName = "colGroup";
    newSeries.DataFieldY = col.ColumnName;
    i--;
    if (i == 1) bstacked = false;
    newSeries.Stacked = bstacked;
    newSeries.LabelsAppearance.Position = Telerik.Web.UI.HtmlChart.BarColumnLabelsPosition.OutsideEnd;
    RadHtmlChart1.PlotArea.Series.Add(newSeries);
}
RadHtmlChart1.DataSource = T;
RadHtmlChart1.DataBind();

 

I would appreciate any help with this.  

Thanks.

Rumen
Telerik team
 answered on 22 Mar 2019
5 answers
1.0K+ views

Is it possible?

If yes, how?

Doğan
Top achievements
Rank 1
 answered on 22 Mar 2019
3 answers
154 views

Hello,
I use a RadGrid with a hierarchy system. I have 3 types of resources for my line (human, location, equipment) in my grid. But I only can  add a child if the resource type is a location.

I need to "disable or hide" the Expand/Hierarchy column, but I dont this attribute on the dataItem. 

How can I  "disable or hide" the Expand/Hierarchy column ONLY for "human and equipment" ?

Thank you :) 

 

I attach a files for explain what I have currently (left image) and the result that I hope to get (right)

 

Attila Antal
Telerik team
 answered on 21 Mar 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?