locked
how to update the data in RadGrid.. RRS feed

  • Question

  • User-980271842 posted

    hello friend,

     

    can u please tell me how to update the data in the radgrid control.

     

    i have using the code below----

     

    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;using System.Data;
    public partial class Productname : System.Web.UI.Page{    protected void Page_Load(object sender, EventArgs e)    {        SqlMaster sqlMaster = new SqlMaster();        string SelectQuery = " SELECT ProductNameID, Name FROM EOProductName";       DataTable dt = sqlMaster.ExecuteDataset(SelectQuery).Tables[0];       rgProductName.DataSource = dt;       rgProductName.DataBind();
        }
        protected void rgProductName_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)    {        if (e.CommandName == RadGrid.UpdateCommandName)        {            SqlMaster sqlMaster = new SqlMaster();            string UpdateQuery = "UPDATE EOProductName SET Name = Name;";            sqlMaster.ExecuteNonQuery(UpdateQuery);                    }    }
        protected void rgProductName_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)    {            }    protected void rgProductName_ItemInserted(object source, Telerik.Web.UI.GridInsertedEventArgs e)    {    }}

     

     

     

     

     

    <telerik:RadGrid ID="rgProductName" runat="server" AutoGenerateColumns="false" PageSize="5" GridLines="None" AllowPaging="true" AllowSorting="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" OnItemInserted="rgProductName_ItemInserted" OnItemUpdated="rgProductName_ItemUpdated" OnItemCommand="rgProductName_ItemCommand" Skin="Hay">    <MasterTableView DataKeyNames="ProductNameID" GridLines="None" InsertItemDisplay="Top" Width="98%">     <PagerStyle Mode="NextPrevAndNumeric" />    <Columns>
        
        <telerik:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Product Name">    <HeaderStyle Width="100px"></HeaderStyle>    </telerik:GridBoundColumn>
       <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">    </telerik:GridEditCommandColumn>
        </Columns> 
        
            </MasterTableView>    </telerik:RadGrid>

     

     

    plz plz plz tell me how to do this code

     

    Friday, April 8, 2011 4:41 AM

Answers

  • User-980271842 posted

    i will doit and now code is working absolutely fine----

    <telerik:RadGrid ID="rgMaterial" runat="server" AutoGenerateColumns="false" PageSize="5"        GridLines="None" AllowPaging="true" AllowSorting="true" AllowAutomaticInserts="true"        AllowAutomaticUpdates="false" OnUpdateCommand="rgMaterial_UpdateCommand" Skin="Hay"        OnNeedDataSource="rgMaterial_NeedDataSource">        <MasterTableView DataKeyNames="MaterialID" GridLines="None" Width="98%">            <PagerStyle Mode="NextPrevAndNumeric" />            <Columns>                <telerik:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Material Name">                    <HeaderStyle Width="100px"></HeaderStyle>                </telerik:GridBoundColumn>                <telerik:GridEditCommandColumn>                </telerik:GridEditCommandColumn>            </Columns>            <EditFormSettings ColumnNumber="2" CaptionFormatString="Edit details for MaterialName with ID {0}"                CaptionDataField="MaterialID">                <FormTableItemStyle Wrap="False"></FormTableItemStyle>                <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>                <FormMainTableStyle CellSpacing="0" CellPadding="3" Width="100%" />                <FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" CssClass="module"                    Height="110px" Width="100%" />                <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>                <FormStyle Width="100%" BackColor="#EEF2EA"></FormStyle>                <EditColumn UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit">                </EditColumn>                <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>            </EditFormSettings>            <ExpandCollapseColumn Visible="False">                <HeaderStyle Width="19px"></HeaderStyle>            </ExpandCollapseColumn>            <RowIndicatorColumn Visible="False">                <HeaderStyle Width="20px" />            </RowIndicatorColumn>        </MasterTableView>    </telerik:RadGrid>

     

     

     

     

     protected void rgMaterial_NeedDataSource(object source, GridNeedDataSourceEventArgs e)    {        SqlMaster sqlMaster = new SqlMaster();        string SelectQuery = " SELECT MaterialID, Name FROM EOMaterial";        DataTable dt = sqlMaster.ExecuteDataset(SelectQuery).Tables[0];        rgMaterial.DataSource = dt;
        }

        protected void rgMaterial_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)    {
            GridEditableItem eeditedItem = e.Item as GridEditableItem;        string ID = eeditedItem.OwnerTableView.DataKeyValues[eeditedItem.ItemIndex]["MaterialID"].ToString();        string Name = (eeditedItem["Name"].Controls[0] as TextBox).Text;

            try        {
                SqlMaster sqlMaster = new SqlMaster();            string updateQuery = "UPDATE EOMaterial set Name='" + Name + "'where MaterialID='" + ID + "'";            sqlMaster.ExecuteNonQuery(updateQuery);


            }        catch (Exception ex)        {            rgMaterial.Controls.Add(new LiteralControl("Unable to update Product Name. Reason: " + ex.Message));            e.Canceled = true;        }
        }  

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 12, 2011 6:18 AM

