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

I have been trying for way too long but cannot get this to work. When I click on "edit" in the grid, the edit form pops down and I can update/delete as per usual etc.

However when I click on "edit", I want to put certain value in the RadAutoCompleteBox control. I have tried everything to get a reference to that control, IsInEditMode is always false true.

Please can anyone help? Thanks.

<telerik:RadGrid runat="server" ID="RadGrid1" DataSourceID="DS1" AutoGenerateColumns="false" OnItemCommand="RadGrid1_ItemCommand" OnEditCommand="RadGrid1_EditCommand" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true">
    <MasterTableView DataKeyNames="Id" DataSourceID="DS1" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true" EditMode="EditForms">
        <Columns>
            <telerik:GridBoundColumn HeaderText="Title" DataField="Title" />
            <telerik:GridEditCommandColumn ButtonType="LinkButton" UniqueName="EditCommandColumn" />
            <telerik:GridButtonColumn ConfirmText="Delete?" ConfirmDialogType="Classic" ConfirmTitle="Delete" ButtonType="LinkButton" CommandName="Delete" Text="Delete" />
        </Columns>
        <EditFormSettings EditFormType="Template">
            <FormTemplate>
                <table>
                    <tr>
                        <th>Search:</th>
                        <td colspan="2"><telerik:RadAutoCompleteBox runat="server" ID="RadAutoCompleteBox1" DataSourceID="DS2" Filter="StartsWith" DataTextField="Text" DataValueField="Value" InputType="Token" Width="100%" DropDownWidth="300px" DropDownHeight="200px" /></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <asp:Button ID="btnUpdate" Text="Update" runat="server" CommandName="Update" />
                            <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"></asp:Button>
                        </td>
                        <td></td>
                    </tr>
                </table>
            </FormTemplate>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>
    

Michael
Top achievements
Rank 1
 answered on 08 Aug 2012
1 answer
68 views
I'm trying to populate a RadComboBox on $(document).ready

The information comes from an .ashx file that renders the json for me. Currently, with a normal dropdownlist, i would add the following script:

           $(document).ready(function () {            
            $.ajax({
                url: "ResponsePages/Assignees.ashx?userID=" + $("#hfCurrentUserGuid").val(),
                data: "",
                type: "GET",
                datatype: 'json',
                success: function (data) {
                    var list = $("#cboAssignees");
                    $.each(data, function () {
                        list.append($("<option />").val(this.Guid).text(this.Name));
                    });
                }
            });
        });

And this works fine. Needless to say, this doesn't work with the rad control. So my question is how can I achieve this same effect with the RadComboBox? 
Jeremy
Top achievements
Rank 1
 answered on 08 Aug 2012
2 answers
106 views
hello everyone

i'm trying to do something very similar to Grid / Hierarchy with Templates but i can't use the datasource the same way.

