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

hello, 

can you tell me, what do you mean with , for example span ="2"

what is "2" ??? I understand what span is, but I don't understand what 2 is. 

 best wishes Dimitri

Magdalena
Telerik team
 answered on 11 Nov 2015
1 answer
93 views

Hello,

users of my web site are occasionally experiencing the "HTTP Error 503".

This is likely caused by some memory usage issue, and is occurring since I started adding Telerik UI For ASP.NET Ajax components to some pages.

In particular I created a page which features a RadScheduler and a RadListbox, both with server-side database binding. This page is continuously used by some 10 - 15 users during the day.

The application is deployed as a VS Website (not VS Web Application project), so there is a part of code that gets compiled at run-time.

The hosting is a shared one, with 500 MB of memory available, and is used only by employees of a private company (let's say 30 users).

 

My question is the following:

is there any suggestion on the best way to include Telerik components in ASP.NET pages in order to minimize memory usage?

For example: would converting from Website Project to Web Application Project be effective in reducing memory usage? Or whatever...

 

Thanks

Regards

Mike

Plamen
Telerik team
 answered on 11 Nov 2015
8 answers
359 views

I have a hierarchical radGrid where the user can expand a parent row and then click on a child row to edit it in-place.  I would like to provide them with a button on the parent row that would put all the child rows (for that parent row) in edit mode at the same time so that they can edit them all and save them all with 1 click.

I have researched this and found lots of info on how to do this on the parent rows but found nothing on how to do it on the child rows.

The way it is constructed is that the parent rows are in a "RadGrid" and the child rows are in a "GridTableView".  Maybe this is where my problem is.

So, I need to either figure out how to accomplish it with what I have or to get some detail on how to redesign the grid to be able to do it.

Thanks in advance for any help or advise!

 Here is my grid:

        <telerik:RadGrid ID="rgTraveler" runat="server"
            DataSourceID="SqlDataSourceTravelerMain"
            AutoGenerateColumns="False" 
            AllowSorting="True"
            AllowPaging="True"
            PageSize="25"
            Width="1200px"
            OnUpdateCommand="rgTraveler_UpdateCommand"
            OnCancelCommand="rgTraveler_CancelCommand"
            OnItemCommand="rgTraveler_ItemCommand"
            OnItemDataBound="rgTraveler_ItemDataBound"
            AllowAutomaticUpdates="True"
            GroupPanelPosition="Top">
            <PagerStyle Mode="NextPrevAndNumeric" /> 
            <MasterTableView EnableNoRecordsTemplate="true" 
                CommandItemDisplay="None" 
                InsertItemDisplay="Bottom"
                HeaderStyle-HorizontalAlign="Center"
                ItemStyle-HorizontalAlign="Center" 
                AlternatingItemStyle-HorizontalAlign="Center"
                EditMode="InPlace" 
                DataKeyNames="PO"> 
                <NoRecordsTemplate>
                    <div>There are no records to display.</div>
                </NoRecordsTemplate>

                <DetailTables>
                    <telerik:GridTableView DataSourceID="SqlDataSourceTravelerSub" 
                        runat="server" 
                        CommandItemDisplay="None"
                        Name="GridTableViewSub" 
                        BackColor="White"
                        HeaderStyle-HorizontalAlign="Center"
                        ItemStyle-HorizontalAlign="Center" 
                        AlternatingItemStyle-HorizontalAlign="Center"
                        EditMode="InPlace"
                        DataKeyNames="DetailID,ProdOrder,Source">
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="ProdOrder" MasterKeyField="PO" />
                        </ParentTableRelation>
                        <Columns>
                           <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderText="Edit" UniqueName="EditCommandColumn" />
                            <telerik:GridBoundColumn DataField="Source" HeaderText="" SortExpression="Source" UniqueName="Source" ItemStyle-Width="10px" ReadOnly="True" Visible="true" />
                            <telerik:GridBoundColumn DataField="DetailID" HeaderText="DetailID" ReadOnly="true" SortExpression="DetailID" Visible="false"  />
                            <telerik:GridBoundColumn DataField="ProdOrder" HeaderText="ProdOrder" ReadOnly="true" SortExpression="ProdOrder" Visible="true"  />
                            <telerik:GridBoundColumn DataField="SerialNumber" HeaderText="SerialNumber" ReadOnly="true" SortExpression="SerialNumber" ItemStyle-Width="100px" />
                            <telerik:GridBoundColumn DataField="PassToStockDate" HeaderText="Pass To Stock Date" SortExpression="PassToStockDate" DataType="System.DateTime" ReadOnly="True" UniqueName="PassToStockDate" DataFormatString="{0:d}" ItemStyle-Width="200px" />
                            <telerik:GridCheckBoxColumn DataField="FinalPassedToStock" HeaderText="Final Passed To Stock" SortExpression="FinalPassedToStock" UniqueName="FinalPassedToStock" ItemStyle-Width="200px" />
                            <telerik:GridDateTimeColumn DataField="FinalPassedToStockDate" HeaderText="Final Passed To Stock Date" SortExpression="FinalPassedToStockDate" ItemStyle-Width="200px" UniqueName="rdpFinalPassedToStockDate" DataFormatString="{0:d}" />
                            <telerik:GridCheckBoxColumn DataField="HasIssue" HeaderText="HasIssue" SortExpression="HasIssue" UniqueName="HasIssue" />
                            <telerik:GridBoundColumn DataField="Comments" HeaderText="Comments" SortExpression="Comments" UniqueName="txtComments" ItemStyle-Width="500px" />
                        </Columns>
                    </telerik:GridTableView>
                </DetailTables>

                <Columns>
                    <telerik:GridBoundColumn DataField="Source" HeaderText="" SortExpression="Source" UniqueName="Source" ItemStyle-Width="10px" ReadOnly="True" Visible="true" />
                    <telerik:GridBoundColumn DataField="ID" HeaderText="ID" ReadOnly="true" SortExpression="ID" DataType="System.Int32" Visible="false"  />
                    <telerik:GridBoundColumn DataField="PO" HeaderText="Prod Order" SortExpression="PO" UniqueName="PO" ItemStyle-Width="200px" ReadOnly="True" />
                    <telerik:GridBoundColumn DataField="SalesOrder" HeaderText="Sales Order" SortExpression="SalesOrder" UniqueName="SalesOrder" ItemStyle-Width="200px" ReadOnly="True" />
                    <telerik:GridBoundColumn DataField="SalesItem" HeaderText="Sales Item" SortExpression="SalesItem" ReadOnly="true" ItemStyle-Width="50px" />
                    <telerik:GridBoundColumn DataField="Part" HeaderText="Part" SortExpression="Part" UniqueName="Part" ItemStyle-Width="200px" ReadOnly="True" />
                    <telerik:GridBoundColumn DataField="Comments" HeaderText="Comments" SortExpression="Comments" UniqueName="Comments" ItemStyle-Width="600px" ReadOnly="True" />
                    <telerik:GridBoundColumn DataField="InspectionCompleteDate" HeaderText="Inspection Complete Date" SortExpression="InspectionCompleteDate" DataType="System.DateTime" ReadOnly="True" UniqueName="InspectionCompleteDate" DataFormatString="{0:d}" ItemStyle-Width="200px" />
                </Columns> 
                <EditFormSettings> 
                    <EditColumn ButtonType="ImageButton" /> 
                </EditFormSettings> 
            </MasterTableView> 
        </telerik:RadGrid> 
        <asp:SqlDataSource ID="SqlDataSourceTravelerMain" runat="server" ConnectionString="<%$ ConnectionStrings:SetoutsConnectionString %>" 
            SelectCommand="sp_GetTravelerMainRecords" SelectCommandType="StoredProcedure" CancelSelectOnNullParameter="False">
            <SelectParameters>
                <asp:ControlParameter ControlID="tbProdOrderNumberSearch" Name="PONumber" PropertyName="Text" Type="String" DefaultValue="" />
                <asp:ControlParameter ControlID="tbSalesOrderNumberSearch" Name="SONumber" PropertyName="Text" Type="String" DefaultValue="" />
                <asp:ControlParameter ControlID="rdpStartDateSearch" Name="StartDate" PropertyName="SelectedDate" Type="DateTime" DefaultValue="" />
                <asp:ControlParameter ControlID="rdpEndDateSearch" Name="EndDate" PropertyName="SelectedDate" Type="DateTime" DefaultValue="" />
                <asp:ControlParameter ControlID="rblIsPTS" Name="IsPTS" PropertyName="SelectedValue" Type="Int32" />
                <asp:ControlParameter ControlID="rblHasIssue" Name="HasIssue" PropertyName="SelectedValue" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSourceTravelerSub" runat="server" ConnectionString="<%$ ConnectionStrings:SetoutsConnectionString %>" 
            SelectCommand="sp_GetTravelerSubRecords" SelectCommandType="StoredProcedure"
            UpdateCommand="sp_UpdateTravelerSubRecord" UpdateCommandType="StoredProcedure">
            <SelectParameters>
                <asp:Parameter Name="ProdOrder" />
            </SelectParameters>
        </asp:SqlDataSource>

Ray
Top achievements
Rank 1
 answered on 10 Nov 2015
3 answers
211 views

Is the response in the following thread still valid given that it's 5 years old now?

http://www.telerik.com/forums/tab-getting-cut-off-on-multi-row

 

Ivan Danchev
Telerik team
 answered on 10 Nov 2015
3 answers
136 views
how to create unbound gridview br telerik grid  and save to database
Maria Ilieva
Telerik team
 answered on 10 Nov 2015
3 answers
225 views

I have a user control creates a control which includes a RadDateTimePicker. The datetimepicker has a SelectedDateChanged event that fires and runs the code accordingly. Since it is dynamically created, I need to dynamically add it to the RadAjaxManager that already exists. My current approach doesn't seem to work, and I get a full postback.

 

User Control

 

public partial class CategoryHolder : System.Web.UI.UserControl
    {
        public string _category;
        public string _mptt;
        public DateTime _startDate;
        public DateTime _endDate;
        public EventHandler startDateChanged;
        public EventHandler endDateChanged;
 
 
        public string Category
        {
            get
            {
                return _category;
            }
 
            set
            {
                _category = value;
 
 
            }
        }
 
        public string MPTT
        {
            get
            {
                return _mptt;
            }
 
            set
            {
                _mptt = value;
                
 
            }
        }
 
        public DateTime StartDate
        {
            get
            {
                return _startDate;
            }
 
            set
            {
                _startDate = value;
                 
 
            }
        }
 
        public DateTime EndDate
        {
            get
            {
                return _endDate;
            }
 
            set
            {
                _endDate = value;
                 
            }
        }
 
        protected void Page_Init(object sender, EventArgs e)
        {
 
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
            Label lbl = new Label();
            HiddenField hf = new HiddenField();
            RadDateTimePicker start = new RadDateTimePicker();
            RadDateTimePicker end = new RadDateTimePicker();
 
            start.AutoPostBack = true;
            start.SelectedDateChanged += new Telerik.Web.UI.Calendar.SelectedDateChangedEventHandler(start_SelectedDateChanged);
            start.ClientIDMode = System.Web.UI.ClientIDMode.Static;
            start.ID = MPTT + "StartControl";
            start.DatePopupButton.Visible = false;
            start.TimePopupButton.Visible = false;
 
            end.AutoPostBack = true;
            end.SelectedDateChanged += new Telerik.Web.UI.Calendar.SelectedDateChangedEventHandler(end_SelectedDateChanged);
            end.ClientIDMode = System.Web.UI.ClientIDMode.Static;
            end.ID = MPTT + "EndControl";
            end.DatePopupButton.Visible = false;
            end.TimePopupButton.Visible = false;
             
 
            lbl.Text = Category;
            hf.Value = MPTT;
            start.SelectedDate = StartDate;
            end.SelectedDate = EndDate;
 
            this.Controls.Add(lbl);
            this.Controls.Add(hf);
            this.Controls.Add(start);
            this.Controls.Add(end);
 
        }
 
 
        void start_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)
        {
            if (this.startDateChanged != null)
            {
                this.startDateChanged(this, e);
            }
        }
 
        void end_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)
        {
            if (this.endDateChanged != null)
            {
                this.endDateChanged(this, e);
            }
        }
    }

 

