or
if (item.ItemType == Telerik.Web.UI.GridItemType.AlternatingItem) { if (item.BackColor == Color.FromArgb(Int32.Parse("C7EAC7", System.Globalization.NumberStyles.HexNumber)))//GREEN { item.ChildItem.NestedTableViews[0].CssClass = "altDrawInfo build"; item.ChildItem.NestedTableViews[0].Style["background-color"] = "C7EAC7"; } else if (item.BackColor == Color.FromArgb(Int32.Parse("FCB9B8", System.Globalization.NumberStyles.HexNumber)))//RED { item.ChildItem.NestedTableViews[0].CssClass = "altDrawInfo asBuilt"; item.ChildItem.NestedTableViews[0].Style["background-color"] = "FCB9B8"; } else if (item.BackColor == Color.FromArgb(Int32.Parse("FFFFCC", System.Globalization.NumberStyles.HexNumber)))//ORANGE { item.ChildItem.NestedTableViews[0].CssClass = "altDrawInfo approval"; item.ChildItem.NestedTableViews[0].Style["background-color"] = "FFFFCC"; } else//DEFAULT { item.ChildItem.NestedTableViews[0].CssClass = "altDrawInfo"; item.ChildItem.NestedTableViews[0].Style["background-color"] = "EEEEEE"; }}else{ if (item.BackColor == Color.FromArgb(Int32.Parse("C7EAC7", System.Globalization.NumberStyles.HexNumber)))//GREEN { item.ChildItem.NestedTableViews[0].CssClass = "DrawInfo build"; item.ChildItem.NestedTableViews[0].Style["background-color"] = "C7EAC7"; } else if (item.BackColor == Color.FromArgb(Int32.Parse("FCB9B8", System.Globalization.NumberStyles.HexNumber)))//RED { item.ChildItem.NestedTableViews[0].CssClass = "DrawInfo asBuilt"; item.ChildItem.NestedTableViews[0].Style["background-color"] = "FCB9B8"; } else if (item.BackColor == Color.FromArgb(Int32.Parse("FFFFCC", System.Globalization.NumberStyles.HexNumber)))//ORANGE { item.ChildItem.NestedTableViews[0].CssClass = "DrawInfo approval"; item.ChildItem.NestedTableViews[0].Style["background-color"] = "FFFFCC"; } else//DEFAULT { item.ChildItem.NestedTableViews[0].CssClass = "DrawInfo"; item.ChildItem.NestedTableViews[0].Style["background-color"] = "D8D8D8"; }}/* NON-ALTERNATING ROW */.drawInfo /* */{ background-color:#D8D8D8 !important; border-style:solid !important; border-color:#000000 !important; border-width:0 2px 0 0 !important; /*top right bottom left*/}.drawInfo td /* */{ background-color:#D8D8D8; border-style:solid !important; border-color:#EDDA74 !important; border-width:0 0 0 0 !important; /*top right bottom left*/}.drawInfo.build /* GREEN */{ background-color:#C7EAC7 !important; border-style:solid !important; border-color:#000000 !important; border-width:0 2px 0 0 !important; /*top right bottom left*/}.drawInfo.build td /* GREEN */{ background-color:#C7EAC7 !important; border-style:solid !important; border-color:#EDDA74 !important; border-width:0 0 0 0 !important; /*top right bottom left*/}.drawInfo.asBuilt /* RED */{ background-color:#FCB9B8 !important; border-style:solid !important; border-color:#000000 !important; border-width:0 2px 0 0 !important; /*top right bottom left*/}.drawInfo.asBuilt td /* RED */{ background-color:#FCB9B8 !important; border-style:solid !important; border-color:#EDDA74 !important; border-width:0 0 0 0 !important; /*top right bottom left*/}.drawInfo.approval /* ORANGE */{ background-color:#FFFFCC !important; border-style:solid !important; border-color:#000000 !important; border-width:0 2px 0 0 !important; /*top right bottom left*/}.drawInfo.approval td /* ORANGE */{ background-color:#FFFFCC !important; border-style:solid !important; border-color:#EDDA74 !important; border-width:0 0 0 0 !important; /*top right bottom left*/}/* ALTERNATING ROW */.altDrawInfo /* */{ background-color:#EEEEEE !important; border-style:solid !important; border-color:#F7F7F7 !important; border-width:0 2px 0 0 !important; /*top right bottom left*/}.altDrawInfo td /* */{ background-color:#EEEEEE !important; border-style:solid !important; border-color:#EDDA74 !important; border-width:0 0 0 0 !important; /*top right bottom left*/}.altDrawInfo.build /* GREEN */{ background-color:#C7EAC7 !important; border-style:solid !important; border-color:#F7F7F7 !important; border-width:0 2px 0 0 !important; /*top right bottom left*/}.altDrawInfo.build td /* GREEN */{ background-color:#C7EAC7 !important; border-style:solid !important; border-color:#EDDA74 !important; border-width:0 0 0 0 !important; /*top right bottom left*/}.altDrawInfo.asBuilt /* RED */{ background-color:#FCB9B8 !important; border-style:solid !important; border-color:#F7F7F7 !important; border-width:0 2px 0 0 !important; /*top right bottom left*/}.altDrawInfo.asBuilt td /* RED */{ background-color:#FCB9B8 !important; border-style:solid !important; border-color:#EDDA74 !important; border-width:0 0 0 0 !important; /*top right bottom left*/}.altDrawInfo.approval /* ORANGE */{ background-color:#FFFFCC !important; border-style:solid !important; border-color:#F7F7F7 !important; border-width:0 2px 0 0 !important; /*top right bottom left*/}.altDrawInfo.approval td /* ORANGE */{ background-color:#FFFFCC !important; border-style:solid !important; border-color:#EDDA74 !important; border-width:0 0 0 0 !important; /*top right bottom left*/}| <telerik:RadComboBox ID="RadComboBox" DataSourceID="odsPopularProducts" Filter="Contains" |
| DataTextField="ProductName" DataValueField="ProductID" AllowCustomText="true" MaxHeight="300" |
| Width="205" OnSelectedIndexChanged="RadComboBoxProducts_SelectedIndexChanged" |
| AutoPostBack="true" DropDownWidth="300" OffsetX="-95" EmptyMessage="Select a Popular Product..." |
| runat="server"> |
| </telerik:RadComboBox> |
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadDatePickerTest.aspx.cs" Inherits="NCCCN.CMIS.AdHOC.RadDatePickerTest" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <div> <telerik:RadScriptManager ID="RadScriptManager1" runat="server" /> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" /> <asp:PlaceHolder runat="server" ID="TemplatePH" /> <asp:PlaceHolder runat="server" ID="PlaceHolder1" /> <br /><br /> <telerik:RadDatePicker runat="server" ID="ACal" /> <telerik:RadDatePicker runat="server" ID="BCal" /> </div> </form></body></html>
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { RadCalendar cal = new RadCalendar(); cal.ClientIDMode = System.Web.UI.ClientIDMode.Static; cal.EnableMultiSelect = false; cal.ID = this.ClientID + "SharedCalID"; TemplatePH.Controls.Add(cal); RadDatePicker StartDatePicker = new RadDatePicker(); StartDatePicker.ClientIDMode = System.Web.UI.ClientIDMode.Static; StartDatePicker.AutoPostBack = true; //StartDatePicker.SelectedDateChanged += new SelectedDateChangedEventHandler(StartDatePicker_SelectedDateChanged); StartDatePicker.SharedCalendar = cal; StartDatePicker.SelectedDate = new DateTime(2005, 1, 1); StartDatePicker.ID = this.ClientID + "SentFromFilterTemplate_StartDatePicker"; TemplatePH.Controls.Add(StartDatePicker);   RadDatePicker EndDatePicker = new RadDatePicker(); EndDatePicker.ClientIDMode = System.Web.UI.ClientIDMode.Static; EndDatePicker.AutoPostBack = true; // EndDatePicker.SelectedDateChanged += new SelectedDateChangedEventHandler(EndDatePicker_SelectedDateChanged); EndDatePicker.SharedCalendar = cal; EndDatePicker.SelectedDate = new DateTime(2006, 1, 1); EndDatePicker.ID = this.ClientID + "SentFromFilterTemplate_EndDatePicker"; TemplatePH.Controls.Add(EndDatePicker); ACal.SharedCalendar = cal; BCal.SharedCalendar = cal; } }
I'm not sure where this is going wrong, but any help would be appreciated.
I'm trying to add a column to an edit column to a grid (I also want to add a delete column, but I haven't gotten that far yet). I can make the column display without a problem, but the moment I click the button I get very odd results - the button disappears, my column headers move across and one of the bits of content from another of my columns vanishes entirely. I found it rather funny at first, but then I couldn't find out why it was doing it.
My code is below.
Private Sub rgdTable_DetailTableDataBind(ByVal source As Object, ByVal e As GridDetailTableDataBindEventArgs) Handles rgdTable.DetailTableDataBind Dim dataItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem) Select Case e.DetailTableView.Name Case "TUGDetailTable" Dim myTrackingGUID As Guid = New Guid(dataItem.Item("MerchantTrackingGUID").Text) Dim myDataSet As New DataSet '===Get the DetailTable data=== myDataSet = *get data from database* myDataSet.Tables(0).Columns.Remove("Source") myDataSet.Tables(0).Columns.Remove("@Action") e.DetailTableView.DataSource = myDataSet e.DetailTableView.CommandItemDisplay = GridCommandItemDisplay.Top e.DetailTableView.CommandItemSettings.AddNewRecordImageUrl = "../Img/AddRecord.gif" e.DetailTableView.CommandItemSettings.AddNewRecordText = "Add New TUG Details" e.DetailTableView.CommandItemSettings.ShowRefreshButton = False e.DetailTableView.EditFormSettings.EditColumn.UniqueName = "EditCommandColumn1" e.DetailTableView.EditFormSettings.UserControlName = "../UserControls/Templates/TUGAdd.ascx" e.DetailTableView.EditFormSettings.EditFormType = GridEditFormType.WebUserControl Dim editCol As GridEditCommandColumn editCol = New GridEditCommandColumn editCol.UniqueName = "EditColumn" editCol.HeaderText = "" editCol.HeaderStyle.Width = 20 editCol.EditImageUrl = "~\img\edit.gif" editCol.ButtonType = GridButtonColumnType.ImageButton editCol.EditFormColumnIndex = 0 e.DetailTableView.Columns.Add(editCol) End SelectEnd Sub