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

I have a large grid with a radrating control in one of the column templates.  Since the grid is so large, it takes a bit of time to load when the user rates an item.  I'd like to only have the row that is rated refresh.  I'm curious if that is even possible?

I tried putting an ajax panel around the item template in the grid that contains the rating control, but that is not really feasible.  The whole row needs to update its values, not just the radrating column in that row.

I did find that someone else asked the same question and Telerik answered in a support ticket, but the support ticket isn't viewable of course:  http://www.telerik.com/community/forums/aspnet-ajax/grid/ajax-single-row-rebing.aspx

I'm going to continue to experiment, but I thought it would make sense to ask if I am headed down a dead-end road, so to speak.

Can someone point me in the right direction if it is possible?  Thanks much.  I really appreciate these forums.


Maria Ilieva
Telerik team
 answered on 23 Oct 2013
10 answers
371 views
I have the following Control:
<telerik:RadTextBox ID="txtSoldTo" runat="server" EmptyMessage="Enter Sold To Person" CssClass="txtSoldTo">
    </telerik:RadTextBox>

Then I have the following CSS:
.txtSoldTo
{
    position: relative;
    top: -155px;
    left: 250px;
    float: left;
    width: 100px;
}

The width is not working.  How do I set the width via CSS?  I notice when I look at the markup on the served page that I see the 'size' as 20.







Sonia
Top achievements
Rank 1
 answered on 23 Oct 2013
5 answers
281 views
How can i add multiple drop down lists, from different datatables as the datasource, using the following code?

Currently i have a dropdown lists for "DurationType", but lets say i wanted to add a dropdown list for "Description" and "Size", how would i be able to do that since i already have code that generates one.


invoicer.cs
public class invoicer
{
    public class MyTemplate : ITemplate
    {
        private string colname;
        protected Label lControl;
 
        public MyTemplate(string cName)
        {
            colname = cName;
        }
        public void InstantiateIn(System.Web.UI.Control container)
        {
            lControl = new Label();
            lControl.ID = "Label-DurationType";
            lControl.DataBinding += new EventHandler(lControl_DataBinding);
            container.Controls.Add(lControl);
        }
 
        public void lControl_DataBinding(object sender, EventArgs e)
        {
            Label l = (Label)sender;
            GridDataItem container = (GridDataItem)l.NamingContainer;
            l.Text = ((DataRowView)container.DataItem)[colname].ToString() + "<br />";
        }
    }
 
 
    public class MyEditTemplate : IBindableTemplate
    {
        public void InstantiateIn(Control container)
        {
            GridEditableItem item = ((GridEditableItem)(container.NamingContainer));
            DropDownList drop = new DropDownList();
            drop.ID = "DurationType-DDL";
            drop.DataSource = (DataTable)GetTableForDropDown();
            drop.DataTextField = "DurationType";
            drop.DataValueField = "DurationType";
            container.Controls.Add(drop);
        }
 
        public System.Collections.Specialized.IOrderedDictionary ExtractValues(System.Web.UI.Control container)
        {
            OrderedDictionary od = new OrderedDictionary();
            od.Add("DurationType", ((DropDownList)(((GridDataItem)(container)).FindControl("DurationType-DDL"))).DataValueField);
            return od;
        }
    }
 
    void grid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        RadGrid grid = (RadGrid)sender;
        string id = grid.ID;
         
