Telerik Forums
UI for WinForms Forum
22 answers
1.1K+ views
Hi,

I have a database with the field that contains the filename of an image that I would like to display in am Rad GridViewImage Column.  

- The databse itself does not contain the image just the filename.
- The field only contains the filename - not the full path (all images are stored in a single directory)
- The width of all the images are the same, however the height will vary.

I need to load the image at runtime for every record that is displayed.

I have searched everywhere, but cannot find how to achieve this.

I am using VB.NET 2010

Kindly assist.
Stefan
Telerik team
 answered on 11 Mar 2014
1 answer
434 views
Hello colleagues,

I am developing a themed application where trying support Office 2010 themes. The black and blue themes are drawn without artifacts. But I am stuck with the Silver theme. The form's background color differs from controls contained on the form. How can I set the same background color for the form?

Please see the silver.png screenshot for more information.
Dimitar
Telerik team
 answered on 11 Mar 2014
0 answers
78 views
I used following code to change the tab order by pressing Enter key , and it works great on any objects of my form.But when I changed the AutoCompleteMode property of my RadDropDownList to "SuggestAppend" , then
when I press Enter on RaddropDown the tab order not changed and it stay on this control !!!! plz help to handle this problem.

 protected override bool ProcessKeyPreview(ref Message m)
        {
            if (m.Msg == 0x0100 && (int)m.WParam == 13)
            {
                this.ProcessTabKey(true);
            }
David
Top achievements
Rank 1
 asked on 11 Mar 2014
5 answers
213 views
Hello, I need the gridview to automatically go to the "new row" row and the first visible column (the first column is hidden) of that row after adding a row. How can I achieve this? I've tried the following but for some reason the selected column is the second, not the first one (NoMes).


Private Sub gvMeses_UserAddedRow(sender As Object, e As Telerik.WinControls.UI.GridViewRowEventArgs) Handles gvMeses.UserAddedRow
 
    gvMeses.MasterView.TableAddNewRow.IsCurrent = True
    gvMeses.Columns("NoMes").IsCurrent = True
 
End Sub

Thanks
David
Top achievements
Rank 1
 answered on 11 Mar 2014
1 answer
151 views
Hi, I have two issues. 

1)  How can I change the title from 'Edit Appointment'

2)  I programmatically call a custom appointment dialog, but the background dropdown is empty. The code is below, I had to add a New event to the custom dialog in order to get it to work

 Dim app As New Appointment(Now, Now.AddMinutes(30))
 Dim frmeditDialog As EditAppointmentDialogExtended = New EditAppointmentDialogExtended(app, DashBoard.schMain)

  If frmeditDialog.ShowDialog(Me) = DialogResult.OK Then
                    DashBoard.schMain.Appointments.Add(frmeditDialog.Appointment)
  End If


Here is the New Sub in the custom dialog:

  Sub New(app As Telerik.WinControls.UI.Appointment, radScheduler As RadScheduler)
       _app = app
        _radScheduler = radScheduler

        InitializeComponent()
End Sub


Any help is appreciated.






Stefan
Telerik team
 answered on 11 Mar 2014
1 answer
121 views
Here is a tricky case.

I am showing a ToolStripDrowDown "from" a ToolWindow. I am aware ToolStripDropDowns are actually forms, not subcontrols, so that showing them from a control is loosely defined from a technical point of view. What I mean is that in reaction to a user action in a control inside the toolwindow, I display the toolstripdropdown next to this control.

The ToolStripDropDown contains a focusable control.

Here is the problematic scenario:
- the tool window is in autohide mode
- the user selects the toolwindow
- the user causes the toolstripdropdown to be displayed
- the user clicks inside the focusable control in the toolstripdropdown
- logically, the toolwindow loses focus and is hidden.

I am aware this is a perfectly logical behaviour by RadDock, but I am looking for a workaround. Any idea would be greatly appreciated.

PS: I am opened to giving up on ToolStripDropDowns. I am using it to provide a kind of light, unintrusive, dialog box, meaning it's not modal and automatically disappears whenever the user clicks somewhere else in the application. It's kind of a kludge, but it's been mostly satisfactory till now.
George
Telerik team
 answered on 11 Mar 2014
