This solution should work, regardless of whether you define your columns in code or in markup. I also recommend you remove the code you added to handle the Key Press client event, because it is unnecessary here. Text new Values("First Name") = CType(user Control.
Insert Item() Dim inserted Item As Grid Editable Item = e. Edit Form User Control ID Dim My User Control As User Control = inserted Item.
Inserting values through Web User Control Edit Form and Form Template can be done in exactly the same way as updating values from these custom edit forms.
The only difference is that you need to create a new record in the grid data source instead of updating an already existing one. The forthcoming code snippets show how this can be done with user control custom edit form: Protected Sub Rad Grid1_Insert Command(By Val source As Object, By Val e As Grid Command Event Args) Handles Rad Grid1. Edit Form User Control ID), User Control) 'Prepare new row to add it in the Data Source Dim new Row As Data Row = Me. New Row 'Insert new values Dim new Values As Hashtable = New Hashtable new Values("Country") = CType(user Control.
I can't seem to find a reference explaining this behavior but, I can prove it works as intended.
I compiled this code on both Windows and Ubuntu (with Mono) then disassembled and these are the results: As you can see, in Windows newlines are interpreted as \r\n and on Ubuntu as \n One more way of convenient placement of Environment. The idea is to create string extension method that formats string as usual but also replaces in text with Environment.