I'm not a DetailsView
expert, but I think the following general summary covers what you will need to do.
Use a TemplateField
rather than a BoundField
for Station_Name. That would look like this:
<asp:TemplateField HeaderText="Station Name">
<ItemTemplate>
<asp:Label ID="lblStationName" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Station_Name") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<CKEditor:CKEditorControl ID="CKEditor1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Station_Name") %>' />
</EditItemTemplate>
</asp:TemplateField>
This is what looks like a good link on updating the database from a DetailsView
. Where your situation differs from his is that you are using CKEditor
. But you can retrieve the information from the CKEditor
control the same way he does, when he's ready to update:
Dim htmlText as String = Nothing
Dim ctl as CKEditor = CType(DetailsViewStation.FindControl("CKEditor1"), CKEditor)
If ctl Is Nothing Then
htmlText = ctl.Text
End If
If it turns out that you can't bind to the Text property of the CKEditor
control, you would assign the value to the CKEditor
.Text
control the same way you retrieve it: by doing a DetailsViewStation.FindControl("CKEditor1")
to retrieve the control, and assigning the HTML you have retrieved from the database to the control's Text
property.
I hope this helps.