1 answer
63 views
Hi, I want to reduce left margin beside images. I tried . TreeViewElement.Margin but it didn't work.

See attached image.
Stefan
Telerik team
 answered on 10 Mar 2014
1 answer
199 views
Hello Forum Users

This is still a work in progress, but I thought that I'd share my routines with those of you that are interested and while there is room for optimization and correction - it does work.

Feel free to build upon this code for your own purposes - and share your improvements if you see fit to share back.

Preface:  I have a DAL (Data Access Layer) that returns datasets, datatables and so forth - so you are going to see a reference to oSQL --- which is my DAL.  You'll need to replace that with your own DAL or GetDataSet routines.

Scenario:  I have to hit three separate databases to build the grid and subgrids.  Not my choice.  So I use my DAL which is capable of hitting multiple databases rather than the Visual Studio method that creates bound datasets.  For example, if I did that I'd have so many bindingsource, dataset, etc objects on my screen I'd go crazy trying to manage them all... so the DAL is easier and less intrusive from that aspect.

As I hit the three SQL Databases I then needed to create a grid, sub-grid and another grid under one of the sub-grids.

This code shows how I did this - unbound.

I created a module file called: modRadGridViewRoutines which contains subroutines and also a class.  Shown below:

Imports Telerik.WinControls.UI

Module modRadGridViewRoutines
#Region " RadGridView Routines "
Friend Sub CreateMasterTemplate(ByVal oRadGridView As RadGridView, ByVal oMasterTemplateBindingSource As BindingSource, ByVal sMasterTemplateCaption As String, Optional ByVal bEnableGrouping As Boolean = True)
oRadGridView.EnableGrouping = bEnableGrouping
oRadGridView.DataSource = oMasterTemplateBindingSource
oRadGridView.GroupExpandAnimationType = GridExpandAnimationType.Slide
oRadGridView.EnableAlternatingRowColor = True
SetTemplateDefaults(oRadGridView.MasterTemplate)
oRadGridView.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill
oRadGridView.MasterTemplate.Caption = sMasterTemplateCaption
oRadGridView.MasterTemplate.ShowChildViewCaptions = True
End Sub

Friend Sub AddChildTemplateToMasterTemplate(ByVal oRadGridView As RadGridView, ByVal oChildTemplate As GridViewTemplate, ByVal oChildTemplateBindingSource As BindingSource, ByVal sChildTemplateCaption As String)
oChildTemplate.DataSource = oChildTemplateBindingSource
oChildTemplate.Caption = sChildTemplateCaption
oRadGridView.MasterTemplate.Templates.Add(oChildTemplate)
End Sub

Friend Sub CreateRadGridViewMasterTemplateRelations(ByVal oRadGridView As RadGridView, ByVal oChildTemplate As GridViewTemplate, ByVal sRelationName As String, ByVal sParentColumnNames As String, ByVal sChildColumnNames As String)
Dim oRelation As New GridViewRelation(oRadGridView.MasterTemplate)
oRelation.ChildTemplate = oChildTemplate
oRelation.RelationName = sRelationName
oRelation.ParentColumnNames.Add(sParentColumnNames)
oRelation.ChildColumnNames.Add(sChildColumnNames)
oRadGridView.Relations.Add(oRelation)
End Sub

Friend Sub AddChildTemplateToChildTemplate(ByVal oChildTemplate As GridViewTemplate, ByVal oChildSubTemplate As GridViewTemplate, ByVal oChildSubTemplateBindingSource As BindingSource, ByVal sChildSubTemplateCaption As String)
oChildSubTemplate.DataSource = oChildSubTemplateBindingSource
oChildSubTemplate.Caption = sChildSubTemplateCaption
oChildTemplate.Templates.Add(oChildSubTemplate)
End Sub