        DataTable current = (DataTable)HttpContext.Current.Session[int.Parse(id.Split(new string[] {"RadGrid"},StringSplitOptions.RemoveEmptyEntries)[0])];
        grid.DataSource = current;
    }
 
 
 
    protected void grid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            GridEditableItem editItem = (GridEditableItem)e.Item;
            DropDownList ddl = (DropDownList)editItem.FindControl("DurationType-DDL");
            ddl.DataSource = (DataTable)GetTableForDropDown();
            ddl.DataTextField = "DurationType";
            ddl.DataValueField = "DurationType";
            ddl.SelectedIndex = editItem.ItemIndex;
            ddl.SelectedValue = DataBinder.Eval(editItem.DataItem, "DurationType").ToString(); // To get the selected value        
        }
    }
 
 
    public void DefineGridStructure(int i, PlaceHolder ph,Boolean bl)
    {
 
        RadGrid grid = new RadGrid();
        grid.ID = "RadGrid" + i.ToString();
        grid.Visible = bl;
        grid.NeedDataSource += new GridNeedDataSourceEventHandler(grid_NeedDataSource);
        grid.AutoGenerateEditColumn = true;
        grid.AutoGenerateDeleteColumn = true;
        grid.AllowAutomaticInserts = false;
        grid.Width = Unit.Percentage(100);
        grid.PageSize = 15;
        grid.AllowPaging = true;
        grid.AllowFilteringByColumn = false;
        grid.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
        grid.AutoGenerateColumns = false;
        grid.MasterTableView.Width = Unit.Percentage(100);
        grid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.TopAndBottom;
        grid.AllowAutomaticDeletes = false;
        grid.AllowAutomaticUpdates = false;
        grid.ItemDataBound += new GridItemEventHandler(grid_ItemDataBound);
        grid.InsertCommand += grid_InsertCommand;
        grid.DeleteCommand += grid_DeleteCommand;
        grid.UpdateCommand += grid_UpdateCommand;
        grid.MasterTableView.DataKeyNames = new string[] { "RowNumber" };
        GridBoundColumn boundColumn = new GridBoundColumn();
        boundColumn.DataField = "RowNumber";
        boundColumn.HeaderText = "RowNumber";
        boundColumn.ReadOnly = true;
        grid.MasterTableView.Columns.Add(boundColumn);
        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "Size";
        boundColumn.HeaderText = "Size";
        grid.MasterTableView.Columns.Add(boundColumn);
        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "Description";
        boundColumn.HeaderText = "Description";
        grid.MasterTableView.Columns.Add(boundColumn);
        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "Quantity";
        boundColumn.HeaderText = "Quantity";
        grid.MasterTableView.Columns.Add(boundColumn);
        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "Unit";
        boundColumn.HeaderText = "Unit";
        grid.MasterTableView.Columns.Add(boundColumn);
         
        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "Duration";
        boundColumn.HeaderText = "Duration";
        grid.MasterTableView.Columns.Add(boundColumn);
 
        GridTemplateColumn objGridTemplateColumn = new GridTemplateColumn();
        objGridTemplateColumn.HeaderText = "DurationType";
        objGridTemplateColumn.DataField = "DurationType";
        objGridTemplateColumn.ItemTemplate = new MyTemplate("DurationType");
        objGridTemplateColumn.EditItemTemplate = new MyEditTemplate();
        grid.MasterTableView.Columns.Add(objGridTemplateColumn);
 
        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "Amount";
        boundColumn.HeaderText = "Amount";
        grid.MasterTableView.Columns.Add(boundColumn);
        grid.MasterTableView.EditMode = GridEditMode.InPlace;
 
        LinkButton lb = new LinkButton();
        lb.ID = "Show-Grid-" + i.ToString();
        lb.Text = "Show Grid " + i.ToString();
        lb.Click += new EventHandler(ShowGrid);
 
        LinkButton lbd = new LinkButton();
        lbd.ID = "Delete-Grid-" + i.ToString();
        lbd.Text = "Delete Grid " + i.ToString();
        lbd.Click += (sender, e) => DeleteGrid(sender, e, ph);
        Label lbl = new Label();
        lbl.ID = "Break-" + i.ToString();
        lbl.Text = "<br>";
 
        ph.Controls.Add(lb);
        ph.Controls.Add(lbd);
        ph.Controls.Add(grid);
        ph.Controls.Add(lbl);
    }
 
 
    public void DeleteGrid(object sender, EventArgs e, PlaceHolder ph)
    {
        LinkButton gridLink = (LinkButton)sender;
        String gridNum = gridLink.ID.ToString().Split('-').Last();
 
        System.Web.UI.Page currentPage;
        currentPage = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;
 
        RadGrid grid = (RadGrid)currentPage.FindControl("RadGrid" + gridNum);
        Label lbl = (Label)currentPage.FindControl("Break-" + gridNum);
        LinkButton lbd = (LinkButton)currentPage.FindControl("Delete-Grid-" + gridNum);
        LinkButton lb = (LinkButton)currentPage.FindControl("Show-Grid-" + gridNum);
 
        ph.Controls.Remove(grid);
        ph.Controls.Remove(lbl);
        ph.Controls.Remove(lb);
        ph.Controls.Remove(lbd);
 
        int next = Convert.ToInt32(GetSession());
        next = next - 1;
        HttpContext.Current.Session.Add("Tables", next);
        HttpContext.Current.Session.Remove(gridNum);
        ph.Controls.Clear();
        loopGrids(ph);
    }
 
 
 
    public void loopGrids(PlaceHolder ph)
    {
        System.Web.UI.Page currentPage;
        currentPage = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;
 
        string ctrlname = currentPage.Request.Params.Get("__EVENTTARGET");
        for (int i = 1; i <= (int)HttpContext.Current.Session["Tables"]; i++)
        {
            if (i == (int)HttpContext.Current.Session["Tables"])
            {
                if (ctrlname == "Button1")
                {
                    DefineGridStructure(i, ph, false);
                }
                else
                {
                    DefineGridStructure(i, ph, true);
                }
            }
            else
            {
                DefineGridStructure(i, ph, false);
            }
        }
    }
 
 
 
 
    public void ShowGrid(object sender, EventArgs e)
    {
        LinkButton gridLink = (LinkButton)sender;
        String gridNum = gridLink.ID.ToString().Split('-').Last();
 
        System.Web.UI.Page currentPage;
        currentPage = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;
 
        HttpContext.Current.Response.Write("Current gridnum: " + gridNum);
 
        RadGrid grid = (RadGrid)currentPage.FindControl("RadGrid" + gridNum);
        if (grid.Visible)
        {
            grid.Visible = false;
        }
        else
        {
            grid.Visible = true;
        }
    }
 
 
    public void grid_UpdateCommand(object sender, GridCommandEventArgs e)
    {
        GridEditableItem editItem = e.Item as GridEditableItem;
        Hashtable newValues = new Hashtable();
        newValues["RowNumber"] = (editItem["RowNumber"].Controls[0] as TextBox).Text;
        newValues["Size"] = (editItem["Size"].Controls[0] as TextBox).Text;
        newValues["Description"] = (editItem["Description"].Controls[0] as TextBox).Text;
        newValues["Quantity"] = (editItem["Quantity"].Controls[0] as TextBox).Text;
        newValues["Unit"] = (editItem["Unit"].Controls[0] as TextBox).Text;
        newValues["Duration"] = (editItem["Duration"].Controls[0] as TextBox).Text;
        newValues["DurationType"] = (editItem.FindControl("DurationType-DDL") as DropDownList).SelectedValue;
        newValues["Amount"] = (editItem["Amount"].Controls[0] as TextBox).Text;
        DataTable dtCurrentTable = (DataTable)HttpContext.Current.Session[int.Parse(editItem.OwnerGridID.Split(new string[] { "RadGrid" }, StringSplitOptions.RemoveEmptyEntries)[0])];
 
        foreach (DictionaryEntry entry in newValues)
        {
            dtCurrentTable.Rows[e.Item.ItemIndex][entry.Key.ToString()] = entry.Value;
        }
        SaveTable(editItem.OwnerGridID);
 
    }
 
    public void grid_DeleteCommand(object sender, GridCommandEventArgs e)
    {
        GridDataItem item = e.Item as GridDataItem;
        DataTable dt = (DataTable)HttpContext.Current.Session[int.Parse(item.OwnerGridID.Split(new string[] { "RadGrid" }, StringSplitOptions.RemoveEmptyEntries)[0])];
        dt.Rows.Remove(dt.Rows[item.ItemIndex]);
        ResetRowID(dt);
        SaveTable(item.OwnerGridID);
    }
 
    public void grid_InsertCommand(object sender, GridCommandEventArgs e)
    {
        GridEditableItem editedItem = e.Item as GridEditableItem;
        GridEditManager editMan = editedItem.EditManager;
        //Set new values
        Hashtable newValues = new Hashtable();
        //The GridTableView will fill the values from all editable columns in the hash
 
        DataTable dtCurrentTable = (DataTable)HttpContext.Current.Session[int.Parse(editedItem.OwnerGridID.Split(new string[] { "RadGrid" }, StringSplitOptions.RemoveEmptyEntries)[0])];
        DataRow dr = null;
        int count = dtCurrentTable.Rows.Count;
        count++;
        dr = dtCurrentTable.NewRow();
        dr["RowNumber"] = count;
        newValues["RowNumber"] = count;
        newValues["Size"] = (editedItem["Size"].Controls[0] as TextBox).Text;
        newValues["Description"] = (editedItem["Description"].Controls[0] as TextBox).Text;
        newValues["Quantity"] = (editedItem["Quantity"].Controls[0] as TextBox).Text;
        newValues["Unit"] = (editedItem["Unit"].Controls[0] as TextBox).Text;
        newValues["Duration"] = (editedItem["Duration"].Controls[0] as TextBox).Text;
        newValues["DurationType"] = (editedItem.FindControl("DurationType-DDL") as DropDownList).SelectedValue;
        newValues["Amount"] = (editedItem["Amount"].Controls[0] as TextBox).Text;
        foreach (DictionaryEntry entry in newValues)
        {
            dr[entry.Key.ToString()] = entry.Value;
        }
        dtCurrentTable.Rows.Add(dr);
        SaveTable(editedItem.OwnerGridID);
    }
 
 
 
    public string GetSession()
    {
        string SID = HttpContext.Current.Session["Tables"].ToString();
        return SID;
    }
 
    public void SaveTable(string id)
    {
        DataTable dtCurrentTable = (DataTable)HttpContext.Current.Session[int.Parse(id.Split(new string[] { "RadGrid" }, StringSplitOptions.RemoveEmptyEntries)[0])];
        HttpContext.Current.Session.Add(id.Split(new string[] { "RadGrid" }, StringSplitOptions.RemoveEmptyEntries)[0], dtCurrentTable);
    }
 
    public DataTable GetTable()
    {
        //
        // Here we create a DataTable with a few columns.
        //
        // Create Datatable to store all colums
        DataTable dt = new DataTable();
        DataRow dr = null;
        dt.Columns.Add(new DataColumn("RowNumber", typeof(string)));
        dt.Columns.Add(new DataColumn("Size", typeof(string)));
        dt.Columns.Add(new DataColumn("Description", typeof(string)));
        dt.Columns.Add(new DataColumn("Quantity", typeof(string)));
        dt.Columns.Add(new DataColumn("Unit", typeof(string)));
        dt.Columns.Add(new DataColumn("Duration", typeof(string)));
        dt.Columns.Add(new DataColumn("DurationType", typeof(string)));
        dt.Columns.Add(new DataColumn("Amount", typeof(string)));
        dr = dt.NewRow();
        dr["RowNumber"] = 1;
        dr["Size"] = string.Empty;
        dr["Description"] = string.Empty;
        dr["Quantity"] = string.Empty;
        dr["Unit"] = string.Empty;
        dr["Duration"] = string.Empty;
        dr["DurationType"] = string.Empty;
        dr["Amount"] = string.Empty;
        dt.Rows.Add(dr);
 
        dr = dt.NewRow();
        dr["RowNumber"] = 2;
        dr["Size"] = string.Empty;
        dr["Description"] = string.Empty;
        dr["Quantity"] = string.Empty;
        dr["Unit"] = string.Empty;
        dr["Duration"] = string.Empty;
        dr["DurationType"] = string.Empty;
        dr["Amount"] = string.Empty;
        dt.Rows.Add(dr);
 
        dr = dt.NewRow();
        dr["RowNumber"] = 3;
        dr["Size"] = string.Empty;
        dr["Description"] = string.Empty;
        dr["Quantity"] = string.Empty;
        dr["Unit"] = string.Empty;
        dr["Duration"] = string.Empty;
        dr["DurationType"] = string.Empty;
        dr["Amount"] = string.Empty;
        dt.Rows.Add(dr);
 
        dr = dt.NewRow();
        dr["RowNumber"] = 4;
        dr["Size"] = string.Empty;
        dr["Description"] = string.Empty;
        dr["Quantity"] = string.Empty;
        dr["Unit"] = string.Empty;
        dr["Duration"] = string.Empty;
        dr["DurationType"] = string.Empty;
        dr["Amount"] = string.Empty;
        dt.Rows.Add(dr);
 
        dr = dt.NewRow();
        dr["RowNumber"] = 5;
        dr["Size"] = string.Empty;
        dr["Description"] = string.Empty;
        dr["Quantity"] = string.Empty;
        dr["Unit"] = string.Empty;
        dr["Duration"] = string.Empty;
        dr["DurationType"] = string.Empty;
        dr["Amount"] = string.Empty;
        dt.Rows.Add(dr);
        return dt;
    }
 
 
    static DataTable GetTableForDropDown()
    {
        //
        // Here we create a DataTable with a few columns.
        //
        // Create Datatable to store all colums
        DataTable dt = new DataTable();
        DataRow dr = null;
        dt.Columns.Add(new DataColumn("DurationType", typeof(string)));
 
        dr = dt.NewRow();
        dr["DurationType"] = "Hours";
        dt.Rows.Add(dr);
 
        dr = dt.NewRow();
        dr["DurationType"] = "Days";
        dt.Rows.Add(dr);
 
        dr = dt.NewRow();
        dr["DurationType"] = "Weeks";
        dt.Rows.Add(dr);
 
        dr = dt.NewRow();
        dr["DurationType"] = "Months";
        dt.Rows.Add(dr);
        return dt;
    }
 
    private void ResetRowID(DataTable dt)
    {
        int rowNumber = 1;
 
        if (dt.Rows.Count > 0)
        {
            foreach (DataRow row in dt.Rows)
            {
                row[0] = rowNumber;
                rowNumber++;
            }
        }
    }
}


