Extracting Values serverside from In Place edit form

4 posts, 1 answers
  1. Andy Green
    Andy Green avatar
    120 posts
    Member since:
    Jul 2009

    Posted 31 Jul 2009 Link to this post

    Hi

    New to these controls. I'm having trouble extracting the values from the text boxes that appear when using inplace editing.

    I've got to the rgArea_InsertCommand( ) sub but how do I get the values from the control?

    Andy G
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 31 Jul 2009 Link to this post

    Hello Andy,

    You can try out the following code to extract values from the Insert row in your grid:
    c#:
    protected void rgArea_InsertCommand(object source, GridCommandEventArgs e)  
        {  
            GridDataInsertItem item = (GridDataInsertItem)e.Item;  
            TextBox txtbx = (TextBox)item["ColumnUniqueName"].Controls[0];  
            string strtxt = txtbx.Text;  
        }  
     

    Thanks
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andy Green
    Andy Green avatar
    120 posts
    Member since:
    Jul 2009

    Posted 04 Aug 2009 Link to this post

    Worked great thank you.

    How can this be expanded to get the value of a GridDropDownColumn in a nested RadGrid using InPlace editing.
    I've tried various combinations but keep getting errors.

    Andy

     

  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 05 Aug 2009 Link to this post

    Hello Andy,

    You can try acessing the controls in the child table of your grid as shown below. Note that to distinguish between the MasterTableView and the DetailTable, I use the Name property of the GridTableView instance.
    aspx:
     <telerik:RadGrid ID="RadGrid1" DataSourceID="SqlDataSource1"  
    runat="server" OnInsertCommand="RadGrid1_InsertCommand"
        <MasterTableView Name="Master" EditMode="InPlace"
            <DetailTables> 
                <telerik:GridTableView Name="Detail" DataSourceID="SqlDataSource2"  EditMode="InPlace">      

    c#:
     protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e) 
        { 
            if (e.Item.OwnerTableView.Name == "Detail"
            { 
                GridDataInsertItem item = (GridDataInsertItem)e.Item; 
                RadComboBox combobx = (RadComboBox)item["DropDownColumnUniqueName"].Controls[0]; 
                  
            } 
        } 

    Thanks
    Princy.
Back to Top