or
| <telerik:GridTemplateColumn |
| HeaderText="Content" |
| UniqueName="ActivityContent" |
| Visible="false"> |
| <EditItemTemplate> |
| <telerik:RadEditor |
| ID="ContentEditor" |
| runat="server" |
| ContentAreaCssFile="~/Assets/Styles/GridHtmlEditor.css" Content='<%# Bind("Content") %>' /> |
| </EditItemTemplate> |
| <ItemTemplate> |
| <asp:Label ID="ContentLabel" runat="server" Text='<%# Eval("Content") %>' /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| body |
| { |
| background-color: white !important; |
| background-image: none !important; |
| color: black; |
| font: 12px Verdana,Arial,Helvetica,Sans-Serif !important; |
| text-align:left !important; |
| } |
| protected void RadFileExplorer2_ItemCommand(object sender, Telerik.Web.UI.RadFileExplorerEventArgs e) |
| { |
| if (e.Command == "UploadFile") |
| { |
| RadFileExplorer explorer = sender as RadFileExplorer; |
| RadUpload upload = explorer.Upload; |
| //e.Path holds the file path |
| string name = e.Path.Split(new char[] { '/' }).Last(); // get the filename including extension ; |
| foreach (UploadedFile uploadedFile in upload.UploadedFiles) |
| { |
| if (name.Equals(uploadedFile.GetName())) |
| { |
| string fileName = uploadedFile.GetName(); |
| string title = uploadedFile.GetFieldValue("Title"); |
| string description = uploadedFile.GetFieldValue("Desc"); |
| // ********** What do I do now? ***************// |
| break; |
| } |
| } |
| } |
| } |
| public override string StoreFile(Telerik.Web.UI.UploadedFile file, string path, string name, params string[] arguments) |
| { |
| int fileLength = Convert.ToInt32(file.InputStream.Length); |
| byte[] content = new byte[fileLength]; |
| file.InputStream.Read(content, 0, fileLength); |
| string fullPath = CombinePath(path, name); |
| if (!Object.Equals(DataServer.GetItemRow(fullPath), null)) |
| { |
| DataServer.ReplaceItemContent(fullPath, content); |
| } |
| else |
| { |
| string title; string description; |
| try |
| { |
| title = arguments[0]; |
| description = arguments[1]; |
| } |
| catch (IndexOutOfRangeException) |
| { |
| DataServer.CreateItem(name, path, file.ContentType, false, fileLength, content); |
| return string.Empty; |
| } |
| DataServer.CreateItem(name, path, file.ContentType, false, fileLength, content, title, description); |
| } |
| return string.Empty; |
| } |


1. I have a grid that is created dynamically where col 1 has a dropdown box. Based on what the user selects in col 1, I should show either a textbox or dropdownlist or datepicker in col 2. How can I accomplish this?
2. Also how do I handle events when the selecteditem in col 1 changes?
The data isn't coming from a datasource, I'll be creating each row programmatically.
Thanks

| <telerik:RadGrid runat="server" ID="rgContents" AutoGenerateColumns="false" |
| AllowPaging="true" AllowCustomPaging="true" PageSize="10" |
| OnPageIndexChanged="rgContents_PageIndexChanged" |
| OnItemDataBound="rgContents_ItemDataBound"> |
| <MasterTableView> |
| <Columns> |
| <telerik:GridTemplateColumn> |
| <ItemTemplate> |
| Times: <asp:Literal ID="ltlTimes" runat="server" /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| </MasterTableView> |
| <PagerStyle Mode="NextPrevNumericAndAdvanced" /> |
| </telerik:RadGrid> |
| private int Times |
| { |
| get |
| { |
| return ViewState["Times"] != null ? (int)ViewState["Times"] : 0; |
| } |
| set |
| { |
| ViewState["Times"] = value; |
| } |
| } |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| if (!IsPostBack) |
| { |
| Bind(); |
| } |
| } |
| protected void rgContents_PageIndexChanged(object source, GridPageChangedEventArgs e) |
| { |
| rgContents.CurrentPageIndex = e.NewPageIndex; |
| Bind(); |
| } |
| protected void rgContents_ItemDataBound(object sender, GridItemEventArgs e) |
| { |
| if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) |
| { |
| Times = Times + 1; |
| Literal ltlTimes = e.Item.FindControl("ltlTimes") as Literal; |
| ltlTimes.Text = Times.ToString(); |
| } |
| } |
| private void Bind() |
| { |
| var biz = new ContentBiz(); |
| var contents = biz.GetAll(); |
| int pageSize = rgContents.PageSize; |
| int start = rgContents.CurrentPageIndex * pageSize; |
| int count = contents.Count(); |
| var dataSource = contents.Skip(start).Take(pageSize); |
| rgContents.VirtualItemCount = count; |
| rgContents.DataSource = dataSource; |
| rgContents.DataBind(); |
| } |