default.aspx.cs
public partial class _Default : System.Web.UI.Page
{
 
    invoicer inv = new invoicer();
   
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
 
    protected void Page_Init(object sender, EventArgs e)
    {
        string ctrlname = this.Page.Request.Params.Get("__EVENTTARGET");
 
        if (Session["Tables"] == null)
        {
            Session.Add("Tables", 1);
            DataTable dt = inv.GetTable();
 
            Session.Add(Session["Tables"].ToString(), dt);
            inv.DefineGridStructure(1, PlaceHolder2, true);
        }
        if (IsPostBack)
        {
            int next = Convert.ToInt32(inv.GetSession());
            PlaceHolder2.Controls.Clear();
            inv.loopGrids(PlaceHolder2);
             
            if (ctrlname == "Button1")
            {
                next = next + 1;
                Session.Add("Tables",next);
                Response.Write("Button getSession: " + inv.GetSession());
                DataTable dt = inv.GetTable();
                Session.Add(Session["Tables"].ToString(), dt);
                inv.DefineGridStructure(next, PlaceHolder2,true);
            }
 
        }
    }
 
 
 
 
    protected void Button1_Click(object sender, EventArgs e)
    {
 
    }
     
}
Antonio Stoilkov
Telerik team
 answered on 23 Oct 2013
