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

item.OwnerTableView name is not getting why?

1 Answer 291 Views
Grid
This is a migrated thread and some comments may be shown as answers.
koteswararao
Top achievements
Rank 1
koteswararao asked on 24 Jan 2012, 11:25 AM
hi ,

i write the following code  <MasterTableView EditMode="InPlace" Name="product" DataKeyNames="PKProductID" CommandItemDisplay="Top">  in aspx page
when i go into updatecommand or insert command i want to find out the table name (means product) for that i am using the following code
DirectCast(item.OwnerTableView,Telerik.Web.UI.GridTableView).Name BUT IT GIVE ALWAYS RESULT AS TABLE

what is the way to get that table name ?

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 24 Jan 2012, 12:12 PM
Hello koteswararao,

Please check the below code snippet.it working perfectly from my hand.

<MasterTableView Name="Parent">
                <Columns>
                    <telerik:GridBoundColumn DataField="ID" UniqueName="ID">
                    </telerik:GridBoundColumn>
                    <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
                </Columns>
                <DetailTables>
                    <telerik:GridTableView Name="Child">
                        <Columns>
                            <telerik:GridBoundColumn DataField="ID" UniqueName="ID">
                            </telerik:GridBoundColumn>
                            <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
                        </Columns>
                    </telerik:GridTableView>
                </DetailTables>
            </MasterTableView>
protected void RadGrid1_UpdateCommand(object sender, GridCommandEventArgs e)
    {
        GridEditableItem item = e.Item as GridEditableItem;
        string str = item.OwnerTableView.Name;
    }


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
koteswararao
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or