or
Protected Sub onClick(ByVal sender As Object, ByVal e As EventArgs)
Try
Dim NewButton As LinkButton = CType(sender, LinkButton)
Dim con As New SqlClient.SqlConnection(ConfigurationManager.ConnectionStrings("NBOConnectionString").ConnectionString)
Dim cmd As New SqlClient.SqlCommand("Select Id, NDAId, FileName, [File], FileType FROM NDA_Files Where Id = " & Convert.ToInt32(NewButton.ToolTip), con)
Dim da As New SqlClient.SqlDataAdapter(cmd)
con.Open()
Dim dt As New Data.DataTable
da.Fill(dt)
For Each row As Data.DataRow In dt.Rows
With row
Dim DataFile() As Byte
DataFile = .Item("File")
HttpContext.Current.Response.Buffer = True
HttpContext.Current.Response.ContentType = .Item("FileType")
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" & .Item("FileName"))
HttpContext.Current.Response.AppendHeader("Content-Length", DataFile.Length.ToString())
HttpContext.Current.Response.BinaryWrite(DataFile)
End With
Next
Catc
For
Each
Control
In
e.Item.Controls
If
CType
(Control, Telerik.Web.UI.GridTableCell).Controls.Count > 2
Then
If
CType
(Control, Telerik.Web.UI.GridTableCell).Controls(1).
GetType
.Name =
"LinkButton"
Then
Dim
lnkButton
As
LinkButton =
CType
(
CType
(Control, Telerik.Web.UI.GridTableCell).Controls(1), LinkButton)
ScriptManager1.RegisterPostBackControl(lnkButton)
End
If
End
If
Next
<
li
>
test : <
input
type
=
"text"
value
=
"message"
style
=
"overflow:visible;width:20px"
/>
</
li
>
protected
void
Page_Load(
object
sender, EventArgs e)
{
lstItemCollection.DataSource = GetCityCollection();
lstItemCollection.DataBind();
}
public
IEnumerable<Customer> GetCityCollection()
{
using
(UowEntities uow =
new
UowEntities())
{
CustomerRepository cr =
new
CustomerRepository(uow);
return
cr.SelectAll().ToArray();
}
}
<
asp:ListBox
ID
=
"lstItemCollection"
runat
=
"server"
SelectionMode
=
"Multiple"
DataValueField
=
"CustomerId"
DataTextField
=
"City"
/>
<
asp:ListBox
ID
=
"lstItemCollection"
runat
=
"server"
SelectionMode
=
"Multiple"
DataValueField
=
"CustomerId"
DataTextField
=
"City"
DataSourceID
=
"odsCityCollection"
/>
<
asp:ObjectDataSource
ID
=
"odsCityCollection"
runat
=
"server"
SelectMethod
=
"GetCityCollection"
TypeName
=
"LINQScratchPad.Web.CommonUserControls.CustomerControl"
></
asp:ObjectDataSource
>
public
partial
class
CustomerControl : System.Web.UI.UserControl
{
private
object
_dataItem;
public
object
DataItem
{
get
{
return
this
._dataItem; }
set
{
this
._dataItem = value; }
}
protected
void
Page_Load(
object
sender, EventArgs e) { }
public
IEnumerable<Customer> GetCityCollection()
{
using
(UowEntities uow =
new
UowEntities())
{
Customer foo = (Customer)DataItem;
// Always null!
// Will throw null reference exception here if uncommented
//var bar = HiddenField1.Value;
CustomerRepository cr =
new
CustomerRepository(uow);
return
cr.SelectAll().ToArray();
}
}
protected
void
Page_PreRender(
object
sender, EventArgs e)
{
Customer foo = (Customer)DataItem;
// Has value here
var bar =
this
.HiddenField1.Value;
// Has value here
lstItemCollection.DataBind();
// DataItem is now null again :(
}
protected
override
void
OnPreRender(EventArgs e)
{
Customer foo = (Customer)DataItem;
// Has value here
var bar =
this
.HiddenField1.Value;
// Has value here
lstItemCollection.DataBind();
// DataItem is now null again :(
base
.OnPreRender(e);
}
}
<
asp:HiddenField
Value='<%# Eval("CustomerId") %>' ID="HiddenField1" runat="server" />
<
ol
class
=
"column1"
>
<
li
>
<
asp:Label
ID
=
"lblFirstName"
runat
=
"server"
>First Name:</
asp:Label
>
<
asp:TextBox
ID
=
"txtFirstName"
runat
=
"server"
Text='<%# Bind("FirstName") %>' />
</
li
>
<
li
>
<
asp:Label
ID
=
"lblLastName"
runat
=
"server"
>Last Name: </
asp:Label
>
<
asp:TextBox
ID
=
"txtLastName"
runat
=
"server"
Text='<%# Bind("LastName") %>' />
</
li
>
</
ol
>
I just wondered if there was a skin/CSS available to re-create something similar to the RadToolBar used on the Telerik demos site. It looks like it is a RadTabStrip but in fact is a RadToolBar; any help with re-creating something similar to this would be greatly appreciated! I have attached a screen shot of what I am referring to if I haven’t been that clear.
<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Sunset" AllowSorting="true" ShowFooter="false"> |
<ItemStyle Font-Size="11px" /> |
<MasterTableView> |
<RowIndicatorColumn> |
<HeaderStyle Width="20px"></HeaderStyle> |
</RowIndicatorColumn> |
<ExpandCollapseColumn> |
<HeaderStyle Width="20px"></HeaderStyle> |
</ExpandCollapseColumn> |
</MasterTableView> |
<ClientSettings AllowColumnHide="false"> |
<Scrolling AllowScroll="true" UseStaticHeaders="True" ScrollHeight="450px" /> |
<Resizing AllowColumnResize="true" ClipCellContentOnResize="true" |
/> |
</ClientSettings> |
</telerik:RadGrid> |
Protected Sub RadGrid1_ColumnCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles RadGrid1.ColumnCreated |
Dim name As String = e.Column.UniqueName |
'resize columns |
If name = "Name" Or name = "Address1" Or name = "RFI Email" Or name = "Personal Email" Or name = "Practice" Then |
Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn) |
boundColumn.ItemStyle.Width = 150 |
boundColumn.HeaderStyle.Width = 150 |
End If |
If name = "Initials" Or name = "State" Then |
Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn) |
boundColumn.ItemStyle.Width = 45 |
boundColumn.HeaderStyle.Width = 45 |
End If |
If name = "Office" Then |
Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn) |
boundColumn.ItemStyle.Width = 80 |
boundColumn.HeaderStyle.Width = 80 |
End If |
If name = "Ext" Or name = "Zip" Then |
Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn) |
boundColumn.ItemStyle.Width = 50 |
boundColumn.HeaderStyle.Width = 50 |
End If |
If name = "Cell" Or name = "Home" Or name = "Fax" Or name = "Business" Or name = "City" Then |
Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn) |
boundColumn.ItemStyle.Width = 89 |
boundColumn.HeaderStyle.Width = 89 |
End If |
If name = "Address2" Then |
Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn) |
boundColumn.ItemStyle.Width = 70 |
boundColumn.HeaderStyle.Width = 70 |
End If |
If name = "Preferred" Then |
Dim boundColumn As GridBoundColumn = CType(e.Column, GridBoundColumn) |
boundColumn.ItemStyle.Width = 95 |
boundColumn.HeaderStyle.Width = 95 |
End If |
End Sub |
protected
void
Page_Load(
object
sender, EventArgs e)
{
for
(
int
i = 0; i < radGrid.PageSize; i++)
{
for
(
int
j = 0; j < radGrid.PageSize; j++)
{
radGrid.EditIndexes.Add(i, 0, j);
}
}
}
function
CollapseAll() {
var
grid = $find(
"<%= radGrid.ClientID %>"
);
master = grid.get_masterTableView();
for
(masterIndex = 0; masterIndex < master.get_dataItems().length; masterIndex++) {
master.collapseItem(masterIndex);
}