Test Page using control:

 

<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="rsm" runat="server"></telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="ram" runat="server"></telerik:RadAjaxManager>
    <div>
    <asp:PlaceHolder ID="Placeholder" runat="server"></asp:PlaceHolder>
    </div>
    </form>
</body>
</html>

Test Page C#:

protected void Page_Load(object sender, EventArgs e)
 {
     CategoryHolder ch = new CategoryHolder();
 
     ch.Category = "Test Category";
     ch.MPTT = "dfdfdopfksdopfsdop";
     ch.StartDate = DateTime.Today;
     ch.EndDate = DateTime.Today.AddDays(5);
     ch.startDateChanged += new EventHandler(startPicker_SelectedDateChanged);
 
     RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
     RadAjaxLoadingPanel loadingPanel = new RadAjaxLoadingPanel();
 
     Placeholder.Controls.Add(ch);
 
     manager.AjaxSettings.AddAjaxSetting(ch, ch, loadingPanel);
     manager.AjaxSettings.AddAjaxSetting(ch, Placeholder, loadingPanel);
 }
 
 void startPicker_SelectedDateChanged(object sender, EventArgs e)
 {
     //Yay it runs, but on a full postback
 }

Maria Ilieva
Telerik team
 answered on 10 Nov 2015
12 answers
243 views
Hi,

