I have a Telerik's RadGrid which has 2 columns like this:
<Columns>
<telerik:GridBoundColumn HeaderText="AirlineCode" UniqueName="AirlineCode" DataField="airlineCode" />
<telerik:GridBoundColumn HeaderText="FlightNumber " EditFormColumnIndex="1" DataField="flightNumber" />
...
...
... more code, but unrelevant to the question here.
</Columns>
I am supplying the data for both columns in the relevant NeedDataSource() function.
So it renders correctly like this:
| AirlineCode | FlightNumber |
------------------------------------------
| Delta | 2393 |
| Southwest | 345 |
But now my requirement has changed a little bit.
For viewing, I want to merge them together and show it like this:
| Flight |
--------------------------
| Delta-2393 |
| Southwest-345 |
However, while editing the rows the user should be able to edit "AirlineCode" and "Flight Number" separately. And the values should still be correctly maintained in the datasource.
I know that if we want the user to "View" and "Edit" differently, we would have to use .
So I am trying something like this:
<Columns>
<telerik:GridTemplateColumn EditFormColumnIndex="0" HeaderText="Flight">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "airlineCode")%>
<asp:Literal runat="server" Text="-"></asp:Literal>
<%#DataBinder.Eval(Container.DataItem, "flightNumber")%>
</ItemTemplate>
<EditItemTemplate>
<telerik:GridBoundColumn HeaderText="AirlineCode" UniqueName="AirlineCode" DataField="airlineCode" />
<telerik:GridBoundColumn HeaderText="FlightNumber " EditFormColumnIndex="1" DataField="flightNumber" />
</EditItemTemplate>
</telerik:GridTemplateColumn> ...
...
... more code, but unrelevant to the question here.
</Columns>
But its not working.
Those 2 lines inside are giving warnings:
Element 'GridBoundColumn' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing.
Probably I am doing it wrong. Need help.
Any help is appreciated.