or
So I’m using the directoryinfo class to obtain the filenames from a network share, and then display them into my radcombobox. Everything works fine, but what I’d like to do is create a checkbox next to all of the values in the combobox so the user can select multiple files.
When I do it without the itemtemplate, all the filenames display fine, but when I try to use them to add the checkbox, the checkboxes show up but the filenames don’t. Here’s what I have:
<telerik:RadComboBox ID="cboFiles" runat="server" AutoPostBack="true" Width="350px" OnItemDataBound="cboFilesDBound"> <ItemTemplate> <asp:CheckBox ID="chkFile" runat="server" /> </ItemTemplate> </telerik:RadComboBox>protected void setDirectory(String path){ RadComboBox cb = (RadComboBox)FindControl("cboFiles"); DirectoryInfo di = new DirectoryInfo(path); FileInfo[] files = di.GetFiles(); foreach (FileInfo f in files) { RadComboBoxItem item = new RadComboBoxItem(f.Name, f.Name); item.Attributes["displayName"] = f.Name; cboFiles.Items.Add(item); }}
RadGrid1.AllowFilteringByColumn = isVisible RadGrid1.ShowHeader = isVisible MemoryStream stream = TheWay.GetDocument("*", Number, "*", "*") as MemoryStream;<br> Response.ContentType = contentType ?? "text/plain";<br> Response.AddHeader("Content-Disposition", "attachment;filename=" + attachment.FileName);<br> byte[] buffer = stream.ToArray();<br> stream.Read(buffer, 0, Convert.ToInt32(stream.Length));<br> Response.ClearContent();<br> Response.BinaryWrite(buffer); <br> Response.End(); Protected
Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim item As GridDataItem = DirectCast(TryCast(sender, CheckBox).NamingContainer, GridDataItem)
item(
"ProductID").Text
End Sub