Hi,
I have a button outside the grid that calls the MasterTableView.InsertItem, passing in a ListDictionary object containing values for the fields as follows:
In order to display the URL as a link, I'm using template columns as indicated below. When the button click event (above) fires, it inserts a record. The Descr field gets the value passed in newValues, but the URL field does not. I don;t see why one would work and the other not.
As a workaround, I have been trying to add code in the ItemCreated event to transfer the values to the edit controls. Are the values passed into the InsertItem method available in the ItemCreated event? So far, I have been unable to find anything in the GridDataInsertItem that contains the values passed.
I have a button outside the grid that calls the MasterTableView.InsertItem, passing in a ListDictionary object containing values for the fields as follows:
Protected Sub btnClick(sender As Object, e As EventArgs)
Dim newValues As System.Collections.Specialized.ListDictionary = New System.Collections.Specialized.ListDictionary()
newValues.Add("URL","www.123.com")
newValues.Add("Descr","test insert")
rgDocs.MasterTableView.InsertItem(newValues)
End Sub
In order to display the URL as a link, I'm using template columns as indicated below. When the button click event (above) fires, it inserts a record. The Descr field gets the value passed in newValues, but the URL field does not. I don;t see why one would work and the other not.
As a workaround, I have been trying to add code in the ItemCreated event to transfer the values to the edit controls. Are the values passed into the InsertItem method available in the ItemCreated event? So far, I have been unable to find anything in the GridDataInsertItem that contains the values passed.
<
telerik:GridTemplateColumn
UniqueName
=
"Descr"
DataField
=
"Descr"
HeaderText
=
"Description"
>
<
ItemTemplate
>
<%# Eval("Descr")%>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadTextBox
id
=
"txtDescr"
Runat
=
"server"
Text='<%# Eval("Descr")%> ' />
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"URL"
DataField
=
"URL"
HeaderText
=
"URL"
>
<
ItemTemplate
>
<
a
target
=
'_blank'
href='<%#Eval("URL")%>'><%#Eval("URL")%></
a
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadTextBox
id
=
"txtURL"
Runat
=
"server"
Text='<%# Eval("URL")%> ' />
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>