We use Entity Framework with custom object and so we need to databind the data with the event OnNeedDataSource.
Everything is working fine except that the HierarchyLoadMode="ServerBind" doesn't work because i can't set (or don't know how to) set the nestedViewSettings so the grid load all the usercontrol that is on the nestedView.

I want to load the user control only when it is showed and not in any other case.
I tried to let the usercontrol be load but without bind the data on it. At this point it's fast enough but I can't figure out which row is expand in the page_load to know if i have to load the data or not.


mathieu
Top achievements
Rank 1
 answered on 08 Aug 2012
3 answers
108 views
Hello,

A grid was dynamically created with 2 Rad combobox controls and 14 Rad numeric controls as columns. As more rows are added to the grid control and placed in edit mode, the creation of the new rows on the grid become slower. Basically, when the grid gets to about 20 rows the time required to add the new row and place all rows into edit mode becomes unacceptable. Also, since the comboboxes are related, the time it takes to load items within the second combo box gets slower.

I realize that adding RAD controls to the grid and placing them in edit mode adds complexity to the creation of the page, especially when all rows are placed in edit mode. I would really like to get this resolved since our requirement is to be able to have all rows in edit mode and provide the capability to quickly enter data without a performance hit.

Provided is sample code of how the issue is created. Any help in resolving the performance issues would be appreciated. You will notice that when you click on the Add button and continue to add rows to the page, the process gets slower and slower.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default4.aspx.cs" Inherits="Default4" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
 
<body>
    <form id="form1" runat="server">   
    <div>
        <asp:Button ID="ButtonAdd" runat="server" Text="Add Row" OnClick="ButtonAdd_Click" />       
        <asp:placeholder ID="Placeholder1" runat="server"></asp:placeholder>
    </div>
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" />
    </form>
</body>
</html>


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
using Telerik.Web.UI;
 
public partial class Default4 : System.Web.UI.Page
{
 
    private List<ProjectItem> ProjectItemList
    {
        get
        {
            if (ViewState["ProjectItemList"] == null)
            {
 
                ProjectItem projectItem = new ProjectItem();
 
                List<ProjectItem> list = new List<ProjectItem>();
                list.Add(projectItem);
 
                ViewState["ProjectItemList"] = list;
            }
            return (List<ProjectItem>)ViewState["ProjectItemList"];
        }
 
        set { ViewState["ProjectItemList"] = value; }
    }
 
    private List<ProjectCode> ProjectCodeList
    {
        get
        {
            if (ViewState["ProjectCodeList"] == null)
            {
 
                List<ProjectCode> list = new List<ProjectCode>();
 
                list.Add(new ProjectCode("P1", "Project 1"));
                list.Add(new ProjectCode("P2", "Project 2"));
                list.Add(new ProjectCode("P3", "Project 3"));
                list.Add(new ProjectCode("P4", "Project 4"));
                list.Add(new ProjectCode("P5", "Project 5"));
                list.Add(new ProjectCode("P6", "Project 6"));
                list.Add(new ProjectCode("P7", "Project 7"));
 
                ViewState["ProjectCodeList"] = list;
            }
            return (List<ProjectCode>)ViewState["ProjectCodeList"];
        }
 
        set { ViewState["ProjectCodeList"] = value; }
    }
 
    private List<ChargeCode> ChargeCodeList
    {
        get
        {
            if (ViewState["ChargeCodeList"] == null)
            {
 
                List<ChargeCode> list = new List<ChargeCode>();
 
                list.Add(new ChargeCode("C1", "Charge Code A", "P1"));
                list.Add(new ChargeCode("C2", "Charge Code B", "P1"));
                list.Add(new ChargeCode("C3", "Charge Code C", "P1"));
                list.Add(new ChargeCode("C4", "Charge Code D", "P2"));
                list.Add(new ChargeCode("C5", "Charge Code E", "P2"));
                list.Add(new ChargeCode("C6", "Charge Code F", "P3"));
                list.Add(new ChargeCode("C7", "Charge Code G", "P3"));
                list.Add(new ChargeCode("C8", "Charge Code H", "P3"));
                list.Add(new ChargeCode("C9", "Charge Code I", "P4"));
                list.Add(new ChargeCode("C10", "Charge Code J", "P4"));
                list.Add(new ChargeCode("C11", "Charge Code K", "P5"));
                list.Add(new ChargeCode("C12", "Charge Code L", "P5"));
                list.Add(new ChargeCode("C13", "Charge Code M", "P6"));
                list.Add(new ChargeCode("C14", "Charge Code N", "P6"));
                list.Add(new ChargeCode("C15", "Charge Code O", "P7"));
                list.Add(new ChargeCode("C16", "Charge Code P", "P7"));
                list.Add(new ChargeCode("C17", "Charge Code Q", "P7"));
 
                ViewState["ChargeCodeList"] = list;
            }
            return (List<ChargeCode>)ViewState["ChargeCodeList"];
        }
 
        set { ViewState["ChargeCodeList"] = value; }
    }
 
    protected RadGrid Grid
    {
        get;
        set;
    }
 
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
 
        this.InitializeGrid();
    }
 
 
    protected void Page_Load(object sender, EventArgs e)
    {
        InitializeAjaxManager();
 
        // Set grid items in edit mode.
        Grid.EditIndexes.Clear();
        for (int i = 0; i < ProjectItemList.Count; i++)
        {
            Grid.EditIndexes.Add(i);
        }
    }
 
 
    private void InitializeAjaxManager()
    {
        RadAjaxManager ajaxManager = RadAjaxManager.GetCurrent(Page);
 
        if (ajaxManager == null)
            return;
 
        ajaxManager.AjaxSettings.AddAjaxSetting(ButtonAdd, Grid);
        ajaxManager.AjaxSettings.AddAjaxSetting(Grid, Grid);
    }
 
 
    private void InitializeGrid()
    {
        GridBoundColumn boundColumn;
        GridNumericColumn numericColumn;
        GridDropDownColumn dropDownColumn;
 
        Grid = new RadGrid();
 
        // Setup required event handlers.
        Grid.NeedDataSource += new GridNeedDataSourceEventHandler(Grid_NeedDataSource);
        Grid.ItemCreated += new GridItemEventHandler(Grid_ItemCreated);
        Grid.ItemDataBound += new GridItemEventHandler(Grid_ItemDataBound);
                 
        Grid.ID = "GridProject";
        Grid.AllowSorting = false;
        Grid.AutoGenerateColumns = false;
        Grid.AllowMultiRowEdit = true;
        Grid.Width = Unit.Percentage(100);
         
        Grid.ClientSettings.Selecting.AllowRowSelect = false;       
                 
        Grid.MasterTableView.DataKeyNames = new string[] { "Id" };
        Grid.MasterTableView.Name = "MasterTableViewProject";
        Grid.MasterTableView.DataMember = "ProjectItem";
        Grid.MasterTableView.EditMode = GridEditMode.InPlace;       
 
        // Initialize the grid columns.
 
        boundColumn = new GridBoundColumn();
        Grid.MasterTableView.Columns.Add(boundColumn);
        boundColumn.Visible = false;
        boundColumn.UniqueName = "Id";
        boundColumn.DataField = "Id";
        boundColumn.HeaderText = "Id";
 
        dropDownColumn = new GridDropDownColumn();
        Grid.MasterTableView.Columns.Add(dropDownColumn);
        dropDownColumn.Visible = true;
        dropDownColumn.UniqueName = "ComboBoxProjectCode";
        dropDownColumn.DataField = "ProjectCode";
        dropDownColumn.HeaderText = "Project Code";
        dropDownColumn.HeaderStyle.Width = Unit.Pixel(200);
        dropDownColumn.ItemStyle.Width = Unit.Pixel(200);
        dropDownColumn.DropDownControlType = GridDropDownColumnControlType.RadComboBox;       
 
        dropDownColumn = new GridDropDownColumn();
        Grid.MasterTableView.Columns.Add(dropDownColumn);
        dropDownColumn.Visible = true;
        dropDownColumn.UniqueName = "ComboBoxChargeCode";
        dropDownColumn.DataField = "ChargeCode";
        dropDownColumn.HeaderText = "Charge Code";
        dropDownColumn.HeaderStyle.Width = Unit.Pixel(200);
        dropDownColumn.ItemStyle.Width = Unit.Pixel(200);
        dropDownColumn.DropDownControlType = GridDropDownColumnControlType.RadComboBox;
                 
        for (int i = 0; i < 14; i++)
        {
             
            numericColumn = new GridNumericColumn();
            Grid.MasterTableView.Columns.Add(numericColumn);
            numericColumn.Visible = true;
            numericColumn.UniqueName = "D" + i.ToString();
            numericColumn.DataField = "D" + i.ToString();
            numericColumn.HeaderText = "D" + i.ToString();
            numericColumn.DecimalDigits = 2;
            numericColumn.HeaderStyle.Width = Unit.Pixel(50);
            numericColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Right;
            numericColumn.ItemStyle.Width = Unit.Pixel(50);
            numericColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
            numericColumn.ReadOnly = false;
             
        }       
 
        Placeholder1.Controls.Add(this.Grid);
    }   
    
    void Grid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        Grid.DataSource = ProjectItemList;
    }   
 
    void Grid_ItemCreated(object sender, GridItemEventArgs e)
    {
        if ((e.Item.IsInEditMode) && (e.Item is GridDataItem))
        {
 
            GridDataItem gridDataItem = e.Item as GridDataItem;
 
            RadComboBox comboBoxProjectCode;
            comboBoxProjectCode = ((GridDropDownListColumnEditor)gridDataItem.EditManager.GetColumnEditor("ComboBoxProjectCode")).ComboBoxControl;
            comboBoxProjectCode.EmptyMessage = "Select Project Code";
            comboBoxProjectCode.AutoPostBack = true;
            comboBoxProjectCode.EnableLoadOnDemand = true;
            comboBoxProjectCode.MarkFirstMatch = true;
            comboBoxProjectCode.Filter = RadComboBoxFilter.StartsWith;
            comboBoxProjectCode.Width = Unit.Pixel(200);
            comboBoxProjectCode.DropDownWidth = Unit.Pixel(300);
 
            comboBoxProjectCode.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(comboBoxProjectCode_SelectedIndexChanged);
            comboBoxProjectCode.ItemsRequested += new RadComboBoxItemsRequestedEventHandler(comboBoxProjectCode_ItemsRequested);
             
            RadComboBox comboBoxChargeCode;
            comboBoxChargeCode = ((GridDropDownListColumnEditor)gridDataItem.EditManager.GetColumnEditor("ComboBoxChargeCode")).ComboBoxControl;           
            comboBoxChargeCode.Width = Unit.Pixel(200);
            comboBoxChargeCode.EmptyMessage = "Select Charge Code";
            comboBoxChargeCode.EnableLoadOnDemand = true;
            comboBoxChargeCode.ItemsRequested += new RadComboBoxItemsRequestedEventHandler(comboBoxChargeCode_ItemsRequested);
 
 
            // Set data values for the combo box.
            if (gridDataItem.DataItem != null)
            {
                if (!string.IsNullOrEmpty(((ProjectItem)gridDataItem.DataItem).ProjectCode))
                {
                    comboBoxProjectCode.Items.Add(new RadComboBoxItem(((ProjectItem)gridDataItem.DataItem).ProjectName, ((ProjectItem)gridDataItem.DataItem).ProjectCode));
                }
 
                if (!string.IsNullOrEmpty(((ProjectItem)gridDataItem.DataItem).ChargeCodeName))
                {
                    comboBoxChargeCode.Items.Add(new RadComboBoxItem(((ProjectItem)gridDataItem.DataItem).ChargeCodeName, ((ProjectItem)gridDataItem.DataItem).ChargeCode));
                }
            }
 
        }
    }
 
    void Grid_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if ((e.Item.IsInEditMode) && (e.Item is GridDataItem))
        {
             
            GridDataItem gridDataItem = e.Item as GridDataItem;
            GridNumericColumnEditor columnEditor;           
 
            for (int i = 0; i < 14; i++)
            {               
                columnEditor = (GridNumericColumnEditor)gridDataItem.EditManager.GetColumnEditor("D" + i.ToString());
                columnEditor.NumericTextBox.Width = Unit.Percentage(100);
                columnEditor.NumericTextBox.EnabledStyle.HorizontalAlign = HorizontalAlign.Right;
                columnEditor.NumericTextBox.MinValue = 0;
                columnEditor.NumericTextBox.NumberFormat.DecimalDigits = 2;
                columnEditor.NumericTextBox.NumberFormat.KeepTrailingZerosOnFocus = true;
                columnEditor.NumericTextBox.NumberFormat.AllowRounding = true;
            }
        }
    }
    
    void comboBoxProjectCode_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {       
        GridDataItem gridDataItem = (sender as RadComboBox).NamingContainer as GridDataItem;
 
        RadComboBox comboBoxChargeCode;
        comboBoxChargeCode = ((GridDropDownListColumnEditor)gridDataItem.EditManager.GetColumnEditor("ComboBoxChargeCode")).ComboBoxControl;
        if (comboBoxChargeCode != null)
        {           
            comboBoxChargeCode.Text = string.Empty;
            comboBoxChargeCode.SelectedValue = string.Empty;
        }
    }
 
    void comboBoxProjectCode_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
    {
        RadComboBox comboBoxProjectCode = sender as RadComboBox;
 
        comboBoxProjectCode.Items.Clear();
        foreach (ProjectCode projectCode in ProjectCodeList)
        {
            comboBoxProjectCode.Items.Add(new RadComboBoxItem(projectCode.Name, projectCode.Code));
        }
    }
 
    void comboBoxChargeCode_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
    {
        RadComboBox comboBoxChargeCode = sender as RadComboBox;
        GridDataItem gridDataItem = comboBoxChargeCode.NamingContainer as GridDataItem;
 
        RadComboBox comboBoxProjectCode;
        comboBoxProjectCode = ((GridDropDownListColumnEditor)gridDataItem.EditManager.GetColumnEditor("ComboBoxProjectCode")).ComboBoxControl;
 
        List<ChargeCode> list = ChargeCodeList.Where(code => code.ProjectCode == comboBoxProjectCode.SelectedValue).ToList();
 
        comboBoxChargeCode.Items.Clear();
        foreach (ChargeCode chargeCode in list)
        {
            comboBoxChargeCode.Items.Add(new RadComboBoxItem(chargeCode.Name, chargeCode.Code));
        }
    }
 
 
    protected void ButtonAdd_Click(object sender, EventArgs e)
    {       
 
        for (int i = 0; i < Grid.MasterTableView.Items.Count; i++)
        {
            GridDataItem gridDataItem = Grid.MasterTableView.Items[i];
 
            if (!Grid.MasterTableView.Items[i].IsInEditMode)
                continue;
 
            // Persist existing entered data.
            RadComboBox comboBoxProjectCode;
            comboBoxProjectCode = ((GridDropDownListColumnEditor)gridDataItem.EditManager.GetColumnEditor("ComboBoxProjectCode")).ComboBoxControl;
            ProjectItemList[i].ProjectCode = comboBoxProjectCode.SelectedValue;
            ProjectItemList[i].ProjectName = comboBoxProjectCode.Text;
 
            RadComboBox comboBoxChargeCode;
            comboBoxChargeCode = ((GridDropDownListColumnEditor)gridDataItem.EditManager.GetColumnEditor("ComboBoxChargeCode")).ComboBoxControl;
            ProjectItemList[i].ChargeCode = comboBoxChargeCode.SelectedValue;
            ProjectItemList[i].ChargeCodeName = comboBoxChargeCode.Text;
 
            GridNumericColumnEditor columnEditor;
            for (int j = 0; j < 14; j++)
            {
                columnEditor = (GridNumericColumnEditor)gridDataItem.EditManager.GetColumnEditor("D" + j.ToString());
                ProjectItemList[i].DataList[j] = (decimal)columnEditor.NumericTextBox.Value;
            }
        }
 
 
        ProjectItem projectItem = new ProjectItem();
        ProjectItemList.Add(projectItem);
 
        Grid.EditIndexes.Clear();
        for (int i = 0; i < ProjectItemList.Count; i++)
        {
            Grid.EditIndexes.Add(i);
        }
 
        Grid.Rebind();
    }
 
    [Serializable]
    private class ProjectItem
    {
        public ProjectItem()
        {  
            DataList = new List<decimal>();
 
            for (int i = 0; i < 14; i++)
            {
                DataList.Add(0);
            }
        }
 
        public long Id
        {
            get;
            set;
        }
 
        public string ProjectCode
        {
            get;
            set;
        }
 
        public string ProjectName
        {
            get;
            set;
        }
 
        public string ChargeCode
        {
            get;
            set;
        }
 
        public string ChargeCodeName
        {
            get;
            set;
        }
 
        public List<decimal> DataList
        {
            get;
            set;
        }
 
        public decimal D0
        {
            get { return DataList[0]; }
        }
 
        public decimal D1
        {
            get { return DataList[1]; }
        }
 
        public decimal D2
        {
            get { return DataList[2]; }
        }
 
        public decimal D3
        {
            get { return DataList[3]; }
        }
 
        public decimal D4
        {
            get { return DataList[4]; }
        }
 
        public decimal D5
        {
            get { return DataList[5]; }
        }
 
        public decimal D6
        {
            get { return DataList[6]; }
        }
 
        public decimal D7
        {
            get { return DataList[7]; }
        }
 
        public decimal D8
        {
            get { return DataList[8]; }
        }
 
        public decimal D9
        {
            get { return DataList[9]; }
        }
 
        public decimal D10
        {
            get { return DataList[10]; }
        }
 
        public decimal D11
        {
            get { return DataList[11]; }
        }
 
        public decimal D12
        {
            get { return DataList[12]; }
        }
 
        public decimal D13
        {
            get { return DataList[13]; }
        }
    }
 
    [Serializable]
    private class ProjectCode
    {
 
        public ProjectCode(string code, string name)
        {
            Code = code;
            Name = name;
        }
 
        public string Code
        {
            get;
            set;
        }
 
        public string Name
        {
            get;
            set;
        }
    }
 
    [Serializable]
    private class ChargeCode
    {
 
        public ChargeCode(string code, string name, string projectCode)
        {
            Code = code;
            Name = name;
            ProjectCode = projectCode;
        }
 
        public string Code
        {
            get;
            set;
        }
 
        public string Name
        {
            get;
            set;
        }
 
        public string ProjectCode
        {
            get;
            set;
        }
    }
}

