The examples I have seen show modifying the ItemDataBound method and testing to see if the control is in Edit mode. When I add this logic and debug it, it seems like it never gets into edit mode. Therefore, I can't create an instance of the editor for the control and set the datasource and other properties. How do I force the control into Edit mode?
Here is the code ASP.net code to define the grid:
<asp:Panel ID="PnlPromoDetails" runat="server">
<telerik:RadGrid ID="radGridPromoDetails" runat="server" Skin="Vista"
AlternatingItemStyle-BackColor="#EDEDED" Width="1100px"
AutoGenerateColumns="False" GridLines="None" OnNeedDataSource="DetailsGrid_NeedDataSource"
OnItemDataBound="DetailsResultGrid_ItemDataBound" Height="16px" >
<ClientSettings>
<DataBinding EnableCaching="true" />
</ClientSettings>
<AlternatingItemStyle BackColor="#EDEDED" />
<MasterTableView>
<RowIndicatorColumn>
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<Columns>
<%--***********************************************--%>
<telerik:GridBoundColumn DataField="CampaignType"
HeaderText="Campaign</br>Type" UniqueName="CampaignType">
<HeaderStyle Font-Bold="True" HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</telerik:GridBoundColumn>
<%--***********************************************--%>
<telerik:GridDropDownColumn
DataSourceID=""
DataField=""
HeaderText="Account</br>Types"
UniqueName="chkAccountTypes" EmptyListItemText="(none)" ColumnEditorID="chkAccountTypes" Display="False">
<HeaderStyle Font-Bold="True" HorizontalAlign="Center"/>
<ItemStyle HorizontalAlign="Center" />
</telerik:GridDropDownColumn>
</Columns>
<GroupHeaderItemStyle Font-Bold="true" />
<NoRecordsTemplate>
<asp:Label ID="lblNoPromoDetails" runat="server" Font-Bold="true"
ForeColor="Red" Text=""
</NoRecordsTemplate>
</MasterTableView>
</telerik:RadGrid>
</asp:Panel>
You will notice that I have not defined a data source from the drop down column. I was hoping to do that programmatically. The data table I have has one column in it called "LegalName" and the name of the table is "LegalInfo". That table exists in the code behind.
I have worked on this all day and can't figure it out. I hope someone can help.
I also thought of calling a method from the ASPX file to return the data table but that doesn't seem to work either.
I have looked at many examples of how to do this and none of them seem to work for me.