Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
71 views
Hi,

I am using RadComboBox.Net2 Version 2.8.5.0. AutoComplete does not work correctly in IE9/10. The suggestions are not getting populated as per user input.

Is this a product version issue? If it is, what will be the best solution for me with minimal code changes?

Note: I am also using Telerik.Web.UI Version 2012.2.912.40 in some other areas.

Thanks





Nencho
Telerik team
 answered on 10 May 2013
0 answers
117 views
Hello to all(Image Table.jpg)

in first node Technology Name then Factor the SubFactor
Technology Name
    Factor Name
        SubFactor
So how to correct my query or bind Radtreeview For this.

Jack
Top achievements
Rank 1
 asked on 10 May 2013
1 answer
376 views
Hi to all,
Sorry to bother you with what might seem beginners question, I tried  to use ListView1_ItemCommand to as shown in my code below, but nothing happened the insert command is not firing should I use OnCommandInserting, if there is a form or example on how this could be done I would deeply appreciated.
thanks.
Rasha. 
if (e.CommandName == RadListView.PerformInsertCommandName)
{
    SqlCommand cmd = new SqlCommand();
    try
    {
        SqlConnection con = DataAccess.Connection.GetDBConnection();
        if (con.State == ConnectionState.Closed)
        {
            con.Open();
        }
        cmd.CommandText = "INSERT INTO [Package] VALUES (@PackageName, @PackageDesc, @PricePerMonth, @discountPercent, @NumOfImg, @NumOfGIF, @NumOfFlash, @isHomePageIncluded)";
        cmd.Parameters.Add("@PackageName", SqlDbType.VarChar);
        cmd.Parameters.Add("@PackageDesc", SqlDbType.VarChar);
        cmd.Parameters.Add("@PricePerMonth", SqlDbType.Money);
        cmd.Parameters.Add("@discountPercent", SqlDbType.Float);
        cmd.Parameters.Add("@NumOfImg", SqlDbType.Int);
        cmd.Parameters.Add("@NumOfGIF", SqlDbType.Int);
        cmd.Parameters.Add("@NumOfFlash", SqlDbType.Int);
        cmd.Parameters.Add("@isHomePageIncluded", SqlDbType.Bit);
 
        cmd.Connection = con;
 
        int result = cmd.ExecuteNonQuery();
        con.Close();
    }
    catch (Exception exp)
    {
        Response.Write(exp +"in Command: " + cmd.ToString());
    }

Shinu
Top achievements
Rank 2
 answered on 10 May 2013
1 answer
57 views
Hi 

I have a grid with 10 columns that do not fit in one single screen and of which the first two columns represent vital data and the last two columns are my Command columns that needs to be shown all the time.

Please help me fix this.

Thanks
Arun
Shinu
Top achievements
Rank 2
 answered on 10 May 2013
2 answers
103 views
Hi 

I have two columns in my radgrid
Empid - readonly, mandatory
EmpName - dropdown column , datavaluefield= "EmpID", datatextfield="EmpName"

On selection of an Employee in my dropdownlist I need to set and pertain the value of the EmpID column based on the selection in the EmpName.
Arun
Top achievements
Rank 1
 answered on 10 May 2013
3 answers
141 views
Hi Guys,

This is my RadGrid:

<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True" DataSourceID="SqlDataSource1" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" CellSpacing="0" GridLines="None">
        <MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource1" DataKeyNames="ID" CommandItemDisplay="TopAndBottom">
            <CommandItemSettings ExportToPdfText="Export to PDF" />
            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
            </RowIndicatorColumn>
            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="imagebutton" />
                <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" FilterControlAltText="Filter ID column" HeaderText="ID" ReadOnly="True" SortExpression="ID" UniqueName="ID">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Client_Name" FilterControlAltText="Filter Client_Name column" HeaderText="CLIENT_NAME" SortExpression="Client_Name" UniqueName="Client_Name">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Equipment" FilterControlAltText="Filter Equipment column" HeaderText="EQUIPMENT" SortExpression="Equipment" UniqueName="Equipment">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Serial_Number" FilterControlAltText="Filter Serial_Number column" HeaderText="SERIAL_NUMBER" SortExpression="Serial_Number" UniqueName="Serial_Number">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Reason" FilterControlAltText="Filter Reason column" HeaderText="REASON" SortExpression="Reason" UniqueName="Reason">
                </telerik:GridBoundColumn>
                <telerik:GridButtonColumn UniqueName="ButtonColumn" Text="Delete" CommandName="Delete" ButtonType="imagebutton" />
            </Columns>
            <EditFormSettings>
                <EditColumn ButtonType="ImageButton" InsertText="Insert" UpdateText="Update" UniqueName="EditCommandColumn1" CancelText="Cancel">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
            </HeaderContextMenu>
    </telerik:RadGrid>

And this is my datasource:

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues" 
        ConnectionString="<%$ ConnectionStrings:ClarityConnectionString %>" 
        OldValuesParameterFormatString="original_{0}" 
        DeleteCommand="DELETE FROM invClientsEquipmentInOffice WHERE (ID = @original_ID)" 
        InsertCommand="INSERT INTO invClientsEquipmentInOffice(Client_Name, Equipment, Serial_Number, Reason) VALUES (@Client_Name,@Equipment,@Serial_Number,@Reason)" 
        SelectCommand="SELECT ID, Client_Name, Equipment, Serial_Number, Reason FROM invClientsEquipmentInOffice" 
        UpdateCommand="UPDATE invClientsEquipmentInOffice SET Client_Name = @Client_Name, Equipment = @Equipment, Serial_Number = @Serial_Number, Reason = @Reason where ID = @original_ID">
        <DeleteParameters>
            <asp:Parameter Name="original_ID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="Client_Name" Type="String" />
            <asp:Parameter Name="Equipment" Type="String" />
            <asp:Parameter Name="Serial_Number" Type="String" />
            <asp:Parameter Name="Reason" Type="String" />
            <asp:Parameter Name="original_ID" Type="Int32" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="Client_Name" Type="String" />
            <asp:Parameter Name="Equipment" Type="String" />
            <asp:Parameter Name="Serial_Number" Type="String" />
            <asp:Parameter Name="Reason" Type="String" />
        </InsertParameters>
        </asp:SqlDataSource>

There is nothing in the code behind.

Partial Class inventory
    Inherits System.Web.UI.Page

End Class

Ok. The problem is that when you click the edit icon on any Row the entire page posts back and is painfully slow. Is there any way to prevent this postback?

Is there any built in default AJAX functionality for CRUD operations? One would think that by default when you click the edit icon that everything would happen client side as all the information is in the row you just clicked?

How do I find out what is happening when this postback occurs? Is it rebinding to the datasource every time I wonder?

Note: It should be noted that this is the "out of the box" RagGrid, I have not written any custom code for this one it was entirely created in Design View.

Note: It should also be noted that the select query return only 35 rows and runs in SSMS in 00:00:00 time.



Princy
Top achievements
Rank 2
 answered on 10 May 2013
1 answer
119 views
I have used the RadRotator in my Sitefinity website. It displays news items from the backend. I have set an initial width when created the RadRotator. But it does not work well on all screen sizes. I need to resize the RadRotator depending upon the screen/browser size.
Please help me with it.

Thanks,
Prateek
Shinu
Top achievements
Rank 2
 answered on 10 May 2013
1 answer
68 views
Hello,

I'm trying to implement client-side validation on the RadTextBox within an EditForm (EditFormType="Template") on a RadGrid. The scenario is one where I need to validate that the value being entered does not result in the total value for that same column to exceed a value. 

For example, the RadGrid contains rows that hold an "Hours" column. When I insert or edit a new row, I want to validate that the newly entered Hours value is not going cause the total for the Hours, for the entire grid, to exceed 24 hours.

I need to do this on the client side as I need to force the validation to occur on the blur event of the text box being used in the edit form.

E.g.

<EditFormSettings EditFormType="Template">
  <FormStyle Width="100%"></FormStyle>
     <FormTemplate>
           <table border="0" style="width:100%;" >
              <tr>
                  <td>
                     <span style="color: Red">*</span>
                     <asp:Label ID="lblHoursLabel" runat="server" Text="Hours:"></asp:Label>
                  </td>
                   <td>
                      <telerik:RadTextBox runat="server" ID="rtbHours" Text='<%#DataBinder.Eval(Container, "DataItem.RegularHours")%>'  Width="100px" ClientEvents-OnBlur="validateEnteredHours"></telerik:RadTextBox>
                  </td>
                </tr>       
             </table>
     </FormTemplate>
 </EditFormSettings>

I have no problem getting at the hours for the dataitems in the grid...
function validateEnteredHours(sender, args) {
                var id = sender.get_id();
                var radInput = $telerik.findControl(document.forms[0], id);
                var hoursValue = radInput.get_value();
                if (hoursValue == null)
                    alert("An Hours Value is Required")
                else {
                    var grid = $find("<%=radGridTimesheetDetails.ClientID%>");
                    var totalHours = 0;
                    if (grid) {
                        var masterTable = grid.get_masterTableView();
                        var Rows = masterTable.get_dataItems();
                        
                        for (var i = 0; i < Rows.length; i++) {
                            var row = Rows[i];
                            var isInEditMode = row.get_isInEditMode();
                            if (isInEditMode = false);
                            {
                                var hoursCell = masterTable.getCellByColumnUniqueName(row, "Hours");
                                var hours = parseFloat(hoursCell.innerHTML);
                                 
                                totalHours = totalHours + hours;
                            }
                        }
                    }
                }
            }

My problem now is determining what the hours are for the data item currently being edited, so that I can subtract that from the total hours, and then evaluate if adding the entered hours to that total will exceed 24.

Any help is appreciated.


Angel Petrov
Telerik team
 answered on 09 May 2013
1 answer
181 views
I am unable to get the raddatepicker OnBlur event to fire. I was success calling the same function when I used the OnFocus event. Any ideas? I've noticed that others have run into this problem in the past, but none of the solutions offered is helping.

 

 

<td>

 

<telerik:RadDatePicker ID="rdpDOB" runat="server" Skin="Web20" AutoPostBack="false" CssClass="clsRadCalendar" MinDate="1/1/1900" MaxDate="1/1/9999" DateInput-DateFormat="M/d/yyyy" DateInput-ClientEvents-OnBlur="validateAge" />
</td>

Angel Petrov
Telerik team
 answered on 09 May 2013
1 answer
92 views

My senario is thus.
  - If a user click a context menu item on one of bar chart, I show related information to user.

I have done Adding RadContextMenu on RadChart, but How can I know which data is clicked?

my code is below.

protected void RadChart1_Click(object sender, ChartClickEventArgs e)
    {
        string causeCode = e.Series.Name;
        string date = e.SeriesItem.Label.TextBlock.Text;
        int cellCnt = 0;
 
        DataTable qty = (Session["DATASET"] as DataSet).Tables[1];
 
        foreach (DataRow dr in qty.Rows)
        {
            if (dr["Date"].ToString() == date)
            {
                cellCnt = Int32.Parse(dr["CellCnt"].ToString());
                break;
            }
        }
 
        sql.SetDBInfo(SqlHelpers.LINE.TIP_DB, SqlHelpers.DBMS_TYPE.SQLSERVER);
 
        sql.QueryStr = String.Format(
                            @"SELECT    TOP 20 S.Code, COUNT(S.SubPanelID) * 1.0 / {0} * 100 Value
                                FROM        ReportDB.tft.DEFECTKPI_RAW_RP S
                                WHERE   S.BDate BETWEEN '2013-04-01' AND '2013-04-30'
                                            --AND S.Line = 'T'
                                            AND LEFT(S.ProcessID, 7) IN (SELECT ProcessID FROM ReportDB.std.MODELINFO WHERE ProdType = 'TV')
                                            AND S.CauseCode IN ('FAIL')
                                GROUP BY S.Code
                                ORDER BY COUNT(S.SubPanelID) DESC", cellCnt.ToString());
 
        qty = sql.GetData();
 
        RadChart topDefChart = new RadChart();
        topDefChart.ChartTitle.TextBlock.Text = causeCode + " " + date;
 
        topDefChart.DataSource = qty;
        topDefChart.PlotArea.XAxis.DataLabelsColumn = "Code";
        topDefChart.DataBind();
        this.Page.Controls.Add(topDefChart);
 
        SetChartAppearance2(topDefChart);
    }
 
    private void SetChartAppearance2(RadChart _chart)
    {
        // Chart Appearence
        _chart.Skin = "LightBrown";
        _chart.AutoLayout = true;
        _chart.AutoTextWrap = true;
 
        _chart.Width = 900;
        _chart.Height = 400;
 
        // Series
        foreach (ChartSeries series in _chart.Series)
        {
            series.DefaultLabelValue = "#Y{F3}";
            series.Appearance.ShowLabels = true;
 
            int x = 0;
            foreach (var item in series.Items)
            {
                item.ActiveRegion.Attributes = String.Format("id='code{0}'", x.ToString());
 
                ContextMenuElementTarget target = new ContextMenuElementTarget();
                target = new ContextMenuElementTarget();
                target.ElementID = string.Format("code{0}", x.ToString());
                RadContextMenu1.Targets.Add(target);
                x++;
            }
        }
 
        RadContextMenu1.Items.Clear();
 
        RadMenuItem menu1 = new RadMenuItem("item1");
        RadMenuItem menu2 = new RadMenuItem("item2");
 
        RadContextMenu1.Items.Add(menu1);
        RadContextMenu1.Items.Add(menu2);
 
        // Legend
        _chart.Legend.Appearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Top;
        _chart.Legend.Appearance.Overflow = Telerik.Charting.Styles.Overflow.Row;
 
        // Axis
        _chart.PlotArea.YAxis.AxisLabel.TextBlock.Text = "%";
        _chart.PlotArea.YAxis.AxisLabel.Visible = true;
    }
Petar Kirov
Telerik team
 answered on 09 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?