Pavlina
Telerik team
 answered on 08 Aug 2012
2 answers
71 views
Hi,

In my grid I have paging enabled but I want to hide the page numbers to be shown from Create/update screen.
In create/ Update screen I am already hiding the list of records as follows:
protected void rgTest_PreRender(object sender, System.EventArgs e)
       {
           //Hide All Rows on insert and Display the insert Form Only
           if (rgTest.MasterTableView.IsItemInserted)
           {
               foreach (GridItem item in rgTest.Items)
               {
                   item.Visible = false;
               }
           }
           //Hide All Rows on edit and Display the edit Form Only
           else if (rgTest.EditItems.Count > 0)
           {
               foreach (GridDataItem item inrgTest.MasterTableView.Items)
               {
                   if (item != rgTest.EditItems[0])
                   {
                       item.Visible = false;
                   }
               }
           }
       }

Prachi
Top achievements
Rank 1
 answered on 08 Aug 2012
3 answers
281 views
I have a radgrid with template column as follows :

 <telerik:GridTemplateColumn UniqueName="Priority" DataField="Priority" HeaderText="Priority"
                        ItemStyle-Width="125px" HeaderStyle-Width="125px">
                         <ItemTemplate>
                            <asp:Literal ID="ltlPriority" Text='<%# string.IsNullOrEmpty(Eval("Priority").ToString()) ? 0 : (int)Eval("Priority") %>'
                                runat="server"></asp:Literal>
                        </ItemTemplate>
                        <EditItemTemplate>  
                            <telerik:RadComboBox ID="cmbPriority" runat="server">                          
                            </telerik:RadComboBox>     
                        </EditItemTemplate>
 </telerik:GridTemplateColumn>

