This is a migrated thread and some comments may be shown as answers.

Extracting Values serverside from In Place edit form

3 Answers 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andy Green
Top achievements
Rank 1
Andy Green asked on 31 Jul 2009, 10:27 AM
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

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 31 Jul 2009, 10:52 AM
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.
0
Andy Green
Top achievements
Rank 1
answered on 04 Aug 2009, 01:35 PM

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

 

0
Princy
Top achievements
Rank 2
answered on 05 Aug 2009, 06:08 AM
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.
Tags
Grid
Asked by
Andy Green
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Andy Green
Top achievements
Rank 1
Share this question
or