1 answer
111 views
I've had to set EnableEmbeddedBaseStylesheet to false in order to reduce the size of the rows in RadGrid, as we needed to conserve screen space.

This is my applied CSS change.

.RadGrid_Black .rgRow td,
 .RadGrid_Black .rgAltRow td,
 .RadGrid_Black .rgEditRow td,
 .RadGrid_Black .rgFooter td
 {
    border-style: solid;
    border-width: 0 0 1px 0;
    line-height: 15px;
    height: 15px ;
    font-size: 12px;
}


This page also contains a TabStrip which loads different ASCS controls and I have discovered that when I change any of these tabs the RadGrid reverts back to it's previous appearance, as if EnableEmbeddedBaseStylesheet had been set back to true.

I have so far been unable to find a work around for this bug, help would be appreciated.
Galin
Telerik team
 answered on 23 Oct 2013
5 answers
2.4K+ views
I have a grid bound to a datasource.
However, I have a settings page where the user can specify the number of characters to be displayed for any field in the grid.

I want to trim the column value based on that setting before the grid is displayed.
I was trying to do that in the ItemDataBound event.

Any suggestions how I can do that.
Princy
Top achievements
Rank 2
 answered on 23 Oct 2013
3 answers
86 views
I have the same problem as described here:
http://www.telerik.com/community/forums/aspnet-ajax/combobox/error-radcombobox-in-radwindow-with-ie8.aspx

