
<telerik:GridTemplateColumn DataField="FileID" HeaderText="File / Link" HeaderStyle-Width="55px" SortExpression="FileID" HeaderStyle-ForeColor="White" AllowFiltering="false" ItemStyle-Width="20%" ItemStyle-Wrap="true" ShowSortIcon="false"> <ItemTemplate> <asp:HyperLink ID="hlLink" runat="server" Target="_blank" Visible="false"></asp:HyperLink> </ItemTemplate></telerik:GridTemplateColumn>For Each col In dg.Columns If (col.GetType() Is GetType(Telerik.Web.UI.GridBoundColumn)) Then If col.HeaderText = ColumnName Then If HideOrShow Then dg.MasterTableView.GetColumn(col.DataField).Display = True Else dg.MasterTableView.GetColumn(col.DataField).Display = False End If End If Else If (col.GetType() Is GetType(Telerik.Web.UI.GridTemplateColumn)) Then If HideOrShow Then dg.MasterTableView.GetColumn(col.DataField).Display = True Else dg.MasterTableView.GetColumn(col.DataField).Display = False End If End If End If Next<telerik:RadGrid ID="RadGridDocuments" runat="server" CellSpacing="-1" GridLines="Both" AutoGenerateColumns="false" OnItemDataBound="RadGridDocuments_ItemDataBound" OnPreRender="RadGridDocuments_PreRender"> <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True"> <Selecting AllowRowSelect="True" /> </ClientSettings> <MasterTableView EditMode="InPlace"> <Columns> <telerik:GridBoundColumn DataField="FileName" HeaderText="File Name" UniqueName="FileName" ReadOnly="true"> </telerik:GridBoundColumn> <telerik:GridDropDownColumn UniqueName="Type" HeaderText="Type" DataField="Type" EmptyListItemText="--Choose an option--" EmptyListItemValue=""> </telerik:GridDropDownColumn> </Columns> </MasterTableView> </telerik:RadGrid>protected void ButtonAddDetails_Click(object sender, EventArgs e) { List<Document> docs = new List<Document>(); foreach (UploadedFile f in RadAsyncUploadDocuments.UploadedFiles) { docs.Add(new Document(f)); } RadGridDocuments.DataSource = docs; RadGridDocuments.DataBind(); } protected void RadGridDocuments_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) { if (e.Item is GridEditableItem && e.Item.IsInEditMode) { GridEditableItem editedItem = e.Item as GridEditableItem; GridEditManager editMan = editedItem.EditManager; GridDropDownListColumnEditor editor = (GridDropDownListColumnEditor)(editMan.GetColumnEditor("Type")); //in case you have RadComboBox editor for the GridDropDownColumn (this is the default editor), //you will need to use ComboBoxControl below instead of DropDownListControl //and add RadComboBoxItems instead of ListItems to the Items collection of the editor editor.ComboBoxControl.Items.Add(new RadComboBoxItem("FAA Administrator's Order", "FAA Administrator's Order")); editor.ComboBoxControl.Items.Add(new RadComboBoxItem("Notice of Appeal", "Notice of Appeal")); } } protected void RadGridDocuments_PreRender(object sender, System.EventArgs e) { foreach (GridItem item in RadGridDocuments.MasterTableView.Items) { if (item is GridEditableItem) { GridEditableItem editableItem = item as GridDataItem; editableItem.Edit = true; } } RadGridDocuments.Rebind(); }public class Document { private UploadedFile file; private string type; public Document(UploadedFile file) { this.file = file; this.type = string.Empty; } public UploadedFile File { get { return this.file; } } public string FileName { get { return this.file.FileName; } } public string Type { get { return this.type; } set { this.type = value; } } }
<tr style="vertical-align:middle; width:100%">
<td style="vertical-align:middle; width:100%">
<telerik:RadSplitter ID="trsCWCMPrimary" runat="server" BorderWidth="0" BorderSize="0" BorderStyle="None" Height="520px" LiveResize="true" Orientation="Vertical" ResizeMode="Proportional" Width="100%">
<telerik:RadPane ID="trpCWCMPrimaryTree" runat="server" Collapsed="false" Width="20%">
<telerik:RadTreeView ID="trtvCWCMPrimary" runat="server" CssClass="sfecua_chkrdo_dataLeftSmall" Height="99%" Width="100%" OnNodeClick="trtvCWCMPrimary_NodeClick" OnNodeCollapse="trtvCWCMPrimary_NodeCollapse" OnNodeExpand="trtvCWCMPrimary_NodeExpand" onclientnodeclicking="OnClientNodeClicking">
</telerik:RadTreeView>
</telerik:RadPane>
<telerik:RadSplitBar ID="trsbPrimarySecondary" runat="server" CollapseMode="Forward"></telerik:RadSplitBar>
<telerik:RadPane ID="trpCWCMSecondaryTableDetails" runat="server">
<div id="divCustomerMgmt" style="display:block; border:none;">
<iframe runat="server" src="./../CustWaitLoading.aspx" id="ifrmCWCMCustCustomerMgmt" name="ifrmCWCMCustCustomerMgmt" width="100%" height="100%" marginwidth="0" frameborder="0" scrolling="no">Customer Mgmt IFRAME</iframe>
</div>
<div id="divAccountMgmt" style="display:none; border:none;">
<iframe runat="server" src="./../CustWaitLoading.aspx" id="ifrmCWCMCustAccountMgmt" name="ifrmCWCMCustAccountMgmt" width="100%" height="100%" marginwidth="0" frameborder="0" scrolling="no">Account Mgmt IFRAME</iframe>
</div>
<div id="divBillingMgmt" style="display:none; border:none;">
<iframe runat="server" src="./../CustWaitLoading.aspx" id="ifrmCWCMCustBillingMgmt" name="ifrmCWCMCustBillingMgmt" width="100%" height="100%" marginwidth="0" frameborder="0" scrolling="no">Billing Mgmt IFRAME</iframe>
</div>
</telerik:RadPane>
</telerik:RadSplitter>
</td>
</tr>