Friend Sub CreateRadGridViewChildTemplateRelations(ByVal oRadGridView As RadGridView, ByVal oChildTemplate As GridViewTemplate, ByVal oChildSubTemplate As GridViewTemplate, ByVal oRadGridViewRelationsClass As List(Of RadGridViewRelationsClass))
Dim oRelation As New GridViewRelation(oChildTemplate)
oRelation.ChildTemplate = oChildSubTemplate
For i = 0 To oRadGridViewRelationsClass.Count - 1
oRelation.RelationName = oRadGridViewRelationsClass.Item(i).RelationName
oRelation.ParentColumnNames.Add(oRadGridViewRelationsClass.Item(i).ParentFieldName)
oRelation.ChildColumnNames.Add(oRadGridViewRelationsClass.Item(i).ChildFieldName)
Next
oRadGridView.Relations.Add(oRelation)
End Sub

Friend Sub SetTemplateDefaults(ByVal oGridViewTemplate As GridViewTemplate)
oGridViewTemplate.ReadOnly = True
oGridViewTemplate.AllowRowResize = True
oGridViewTemplate.EnableAlternatingRowColor = True
oGridViewTemplate.AllowAddNewRow = False
oGridViewTemplate.AllowDeleteRow = False
oGridViewTemplate.AllowEditRow = False
End Sub
#End Region
End Module

Public Class RadGridViewRelationsClass
Private _RelationName As String
Private _ParentFieldName As String
Private _ChildFieldName As String

Public Sub New(ByVal sRelationName As String, ByVal sParentFieldName As String, ByVal sChildFieldName As String)
_RelationName = sRelationName
_ParentFieldName = sParentFieldName
_ChildFieldName = sChildFieldName
End Sub

Public Property RelationName As String
Get
Return _RelationName
End Get
Set(value As String)
_RelationName = value
End Set
End Property

Public Property ParentFieldName As String
Get
Return _ParentFieldName
End Get
Set(value As String)
_ParentFieldName = value
End Set
End Property

Public Property ChildFieldName As String
Get
Return _ChildFieldName
End Get
Set(value As String)
_ChildFieldName = value
End Set
End Property
End Class

Here is the example of how the class is used:

Private Sub GetOrders
SQL = "Select * From View_Orders ORDER BY TxnDate ASC"
Dim dtOrders As DataTable = oSQL.GetDataTable(SQL) : dtOrders.TableName = "Orders"

SQL = "Select * From View_OrderItems ORDER BY OrderID, TxnDate ASC"
Dim dtOrderItems As New DataTable : dtOrderItems = oSQL.GetDataTable(SQL) : dtOrderItems.TableName = "OrderItems"

SQL = "Select id, CustomerRefListID, ShipAddressFormatted From Orders"
Dim dtCustomerAddress As New DataTable : dtCustomerAddress = oSQL.GetDataTable(SQL) : dtCustomerAddress.TableName = "CustomerAddress"

SQL = "Select * From View_OrderItemComponentsToProductComponents"
Dim dtProductComponents As New DataTable : dtProductComponents = oSQL.GetDataTable(SQL) : dtProductComponents.TableName = "ProductComponents"

'programmatically create a new dataset only adding those products having sub components.
'Add the dataset to the orderitems template and connect it via the product code...

Dim dsDataCombined = New DataSet
dsDataCombined.Tables.Add(dtOrders.Copy)
dsDataCombined.Tables.Add(dtOrderItems.Copy)
dsDataCombined.Tables.Add(dtCustomerAddress.Copy)
dsDataCombined.Tables.Add(dtProductComponents.Copy)
rgvOrders.DataSource = dsDataCombined

dtOrders = Nothing
dtOrderItems = Nothing
dtCustomerAddress = Nothing
dtProductComponents = Nothing

Dim OrdersBindingSource As New BindingSource
OrdersBindingSource.DataSource = dsDataCombined : OrdersBindingSource.DataMember = dsDataCombined.Tables(0).TableName

Dim OrderItemsBindingSource As New BindingSource
OrderItemsBindingSource.DataSource = dsDataCombined : OrderItemsBindingSource.DataMember = dsDataCombined.Tables(1).TableName