My setup is:
IE 8.0
Telerik.web.ui.dll 2012.3.1205.35

Has the problem been fixed?




Jonas
Top achievements
Rank 1
 answered on 23 Oct 2013
1 answer
320 views
Hi Team Telerik,

Is batch editing mode compatible with a hierarchical grid? Here's why I ask:

So I was implementing Batch Edit mode throughout my application. It works fine on a single layer grid. However, when I try to apply it to a hierarchical grid, I run into problems.

First, I have a hierarchical grid with HierarchyLoadMode="Client". When I try to do any the batch CRUD operations, I get this viewstate error on the TOP level:

0x800a139e - JavaScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Failed to load viewstate.  The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.  For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.

So I set ViewStateMode="Disabled" on the Grid itself and that error goes away when I do CRUD operations on the top level. However, when I try to do CRUD operations on the second level, I get another error:

JavaScript critical error in (unknown source location)

SCRIPT1030: Conditional compilation is turned off

I've tried a couple of things to correct this error:

  1. I tried disabling the ViewStateMode on that GridTableView. Error still occurs.
  2. I tried removing HierarchyLoadMode="Client". It fixed the first error, but this "Conditional compilation is turned off" error still recurs.

My hierarchical grids are being powered by a SQLDataSource object.

I noticed that no one else complained about the error anywhere in the Grid forum, but I did find complaints about the error in the Telerik Reports forum and that was rectified with a version update. From that thread, I've inferred that the error seems to be related to jQuery somewhere inside the Telerik dll. I'm using Telerik AJAX version 2013.2.717.45