All replies

  • User-1763610841 posted

    Here is a sample code that might help you. 

     

    <telerik:RadGrid ID="rgProductName" runat="server" AutoGenerateColumns="false" 
                PageSize="5" GridLines="None" 
             AllowPaging="true" AllowSorting="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" 
             OnItemInserted="rgProductName_ItemInserted" 
                OnItemUpdated="rgProductName_ItemUpdated" Skin="Hay" 
                onneeddatasource="rgProductName_NeedDataSource">    
         <MasterTableView DataKeyNames="ProductNameID" GridLines="None" InsertItemDisplay="Top" Width="98%">     
         <PagerStyle Mode="NextPrevAndNumeric" />    
         <Columns>    
            <telerik:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Product Name">    
             <HeaderStyle Width="100px"></HeaderStyle>    
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn UniqueName="TemplateColumn">
                <EditItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Update" Text="Update"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false" CommandName="Cancel"
                        Text="Cancel"></asp:LinkButton>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="false" CommandName="Edit"
                        Text="Edit"></asp:LinkButton>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
         </Columns> 
         </MasterTableView>
        </telerik:RadGrid>

    and the cs part

     

     

    protected void rgProductName_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            SqlMaster sqlMaster = new SqlMaster(); string SelectQuery = " SELECT ProductNameID, Name FROM EOProductName";
            DataTable dt = sqlMaster.ExecuteDataset(SelectQuery).Tables[0];
            rgProductName.DataSource = dt; 
        }
    
        protected void rgProductName_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            GridDataItem gdItem = (e.Item as GridDataItem);
            TextBox txtVal = (gdItem)["NAME"].Controls[0] as TextBox;
    
            try
            {
                string sVal = txtVal.Text.Trim();          
    
                // do update here and rebind
    
                rgProductName.Rebind();
            }
            catch (Exception ex)
            {
                RadAjaxManager1.Alert("Error in Loading tranc details: " + ex.Message);
            }
        }

     

    Try to use the NeedDataSource event of RadGrid, it can save you lot of extra work and next time past lengthy code though the code editor :)

     

    Friday, April 8, 2011 6:15 AM
  • User-980271842 posted

     



    why you can use

     

    <telerik:GridTemplateColumn UniqueName="TemplateColumn">
               
    <EditItemTemplate>
                   
    <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Update" Text="Update"></asp:LinkButton>
                    &nbsp;
    <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="false" CommandName="Cancel"
                       
    Text="Cancel"></asp:LinkButton>
               
    </EditItemTemplate>
               
    <ItemTemplate>
                   
    <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="false" CommandName="Edit"
                       
    Text="Edit"></asp:LinkButton>
               
    </ItemTemplate>
           
    </telerik:GridTemplateColumn>
    edititem template and item template

    it can create two update cancel button after clicking edit....

    and it cannot update the data.

     

    Friday, April 8, 2011 6:38 AM
  • User-980271842 posted

    i dont know but it can create two update cancel button when clicking on the edit button......

    Friday, April 8, 2011 6:55 AM
  • User-980271842 posted

    hey i have do this code

     

    protected void rgProductName_NeedDataSource(object source, GridNeedDataSourceEventArgs e)    {        SqlMaster sqlMaster = new SqlMaster();        string SelectQuery = " SELECT ProductNameID, Name FROM EOProductName";        DataTable dt = sqlMaster.ExecuteDataset(SelectQuery).Tables[0];        rgProductName.DataSource = dt;       }

        protected void rgProductName_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)    {                GridEditableItem eeditedItem = e.Item as GridEditableItem;                  string Name = (eeditedItem["Name"].Controls[0] as TextBox).Text;        
            try        {                           SqlMaster sqlMaster = new SqlMaster();            //Update Query to update the Datatable                 string updateQuery = "UPDATE EOProductName set Name='" + Name + "'";            sqlMaster.ExecuteNonQuery(updateQuery);            

            }        catch (Exception ex)        {            rgProductName.Controls.Add(new LiteralControl("Unable to update Employee. Reason: " + ex.Message));            e.Canceled = true;        }
        }  

     

     

     

     

     

    <telerik:RadGrid ID="rgProductName" runat="server" AutoGenerateColumns="false"             PageSize="5" GridLines="None"          AllowPaging="true" AllowSorting="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true"          OnUpdateCommand="rgProductName_UpdateCommand" Skin="Hay"             onneeddatasource="rgProductName_NeedDataSource">         <MasterTableView DataKeyNames="ProductNameID" GridLines="None" CommandItemDisplay ="Top" Width="98%">          <PagerStyle Mode="NextPrevAndNumeric" />    

         <Columns>            <telerik:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Product Name">             <HeaderStyle Width="100px"></HeaderStyle>            </telerik:GridBoundColumn>
           <telerik:GridEditCommandColumn>       </telerik:GridEditCommandColumn>     </Columns>      <EditFormSettings ColumnNumber="2" CaptionFormatString="Edit details for ProductName with ID {0}"                     CaptionDataField="ProductNameID">                      <FormTableItemStyle Wrap="False"></FormTableItemStyle>                     <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>                     <FormMainTableStyle CellSpacing="0" CellPadding="3" Width="100%" />                     <FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" CssClass="module"                         Height="110px" Width="100%" />                     <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>                     <FormStyle Width="100%" BackColor="#EEF2EA"></FormStyle>                     <EditColumn UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit">                      </EditColumn>                     <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>                 </EditFormSettings>                 <ExpandCollapseColumn Visible="False">                      <HeaderStyle Width="19px"></HeaderStyle>                 </ExpandCollapseColumn>                 <RowIndicatorColumn Visible="False">                      <HeaderStyle Width="20px" />                 </RowIndicatorColumn>     </MasterTableView>    </telerik:RadGrid>

     

     

     

    it will update the entire row

    but i want only the single row is updated...

    plz plz plz tell me how to change the code.

    Friday, April 8, 2011 7:26 AM
  • User-1763610841 posted

    If you are able to update the table then you only need to include the WHERE clause while updating as you said its updating the whole table not a single row. Include a WHERE clause that might include an ID column that is primary key in database. i.e

    Get the ProductIDName of row being edited and issue this statement, somewhat like:

    string _sName = (eeditedItem["Name"].Controls[0] as TextBox).Text;

    int _productId = Convert.ToInt32(rgSettings.MasterTableView.DataKeyValues[eeditedItem.ItemIndex]["ProductNameID"].ToString());

    Query: "UPDATE [EOProductName] SET [Name] = _sName WHERE ProductNameID = _productId"

    -- 

    Hope that helps

    Friday, April 8, 2011 8:24 AM
  • User-980271842 posted

    Error 1 The name 'rgSettings' does not exist in the current context C:\Documents and Settings\Lokeshb\Desktop\EyetecOptics\EyetecOptics\Productname.aspx.cs 39 42 C:\...\EyetecOptics\

     

    this error will occur.........

    Tuesday, April 12, 2011 2:49 AM
  • User-980271842 posted

    hey i have do this code like this.....and it work properly----but when item is edit the form is not closed and it still appearing and it is very confusing that record is updated till now or not.

     

    so plz tell me how to close the form after edit...ma code is like this---\

     

    <telerik:RadGrid ID="rgProductName" runat="server" AutoGenerateColumns="false"             PageSize="5" GridLines="None"          AllowPaging="true" AllowSorting="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true"          OnUpdateCommand="rgProductName_UpdateCommand" Skin="Hay"             onneeddatasource="rgProductName_NeedDataSource">         <MasterTableView DataKeyNames="ProductNameID" GridLines="None" CommandItemDisplay ="Top" Width="98%">          <PagerStyle Mode="NextPrevAndNumeric" />    

         <Columns>            <telerik:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Product Name">             <HeaderStyle Width="100px"></HeaderStyle>            </telerik:GridBoundColumn>
           <telerik:GridEditCommandColumn>       </telerik:GridEditCommandColumn>     </Columns>      <EditFormSettings ColumnNumber="2" CaptionFormatString="Edit details for ProductName with ID {0}"                     CaptionDataField="ProductNameID">                      <FormTableItemStyle Wrap="False"></FormTableItemStyle>                     <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>                     <FormMainTableStyle CellSpacing="0" CellPadding="3" Width="100%" />                     <FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" CssClass="module"                         Height="110px" Width="100%" />                     <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>                     <FormStyle Width="100%" BackColor="#EEF2EA"></FormStyle>                     <EditColumn UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit">                      </EditColumn>                     <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>                 </EditFormSettings>                 <ExpandCollapseColumn Visible="False">                      <HeaderStyle Width="19px"></HeaderStyle>                 </ExpandCollapseColumn>                 <RowIndicatorColumn Visible="False">                      <HeaderStyle Width="20px" />                 </RowIndicatorColumn>     </MasterTableView>    </telerik:RadGrid>

     

     

     

     

    protected void rgProductName_NeedDataSource(object source, GridNeedDataSourceEventArgs e)    {        SqlMaster sqlMaster = new SqlMaster();        string SelectQuery = " SELECT ProductNameID, Name FROM EOProductName";        DataTable dt = sqlMaster.ExecuteDataset(SelectQuery).Tables[0];        rgProductName.DataSource = dt;       }

        protected void rgProductName_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)    {                GridEditableItem eeditedItem = e.Item as GridEditableItem;        string ID = eeditedItem.OwnerTableView.DataKeyValues[eeditedItem.ItemIndex]["ProductNameID"].ToString();          string Name = (eeditedItem["Name"].Controls[0] as TextBox).Text;        
            try        {                           SqlMaster sqlMaster = new SqlMaster();            //Update Query to update the Datatable                 string updateQuery = "UPDATE EOProductName set Name='" + Name + "'where ProductNameID='" + ID + "'";            sqlMaster.ExecuteNonQuery(updateQuery);            

            }        catch (Exception ex)        {            rgProductName.Controls.Add(new LiteralControl("Unable to update Employee. Reason: " + ex.Message));            e.Canceled = true;        }
        }  

    Tuesday, April 12, 2011 3:01 AM
  • User-980271842 posted

    i will doit and now code is working absolutely fine----

    <telerik:RadGrid ID="rgMaterial" runat="server" AutoGenerateColumns="false" PageSize="5"        GridLines="None" AllowPaging="true" AllowSorting="true" AllowAutomaticInserts="true"        AllowAutomaticUpdates="false" OnUpdateCommand="rgMaterial_UpdateCommand" Skin="Hay"        OnNeedDataSource="rgMaterial_NeedDataSource">        <MasterTableView DataKeyNames="MaterialID" GridLines="None" Width="98%">            <PagerStyle Mode="NextPrevAndNumeric" />            <Columns>                <telerik:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Material Name">                    <HeaderStyle Width="100px"></HeaderStyle>                </telerik:GridBoundColumn>                <telerik:GridEditCommandColumn>                </telerik:GridEditCommandColumn>            </Columns>            <EditFormSettings ColumnNumber="2" CaptionFormatString="Edit details for MaterialName with ID {0}"                CaptionDataField="MaterialID">                <FormTableItemStyle Wrap="False"></FormTableItemStyle>                <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>                <FormMainTableStyle CellSpacing="0" CellPadding="3" Width="100%" />                <FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" CssClass="module"                    Height="110px" Width="100%" />                <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>                <FormStyle Width="100%" BackColor="#EEF2EA"></FormStyle>                <EditColumn UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit">                </EditColumn>                <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>            </EditFormSettings>            <ExpandCollapseColumn Visible="False">                <HeaderStyle Width="19px"></HeaderStyle>            </ExpandCollapseColumn>            <RowIndicatorColumn Visible="False">                <HeaderStyle Width="20px" />            </RowIndicatorColumn>        </MasterTableView>    </telerik:RadGrid>

     

     

     

     

     protected void rgMaterial_NeedDataSource(object source, GridNeedDataSourceEventArgs e)    {        SqlMaster sqlMaster = new SqlMaster();        string SelectQuery = " SELECT MaterialID, Name FROM EOMaterial";        DataTable dt = sqlMaster.ExecuteDataset(SelectQuery).Tables[0];        rgMaterial.DataSource = dt;
        }

        protected void rgMaterial_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)    {
            GridEditableItem eeditedItem = e.Item as GridEditableItem;        string ID = eeditedItem.OwnerTableView.DataKeyValues[eeditedItem.ItemIndex]["MaterialID"].ToString();        string Name = (eeditedItem["Name"].Controls[0] as TextBox).Text;

            try        {
                SqlMaster sqlMaster = new SqlMaster();            string updateQuery = "UPDATE EOMaterial set Name='" + Name + "'where MaterialID='" + ID + "'";            sqlMaster.ExecuteNonQuery(updateQuery);


            }        catch (Exception ex)        {            rgMaterial.Controls.Add(new LiteralControl("Unable to update Product Name. Reason: " + ex.Message));            e.Canceled = true;        }
        }  

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 12, 2011 6:18 AM
  • User-980271842 posted

     

    protected void rgMaterial_NeedDataSource(object source, GridNeedDataSourceEventArgs e)    {        SqlMaster sqlMaster = new SqlMaster();        string SelectQuery = " SELECT MaterialID, Name FROM EOMaterial";        DataTable dt = sqlMaster.ExecuteDataset(SelectQuery).Tables[0];        rgMaterial.DataSource = dt;
        }
    
        protected void rgMaterial_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)    {
            GridEditableItem eeditedItem = e.Item as GridEditableItem;        string ID = eeditedItem.OwnerTableView.DataKeyValues[eeditedItem.ItemIndex]["MaterialID"].ToString();        string Name = (eeditedItem["Name"].Controls[0] as TextBox).Text;
    
            try        {
                SqlMaster sqlMaster = new SqlMaster();            string updateQuery = "UPDATE EOMaterial set Name='" + Name + "'where MaterialID='" + ID + "'";            sqlMaster.ExecuteNonQuery(updateQuery);
    
    
            }        catch (Exception ex)        {            rgMaterial.Controls.Add(new LiteralControl("Unable to update Product Name. Reason: " + ex.Message));            e.Canceled = true;        }
        }  


    <telerik:RadGrid ID="rgMaterial" runat="server" AutoGenerateColumns="false" PageSize="5"        GridLines="None" AllowPaging="true" AllowSorting="true" AllowAutomaticInserts="true"        AllowAutomaticUpdates="false" OnUpdateCommand="rgMaterial_UpdateCommand" Skin="Hay"        OnNeedDataSource="rgMaterial_NeedDataSource">        <MasterTableView DataKeyNames="MaterialID" GridLines="None" Width="98%">            <PagerStyle Mode="NextPrevAndNumeric" />            <Columns>                <telerik:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Material Name">                    <HeaderStyle Width="100px"></HeaderStyle>                </telerik:GridBoundColumn>                <telerik:GridEditCommandColumn>                </telerik:GridEditCommandColumn>            </Columns>            <EditFormSettings ColumnNumber="2" CaptionFormatString="Edit details for MaterialName with ID {0}"                CaptionDataField="MaterialID">                <FormTableItemStyle Wrap="False"></FormTableItemStyle>                <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>                <FormMainTableStyle CellSpacing="0" CellPadding="3" Width="100%" />                <FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" CssClass="module"                    Height="110px" Width="100%" />                <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>                <FormStyle Width="100%" BackColor="#EEF2EA"></FormStyle>                <EditColumn UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit">                </EditColumn>                <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>            </EditFormSettings>            <ExpandCollapseColumn Visible="False">                <HeaderStyle Width="19px"></HeaderStyle>            </ExpandCollapseColumn>            <RowIndicatorColumn Visible="False">                <HeaderStyle Width="20px" />            </RowIndicatorColumn>        </MasterTableView>    </telerik:RadGrid>

    Monday, April 18, 2011 4:11 AM
  • User-980271842 posted

    <telerik:RadGrid ID="rgMaterial" runat="server" AutoGenerateColumns="false" PageSize="5"        GridLines="None" AllowPaging="true" AllowSorting="true" AllowAutomaticInserts="true"        AllowAutomaticUpdates="false" OnUpdateCommand="rgMaterial_UpdateCommand" Skin="Hay"        OnNeedDataSource="rgMaterial_NeedDataSource">        <MasterTableView DataKeyNames="MaterialID" GridLines="None" Width="98%">            <PagerStyle Mode="NextPrevAndNumeric" />            <Columns>                <telerik:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Material Name">                    <HeaderStyle Width="100px"></HeaderStyle>                </telerik:GridBoundColumn>                <telerik:GridEditCommandColumn>                </telerik:GridEditCommandColumn>            </Columns>            <EditFormSettings ColumnNumber="2" CaptionFormatString="Edit details for MaterialName with ID {0}"                CaptionDataField="MaterialID">                <FormTableItemStyle Wrap="False"></FormTableItemStyle>                <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>                <FormMainTableStyle CellSpacing="0" CellPadding="3" Width="100%" />                <FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" CssClass="module"                    Height="110px" Width="100%" />                <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>                <FormStyle Width="100%" BackColor="#EEF2EA"></FormStyle>                <EditColumn UpdateText="Update record" UniqueName="EditCommandColumn1" CancelText="Cancel edit">                </EditColumn>                <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>            </EditFormSettings>            <ExpandCollapseColumn Visible="False">                <HeaderStyle Width="19px"></HeaderStyle>            </ExpandCollapseColumn>            <RowIndicatorColumn Visible="False">                <HeaderStyle Width="20px" />            </RowIndicatorColumn>        </MasterTableView>    </telerik:RadGrid>
    

    Monday, April 18, 2011 4:12 AM