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

Finding Control in server side using vb.net from MasterTableViewEditForm

1 Answer 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dibyendu
Top achievements
Rank 1
Dibyendu asked on 04 Dec 2008, 12:44 PM

Hello Sir,
I am facing one problem regarding finding control value from MasteTtableVieweditForm. We follow your c# code sample from -'ManualInsertUpdateUsingFormTemplate ' project. There we find the following code which is perfectly running. 

 

-------------------------------- c# code
//Get the GridEditableItem of the RadGrid

GridEditableItem editedItem = e.Item as GridEditableItem;
 
//Get the primary key value using the DataKeyValue.

string CustomerID = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["CustomerID"].ToString();

//Access the textbox from the edit form template and store the values in string variables.
string CompanyName= (editedItem.FindControl("txtCompanyName") as TextBox).Text;

 

 

--------------------------------
But in our project we are useing the following code -
---------------------------- vb.net code

        'Get the GridEditFormInsertItem of the RadGrid
        Dim insertedItem As GridEditFormInsertItem = DirectCast(e.Item, GridEditFormInsertItem)

        'Access the textbox from the insert form template and store the values in string variables.
        Dim CustomerID As String = TryCast(insertedItem.FindControl("txtCustomerID"), TextBox).Text
        Dim CompanyName As String = TryCast(insertedItem.FindControl("txtCompanyName"), TextBox).Text

---------------------
But in this case the code is not working. It actually did not find the control by --- insertedItem.FindControl("txtCustomerID"), TextBox
method. What ever we observed that the - in c#  --  GridCommandEventArgs e is different from e of GridCommandEventArgs  in vb.net.
Please reply.

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 05 Dec 2008, 01:19 PM
Hello,

Can you please give us little more details about your scenario and implementation as some more code snippets?

Greetings,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Dibyendu
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or