Dim CustomerAddressBindingSource As New BindingSource
CustomerAddressBindingSource.DataSource = dsDataCombined : CustomerAddressBindingSource.DataMember = dsDataCombined.Tables(2).TableName

Dim ProductComponentsBindingSource As New BindingSource
ProductComponentsBindingSource.DataSource = dsDataCombined : ProductComponentsBindingSource.DataMember = dsDataCombined.Tables(3).TableName

CreateMasterTemplate(rgvOrders, OrdersBindingSource, "Customer Order")

Dim OrderItemsTemplate As New GridViewTemplate()
AddChildTemplateToMasterTemplate(rgvOrders, OrderItemsTemplate, OrderItemsBindingSource, "Order Items/Details")
CreateRadGridViewMasterTemplateRelations(rgvOrders, OrderItemsTemplate, "OrderToOrderItems", "id", "OrderID")
SetTemplateDefaults(OrderItemsTemplate)

Dim CustomerAddressTemplate As New GridViewTemplate()
AddChildTemplateToMasterTemplate(rgvOrders, CustomerAddressTemplate, CustomerAddressBindingSource, "Customer Address Information")
CreateRadGridViewMasterTemplateRelations(rgvOrders, CustomerAddressTemplate, "CustomerAddress", "id", "id")
SetTemplateDefaults(CustomerAddressTemplate)

Dim ProductComponentsTemplate As New GridViewTemplate()
AddChildTemplateToChildTemplate(OrderItemsTemplate, ProductComponentsTemplate, ProductComponentsBindingSource, "Product Unbuild")

ProductNumberToParentProductNumberRelations = New List(Of RadGridViewRelationsClass)()
ProductNumberToParentProductNumberRelations.Add(New RadGridViewRelationsClass("ComponentsToOrderItems", "ProductNumber", "ParentProductNumber"))
ProductNumberToParentProductNumberRelations.Add(New RadGridViewRelationsClass("ComponentsToOrderItemsOrderID", "OrderID", "OrderItemID"))

CreateRadGridViewChildTemplateRelations(rgvOrders, OrderItemsTemplate, ProductComponentsTemplate, ProductNumberToParentProductNumberRelations)
SetTemplateDefaults(ProductComponentsTemplate)
End Sub


This portion of the code:

#Region " List(of) Variables "
Private ProductNumberToParentProductNumberRelations As List(Of RadGridViewRelationsClass)
#End Region

SQL = "Select * From View_Orders ORDER BY TxnDate ASC"
Dim dtOrders As DataTable = oSQL.GetDataTable(SQL) : dtOrders.TableName = "Orders"

SQL = "Select * From View_OrderItems ORDER BY OrderID, TxnDate ASC"
Dim dtOrderItems As New DataTable : dtOrderItems = oSQL.GetDataTable(SQL) : dtOrderItems.TableName = "OrderItems"

SQL = "Select id, CustomerRefListID, ShipAddressFormatted From Orders"
Dim dtCustomerAddress As New DataTable : dtCustomerAddress = oSQL.GetDataTable(SQL) : dtCustomerAddress.TableName = "CustomerAddress"

SQL = "Select * From View_OrderItemComponentsToProductComponents"
Dim dtProductComponents As New DataTable : dtProductComponents = oSQL.GetDataTable(SQL) : dtProductComponents.TableName = "ProductComponents"

'programmatically create a new dataset only adding those products having sub components.
'Add the dataset to the orderitems template and connect it via the product code...

Dim dsDataCombined = New DataSet
dsDataCombined.Tables.Add(dtOrders.Copy)
dsDataCombined.Tables.Add(dtOrderItems.Copy)
dsDataCombined.Tables.Add(dtCustomerAddress.Copy)
dsDataCombined.Tables.Add(dtProductComponents.Copy)
rgvOrders.DataSource = dsDataCombined

dtOrders = Nothing
dtOrderItems = Nothing
dtCustomerAddress = Nothing
dtProductComponents = Nothing

Dim OrdersBindingSource As New BindingSource
OrdersBindingSource.DataSource = dsDataCombined : OrdersBindingSource.DataMember = dsDataCombined.Tables(0).TableName

