Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
96 views
I want to loop through a hierarchy radgrid to find a  specific value within the 2nd level of the rad grid's hierarchy.  I do not want the value of the key, but the values of other columns within the 2nd level of the hierarchy.  How can I loop through the items to obtain these values.  This is what I have so far, but it does not work....

   Protected Sub RadGrid_Inventory_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid_Inventory.PreRender


            For Each item As GridDataItem In RadGrid_Inventory.Items
                If (item.OwnerTableView.Name = "Inv_Desc") Then


                Dim lblRowID As Label = DirectCast(item.FindControl("lblRowID"), Label)
                Dim Delete As ImageButton = DirectCast(item.FindControl("Delete"), ImageButton)
            

                If lblRowID.Text = -1 Then
                    Delete.Visible = False
                Else
                    Delete.Visible = True
                End If


                End If
            Next
    End Sub
Aret
Top achievements
Rank 1
 answered on 16 Oct 2012
2 answers
101 views

Hi,

My team is having an issue with the NumericTextBox and the developer currently having the issue asked that I post his question in the forum on his behalf since he is having a technical issue with his workstation that is preventing him from posting himself.

"Using the NumericTextbox, I am seeing behavior that is not the way that I want or expect. I have a MinValue="0" and a MaxValue="100". I have a InvalidStyleDuration="2000000".

When the user enters -1, the textbox border turns red and there is an invalid icon in the textbox. What is happening that I don't want is that the -1 value that was entered is replaced by the MinValue, 0. How can I get the entered value, -1, to remain in the textbox?"

Thanks,

Andrew

Andrew
Top achievements
Rank 1
 answered on 15 Oct 2012
2 answers
221 views
Hi,

My team is having an issue with the NumericTextBox and the developer currently having the issue asked that I post his question in the forum on his behalf since he is having a technical issue with his workstation that is preventing him from posting himself.

"I have a NumericTextBox that has MinValue and MaxValue properties.I have a ValidationSummary control which has a RequiredFieldValidator connected to another asp.net TextBox control.

When the user hits the Save button and validation takes place, is there a way for invalid values in the NumericTextBox control, for example value entered is less than the MinValue, to be displayed in the ValidationSummary control without hooking up an additional asp.net validation control?"

Thanks,

Andrew

Andrew
Top achievements
Rank 1
 answered on 15 Oct 2012
1 answer
94 views
Hello,

I've been looking around the Telerik and the internet for the last few days to fry and find a possible solution for designing a grid that allows manual entry.  To be specific, here's exactly what I am looking for -

  1. User clicks Add New Record to enter new data
  2. Mouse cursor automatically starts in the first data field; as the user tabs across, the cursor continues to move from column to column, allowing the user to enter all values
  3. The input of each field can be customized - in other words, some of the entry fields would simply be text entry, some would be dropdown menus (RadCombo) and some are date fields (RadDatePicker)
  4. When the user tabs from the last column, the record is automatically validated and/or inserted into the grid.  The cursor then returns to the first column to allow entry of the next record

