| string target = Server.MapPath("~/Images/Logos/"); |
| Image.GetThumbnailImageAbort thumbnailImageAbortDelegate = |
| new Image.GetThumbnailImageAbort(ThumbnailCallback); |
| foreach (UploadedFile file in RadUpload1.UploadedFiles) |
| { |
| file.SaveAs(Path.Combine(target, file.GetName())); |
| using (Bitmap originalImage = new Bitmap(file.InputStream)) |
| { |
| //You can implement additional logic to compute |
| // the width / height according your requirements |
| int width = originalImage.Width / 2; |
| int height = originalImage.Height / 2; |
| using (Image thumbnail = |
| originalImage.GetThumbnailImage(width, height, thumbnailImageAbortDelegate, IntPtr.Zero)) |
| { |
| string thumbnailFileName = Path.Combine(target, |
| string.Format("{0}_thumb{1}", file.GetNameWithoutExtension(), file.GetExtension())); |
| thumbnail.Save(thumbnailFileName); |
| } |
Protected Sub RadToolTipManager1_AjaxUpdate(ByVal sender As Object, ByVal e As Telerik.Web.UI.ToolTipUpdateEventArgs) Handles RadToolTipManager1.AjaxUpdate
Me.UpdateToolTip(e.Value, e.UpdatePanel)
End Sub
Private Sub UpdateToolTip(ByVal elementID As String, ByVal panel As UpdatePanel)
Dim ctrl As Control = Page.LoadControl("UserControlDetails.ascx")
panel.ContentTemplateContainer.Controls.Add(ctrl)
Dim UserDetails As UserControlDetails = DirectCast(ctrl, UserControlDetails)
UserDetails.UserIDGUID = elementID
End Sub
Private Sub RadGridUsers_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGridUsers.ItemDataBound
If e.Item.ItemType = GridItemType.Item OrElse e.Item.ItemType = GridItemType.AlternatingItem Then
Dim target As Control = e.Item.FindControl("targetControl")
If Not [Object].Equals(target, Nothing) Then
If Not [Object].Equals(Me.RadToolTipManager1, Nothing) Then
Dim currentRow As DataRowView = DirectCast(e.Item.DataItem, DataRowView)
Me.RadToolTipManager1.TargetControls.Add(target.ClientID, currentRow.Row("unique_identifier").ToString(), True)
End If
End If
End If
End Sub
Private Sub RadGridUsers_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGridUsers.ItemCommand
If e.CommandName = "Sort" OrElse e.CommandName = "Page" Then
RadToolTipManager1.TargetControls.Clear()
End If
End Sub
List
<Activity> list;
radGrid.DataSource = list;
and Activity class is something like this
public string CustomerName { get; set; }
public string AllocatedTo { get; set; }
public string Status { get; set; }
public UserInfoVO RaisedBy { get; set; }
Now RaisedBy is the object of class UserInfoVO which contain following properties
string firstName;
string LastName;
string phone;
now in this case in the view page i am using
<%
# Eval("Status ")%> to paint the field of the grid.
when it is for the primitive data type it display the value but how does it work for user defined classes... like i would like to print first name and phone no from UserInfoVo class.
thanks.
Regards,
Tej.
| <telerik:RadGrid ID="RadGrid1" CssClass="grid" runat="server" Skin="Office2007" |
| GridLines="None" PageSize="10" Height="300px" OnNeedDataSource="RadGrid1_OnNeedDataSource" |
| AutoGenerateColumns="false" ShowFooter="true" AllowAutomaticUpdates="false" |
| AllowAutomaticInserts="false" AllowAutomaticDeletes="false" AutoGenerateEditColumn="false"> |
| <MasterTableView TableLayout="Fixed" ClientDataKeyNames="AddressID" AutoGenerateColumns="false" |
| Width="100%" AllowAutomaticUpdates="false" AllowAutomaticInserts="false" AllowAutomaticDeletes="false"> |
| <Columns> |
| <telerik:GridBoundColumn DataField="AddressId" HeaderText="Id" AllowFiltering="false"> |
| <HeaderStyle HorizontalAlign="Left" Width="20" /> |
| <ItemStyle HorizontalAlign="Left" Width="20" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Name" HeaderText="Naam"> |
| <ItemStyle HorizontalAlign="Left" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="AddressTypeObj.Name" HeaderText="Adres type"> |
| <ItemStyle HorizontalAlign="Left" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridTemplateColumn UniqueName="TemplateActions" AllowFiltering="false"> |
| <HeaderTemplate> |
| <table border="0" cellpadding="0" cellspacing="0"> |
| <tr> |
| <td colspan="3" align="center"><p>Acties</p></td> |
| </tr> |
| </table> |
| </HeaderTemplate> |
| <ItemTemplate> |
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| <tr> |
| <td style="width:50%; border:0px; text-align:center;"> |
| <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
| <asp:ImageButton ImageUrl="../Images/edit.gif" AlternateText="Editeren" CausesValidation="false" runat="server" ID="btn_Edit" OnClick="Edit_OnClick" CommandName="Edit" CommandArgument='<%#Eval("AddressId") %>' /> |
| </telerik:RadCodeBlock> |
| </td> |
| <td style="width:50%; border:0px; text-align:center;"> |
| <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server"> |
| <asp:ImageButton ImageUrl="../Images/recyclebin.gif" AlternateText="Verwijderen" CausesValidation="false" runat="server" ID="btn_Delete" OnClick="Delete_OnClick" CommandName="Edit" CommandArgument='<%#Eval("AddressId") %>' /> |
| </telerik:RadCodeBlock> |
| </td> |
| </tr> |
| </table> |
| </ItemTemplate> |
| <ItemStyle HorizontalAlign="Center" /> |
| <HeaderStyle HorizontalAlign="Center" /> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| </MasterTableView> |
| <PagerStyle Mode="NextPrevAndNumeric" NextPageText="Volgende pagina" PrevPageText="Vorige pagina" NextPagesToolTip="Volgende pagina" PrevPagesToolTip="Vorige pagina" PagerTextFormat="Pagina: {4} Pagina {0} tot {3} op {5}" /> |
| </telerik:RadGrid> |