I'm trying to work out why my code isn't working with the  "control_name.EmptyMessage = message" type command from server side code.  It works when running in the initial page load but then on ajax calls it doesn't set the fields.

Also in Javascript the set_emptyMessage command doesn't seem to work on a similar basis...Interestingly I can use the set_text command to acheive the same goal. 

Is there a known bug with the emptymessage commands or will I need to post some code?

Regards,

Jon
Helen
Telerik team
 answered on 10 Nov 2015
1 answer
124 views

I have the following setup in my RadGrid lines in bold contain my database table primary key named LinkAnalysisId

<Columns>
<telerik:GridEditCommandColumn ButtonType="ImageButton">
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn DataField="LinkAnalysisId" HeaderText="Link ID" ReadOnly="true"
ForceExtractValue="Always" ConvertEmptyStringToNull="true" Display="False" />
<telerik:GridHyperLinkColumn FilterControlAltText ="Filter LinkID2 column"
Uniquename="LinklId2" DataNavigateUrlFormatString ="/SubjectList2.aspx?LinkID={0}"
DataTextField="LinkAnalysisName" HeaderText="Link Analysis Name"
DataNavigateUrlFields="LinkAnalysisId" />

<telerik:GridBoundColumn DataField="LinkAnalysisName" HeaderText="LinkAnalysisName" SortExpression="LinkAnalysisName"
UniqueName="LinkAnalysisName" Display="False">