I have to populate the cmbPriority Combobox with numbers equal to total row count.
(if row count is 5, the combobox should show 1,2,3,4,5)

OnItemDatabound this is what I have ::

 if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                GridEditableItem item = (GridEditableItem)e.Item;
                object tmpobj = item.FindControl("cmbPriority");
                if (tmpobj != null)
                {
                    RadComboBox ddc = tmpobj as RadComboBox;
                    int nbrofrows = rgProducts.MasterTableView.Items.Count;
               
                    List<ProductPriority> priorities = new List<ProductPriority>();
                    //List<int> priorities = new List<int>();
                    for (int i = 1; i <= nbrofrows; i++)
                    {
                        ProductPriority pp = new ProductPriority();
                        pp.Priority = i;
                        priorities.Add(pp);
                    }
                    ddc.DataSource = priorities;
                    ddc.DataTextField = "Priority";
                    ddc.DataValueField = "Priority";
                    ddc.DataBind();
                }
            }

On "Add" command, nbrofrows has the right count.
 But, On 'Edit' command, the count is always zero.

Thanks !!!!
Sri
Jayesh Goyani
Top achievements
Rank 2
 answered on 08 Aug 2012
1 answer
89 views
Hi, i'm having a problem with the rendering of multiline items.
Attached goes an image of the problem.
I'm using Web20 Skin, this style and code
.WrappingItem
{
    white-space: normal !important;
}
 
 protected override void OnItemCreated(RadMenuEventArgs e)
        {
            e.Item.CssClass = "WrappingItem";
         //   e.Item.GroupSettings.Flow = ItemFlow.Vertical;
            base.OnItemCreated(e);
        }


Can anyone tell me how can i solve this "problem"?
thank you

Ivan Zhekov
Telerik team
 answered on 08 Aug 2012
8 answers
591 views
Hi,
I am using Telerik rad grid version 2010.1.519 in VS 2010 project.
Is it possible to have select All check box at row level? For example, if select check box at column 1 and row 1, all check boxes should be checked in the row1 like attached the screenshot (2nd row).
Could you please help me?
Thanks
Rhbkv
Top achievements
Rank 1
 answered on 08 Aug 2012
2 answers
305 views
With the old Telerik grid I could call row.Index client-side and get the index of the row within the page.

I can't seem to find anything equivalent with the new grid - am I missing something obvious?

Thanks,

Stephen
mathieu cupryk
Top achievements
Rank 1
 answered on 08 Aug 2012
1 answer
67 views
I need disable the drag and drop for some columns such as : Update, Delete and select.
It is possible?

thanks
Jayesh Goyani
Top achievements
Rank 2
 answered on 08 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?