Is this a known issue?

Thanks in advance.
Jonathan
Jonathan
Top achievements
Rank 1
 answered on 23 Oct 2013
1 answer
217 views
I have a grid . I want only when click in edit link buton the info of Item will show on textboxName. But when I click no thing happen.
 I try to add <UpdatedControls> </UpdatedControls> then when i short grid the textbox also refress.

I also try add  RadAjaxPanel1.ResponseScripts.Add(String.Format("$find('{0}').ajaxRequest();", RadAjaxPanel1.ClientID));
when showdata but it does not work

<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All"
        EnableRoundedCorners="false" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"  >
    </telerik:RadAjaxLoadingPanel>
 
  <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
       <telerik:RadTextBox ID="txtName" runat="server">
</telerik:RadTextBox>
.....
      </telerik:RadAjaxPanel>
 
 
<telerik:RadGrid AutoGenerateColumns="False" ID="RadGrid1" AllowFilteringByColumn="True"
        AllowSorting="True" PageSize="15" ShowFooter="True" AllowPaging="True" runat="server" LoadingPanelID="RadAjaxLoadingPanel1"
        OnNeedDataSource="RadGrid1_NeedDataSource" CellSpacing="0" GridLines="None" OnItemDataBound="RadGrid1_ItemDataBound"
        OnItemCommand="RadGrid1_ItemCommand">
        <GroupingSettings CaseSensitive="false"></GroupingSettings>
        <FilterMenu EnableImageSprites="False">
        </FilterMenu>
        <MasterTableView AutoGenerateColumns="false" AllowFilteringByColumn="True" ShowFooter="True"
            DataKeyNames="Id">
            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
            <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            </RowIndicatorColumn>
            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            </ExpandCollapseColumn>
            <Columns>
     <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="_edit" CommandArgument="Id"
                    Text="Edit" UniqueName="Edit">
                </telerik:GridButtonColumn>
 </Columns>
            <EditFormSettings>
                <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
    </telerik:RadGrid>


Code Behind: 
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == "_edit")
        {
             int id = Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Id"]);
             LoadItem(id); // Show data to textbox
        }
    }

Thanks
Shinu
Top achievements
Rank 2
 answered on 23 Oct 2013
3 answers
173 views
Hi all how do i acess a ragrid inside a NestedViewTemplate

Best Regardas.

Princy
Top achievements
Rank 2
 answered on 23 Oct 2013
1 answer
147 views
I want to access the value of the inserted item, actually i want to create a folder by the same name programmatically after pressing insert.
Princy
Top achievements
Rank 2
 answered on 23 Oct 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?