Other bound columns are not shown  when I update a records and try to save I run this C# code

protected void RadGrid1_UpdateCommand(object sender, Web.UI.GridCommandEventArgs e)
        {        
               var editableItem = ((GridEditableItem)e.Item);
 
           var linkAnalysisId = (int)RadGrid1.MasterTableView.Items[0].GetDataKeyValue("LinkAnalysisId");
           
              //retrive entity from the Db
 
           var record = DbContext.LinkAnalysis.Where(n => n.LinkAnalysisId == linkAnalysisId).FirstOrDefault();
 
              if (record != null)
              {
                  //update entity's state
                  editableItem.UpdateValues(record);
                  try
                  {
                      //save chanages to Db
                      DbContext.SaveChanges();
                  }
                  catch (System.Exception)
                  {
                      ShowErrorMessage();
                  }
 
             }
       }
     The save does not pass the try catch block  I have done some trouble shooting and I have found the code      

var linkAnalysisId = (int)RadGrid1.MasterTableView.Items[0].GetDataKeyValue("LinkAnalysisId");

which sets the linkAnalysis variable is not getting the correct ID number so it appears I have something wrong. In debug mode when I inspect the values in the var editableItem I am seeing the correct linkAnalysis ID number it is just the code above is not getting the right record what have I done wrong here?

 

Thanks

Perry
Top achievements
Rank 1
 answered on 10 Nov 2015
2 answers
182 views

I have a RadGrid with the following CommandItemTemplate items

<asp:Button ID="Diagram" Text="Diagram" runat="server" OnClick="DiagramClicked"></asp:Button>
<asp:CheckBox ID="OrphanCheck" Text="Exclude Orphans" runat="server"/>

When the user clicks the Diagram button, using C#  I want to read the value of the Checkbox and build the needed code based on the value of the check box.  How can I get the value of that checkbox.  I have searched for a solution but all I can find is dealing with a checkbox in a column or row.

 

Thanks

Perry

Perry
Top achievements
Rank 1
 answered on 10 Nov 2015
1 answer
76 views

Hello  there,

 

I have  a requirement of Set PasswordStrengthSettings 's TextStrengthDescriptionStyles and TextStrengthDescriptions based on the following condions. how do i acheive it.

 

if(args.get_strengthScore() > 0 & args.get_strengthScore() <20)

{

Red colour RadStrength Strip and With Text "week"

}

else if(args.get_strengthScore() >​ 20 & args.get_strengthScore() <40)
{
Yellow colour RadStrength Strip and With Text "​Poor"

}

 

 

How do i acheive it??

Vessy
Telerik team
 answered on 10 Nov 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?