I have been experimenting both with the User Control and Template Edit Form Type (currently I am working with the Template).  There have been a few issues based on how I'm coding it:

  1. Despite setting the tab index of the items in the template, tabbing through them is giving a random tab order and not following the set tab index settings
  2. I am curently working with the last field in the template set with Auto Postback - this was my initial plan for simulating the automatic insertion, although I was doubtful this would work (and so far it hasn't).

Is there a sample somewhere on the Telerik site that follows a similar approach?  I haven't been able to find anything that mimics this behavior, but perhaps I am searching for the wrong thing or describing it wrong.

amonte
Top achievements
Rank 1
 answered on 15 Oct 2012
6 answers
352 views
Hi,
I have many columns in my radgrid, and thus I have horizontle scrolling enabled. But, I would like to allow the user to select the columns they want to have displayed by having option on the header of a column as shown in the below link:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/headercontextfiltermenu/defaultcs.aspx

Eveything is good, but my radgrid columns are created programatically. It would be great if someone can guide me in doing this programatically in code behind file.

Thanks,
Raj
David Cowan
Top achievements
Rank 1
 answered on 15 Oct 2012
2 answers
146 views


In the above example, even though the second file Lighthouse.jpg fails validation, it in the file list. Although the green and red bullet show the status of each file, it is not as intuitive, especially if you select multiple at a time. Firstly you have to scan through the list to see which all failed. Secondly colourblind people can have a hard time distinguishing them.

How can I make it so that files that fail validation don't show up there? I'm planning to have a error area below the upload control that will list files that fail validation and only show validated files up there.

Thanks.
Baal
Top achievements
Rank 1
 answered on 15 Oct 2012
0 answers
53 views
Delete
Bruce
Top achievements
Rank 1
 asked on 15 Oct 2012
0 answers
173 views
I have a radlistbox that contains enough items to cause the vertical scroll bar to appear. My page allows a new record to be inserted into the database and on postback I rebind the records to the listbox and set the radlistbox selected item to the new record's text which is near the bottom of the listbox; however, the scroll bar remains at the top of the radlistbox. How can I move the vertical scroll bar to make visible the newly inserted and selected item?

Thanks,

Steve Holdorf
Steve Holdorf
Top achievements
Rank 1
 asked on 15 Oct 2012
2 answers
2.1K+ views
Having trouble getting a radgrid column to format as $1,234.00; it always displays as 1234.  The database field is Double. The code is as follows:
       <telerik:RadGrid ID="RadGrid1" runat="server" style="margin-top:25px;"
AutoGenerateColumns="true" oncolumncreated="RadGrid1_ColumnCreated">
           <MasterTableView  TableLayout="Fixed" />
           <ClientSettings EnableRowHoverStyle="true" >
               <Selecting AllowRowSelect="False"/>
               <ClientEvents />
               <Scrolling AllowScroll="True"/>
               <Resizing AllowColumnResize="true" AllowResizeToFit="true" ResizeGridOnColumnResize="true" />
           </ClientSettings>
       </telerik:RadGrid>

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;
using myNameSpace.BusinessLogic.myLogic;
 
namespace myNameSpace
{
    public partial class myScreen : System.Web.UI.UserControl
    {
        private MyController myController = new MyController();
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            List<Guid> thisPositionIds = myController.GetPositionIDs();
            // add 1st column, the Item
            dt.Columns.Add("Item");
 
            // make the Annual Costs columns
            foreach (Guid positionId in thisPositionIds)
            {
                // add a column
                dt.Columns.Add(new DataColumn(myController.GetPositionName(positionId)
                    + System.Environment.NewLine + "Annual Costs",
                    System.Type.GetType("System.Decimal")));
            }
 
            // get the data for the rows
            List<Guid> thisItemIds = myController.GetItemIDs();
            foreach (Guid itemID in thisItemIds)
            {
                DataRow dr = dt.NewRow();
 
                // enter the first column, the Item Name
                dr["Item"] = myController.GetItemName(itemID);
 
                // enter the final set of columns, the Annual Costs
                foreach (Guid positionId in thisPositionIds)
                {
                    dr[myController.GetPositionName(positionId) + System.Environment.NewLine + "Annual Costs"]
                        = myController.GetAnnualCosts(itemID, positionId);
                }
                dt.Rows.Add(dr);
            }
            RadGrid1.DataSource = dt;
            RadGrid1.DataBind();
        }
 
        protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
        {
            if (e.Column.ColumnType == "GridBoundColumn")
            {
                // get column header text
                string colName = e.Column.UniqueName;
 
                // get last 12 chars of text (if it is long enough)
                string colNameEnd;
                if (colName.Length >= 12)
                    colNameEnd = colName.Substring(colName.Length - 12, 12);
                else
                    colNameEnd = "x";
                // format according to which column this
                if (colName == "Item")
                    e.Column.HeaderStyle.Width = Unit.Pixel(80);
                else if (colNameEnd == "Annual Costs")
                {
                    (e.Column as GridBoundColumn).DataFormatString = "{0:C}";
                }
            }
        }
    }
}

Any hints as to what I'm missing would be appreciated.
-Scott
Scott
Top achievements
Rank 1
 answered on 15 Oct 2012
2 answers
134 views
I have a combobox(cbProductItems) on the page with:
OnSelectedIndexChanged="cbProductItems_SelectedIndexChanged"

right now after the postback, the combobox shows the item that is selected. I want to clear the selection and also make this combox focused so I can start typing. 

Is this something that I can do it in method cbProductItems_SelectedIndexChanged? I tried follow codes but doesn't seem to work
cbProductItems.ClearSelection();
cbProductItems.DataBind();

Thanks.
Henry
Top achievements
Rank 1
 answered on 15 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?