Dim OrderItemsBindingSource As New BindingSource
OrderItemsBindingSource.DataSource = dsDataCombined : OrderItemsBindingSource.DataMember = dsDataCombined.Tables(1).TableName

Dim CustomerAddressBindingSource As New BindingSource
CustomerAddressBindingSource.DataSource = dsDataCombined : CustomerAddressBindingSource.DataMember = dsDataCombined.Tables(2).TableName

Dim ProductComponentsBindingSource As New BindingSource
ProductComponentsBindingSource.DataSource = dsDataCombined : ProductComponentsBindingSource.DataMember = dsDataCombined.Tables(3).TableName

CreateMasterTemplate(rgvOrders, OrdersBindingSource, "Customer Order")

Dim OrderItemsTemplate As New GridViewTemplate()
AddChildTemplateToMasterTemplate(rgvOrders, OrderItemsTemplate, OrderItemsBindingSource, "Order Items/Details")
CreateRadGridViewMasterTemplateRelations(rgvOrders, OrderItemsTemplate, "OrderToOrderItems", "id", "OrderID")
SetTemplateDefaults(OrderItemsTemplate)

Dim CustomerAddressTemplate As New GridViewTemplate()
AddChildTemplateToMasterTemplate(rgvOrders, CustomerAddressTemplate, CustomerAddressBindingSource, "Customer Address Information")
CreateRadGridViewMasterTemplateRelations(rgvOrders, CustomerAddressTemplate, "CustomerAddress", "id", "id")
SetTemplateDefaults(CustomerAddressTemplate)

Dim ProductComponentsTemplate As New GridViewTemplate()
AddChildTemplateToChildTemplate(OrderItemsTemplate, ProductComponentsTemplate, ProductComponentsBindingSource, "Product Unbuild")

ProductNumberToParentProductNumberRelations = New List(Of RadGridViewRelationsClass)()
ProductNumberToParentProductNumberRelations.Add(New RadGridViewRelationsClass("ComponentsToOrderItems", "ProductNumber", "ParentProductNumber"))
ProductNumberToParentProductNumberRelations.Add(New RadGridViewRelationsClass("ComponentsToOrderItemsOrderID", "OrderID", "OrderItemID"))

CreateRadGridViewChildTemplateRelations(rgvOrders, OrderItemsTemplate, ProductComponentsTemplate, ProductNumberToParentProductNumberRelations)
       
Uses the class found within modRadGridViewRoutines to create a multiple filter for the final (3rd Tier) grid.

Hopefully you'll find this usefull as a base for your own routines and I'll say once again that it's a work in progress even for me.

Please share your optimizations and upgrades to this code if you find it helpful so that all of us can benefit from it. :)










George
Telerik team
 answered on 10 Mar 2014
11 answers
235 views
Why is it that when there are more appointments than can be displayed on a single day, the month view does not have scroll bars to view the additional items.... but the timeline view does?

We absolutely love the way that the timeline view has scrollbars to see all the additional items. We are getting an absurd number of complaints from our customers about how the month view forces them into the day view just to see what appointments they have that day.

We deal with accountants, chiropractors, lawyers, and other service representatives that can have 20+ appointments per day. And they want to be able to see all those appointments on the month view without having to switch to different view types.

Is there any possible way we can get an option to display scroll bars on the month view when there are too many appointments to display on one day? This has really turned out to be a critical issue for us....
George
Telerik team
 answered on 10 Mar 2014
6 answers
233 views
I would like to update a RadPageView which is in the Stack ViewMode to have the selected and selected page titles look the same. In the attached screenshot I would like to have "Page 1" and "Page 2" appear the same (i.e. blue background with white text). I can't seem to find the properties to set the colors (background and foreground) and font to achieve what I want.

How can I customize the RadPageViewPage titles?
Paul B
Top achievements
Rank 2
 answered on 07 Mar 2014
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Barcode
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
Localization
TimePicker
ButtonTextBox
FontDropDownList
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?