Hi
I have Rad Combo box in this combox i have to dispaly the grid View With Image .
where we set the Image for the Inage in Grid View, if i select the row in the grid it should display the selected row with image, can u send me one sample project.
regards
smith
I have Rad Combo box in this combox i have to dispaly the grid View With Image .
where we set the Image for the Inage in Grid View, if i select the row in the grid it should display the selected row with image, can u send me one sample project.
regards
smith
1 Answer, 1 is accepted
0
JigneshGN
Top achievements
Rank 2
answered on 25 Jan 2010, 03:00 PM
Hi,
I want same functionality.
Please help.
Regards,
Jignesh Patel
I want same functionality.
Private Sub GenereateGridStructure() |
' Start added by jignesh patel dtd 2010.01.22 Created objects for needed columns |
grdColStatus = New Telerik.WinControls.UI.GridViewComboBoxColumn |
grdColFavoriteMedicineID = New Telerik.WinControls.UI.GridViewTextBoxColumn |
grdColStartDate = New Telerik.WinControls.UI.GridViewDateTimeColumn |
grdColDate = New Telerik.WinControls.UI.GridViewTextBoxColumn |
grdColReNewal = New Telerik.WinControls.UI.GridViewDateTimeColumn |
grdColStopDate = New Telerik.WinControls.UI.GridViewDateTimeColumn |
grdColMedicine = New Telerik.WinControls.UI.GridViewTextBoxColumn |
grdColTimes = New Telerik.WinControls.UI.GridViewTextBoxColumn |
grdColQty = New Telerik.WinControls.UI.GridViewTextBoxColumn |
grdColRefill = New Telerik.WinControls.UI.GridViewTextBoxColumn |
grdColRemarks = New Telerik.WinControls.UI.GridViewTextBoxColumn |
grdColCareGiver = New Telerik.WinControls.UI.GridViewTextBoxColumn |
grdColUpdatedBy = New Telerik.WinControls.UI.GridViewTextBoxColumn |
grdColUpdatedOn = New Telerik.WinControls.UI.GridViewTextBoxColumn |
grdColRxOTC = New Telerik.WinControls.UI.GridViewComboBoxColumn |
grdColSource = New Telerik.WinControls.UI.GridViewComboBoxColumn |
' End added by jignesh patel dtd 2010.01.22 Created objects for needed columns |
'Start added by jignesh patel dtd 2010.01.22 added columns in grid |
Me.grdMedication.Columns.Add(grdColStatus) |
Me.grdMedication.Columns.Add(grdColFavoriteMedicineID) |
Me.grdMedication.Columns.Add(grdColStartDate) |
Me.grdMedication.Columns.Add(grdColDate) |
Me.grdMedication.Columns.Add(grdColReNewal) |
Me.grdMedication.Columns.Add(grdColStopDate) |
Me.grdMedication.Columns.Add(grdColMedicine) |
Me.grdMedication.Columns.Add(grdColTimes) |
Me.grdMedication.Columns.Add(grdColQty) |
Me.grdMedication.Columns.Add(grdColRefill) |
Me.grdMedication.Columns.Add(grdColRemarks) |
Me.grdMedication.Columns.Add(grdColCareGiver) |
Me.grdMedication.Columns.Add(grdColUpdatedBy) |
Me.grdMedication.Columns.Add(grdColUpdatedOn) |
Me.grdMedication.Columns.Add(grdColRxOTC) |
Me.grdMedication.Columns.Add(grdColSource) |
'End added by jignesh patel dtd 2010.01.22 added columns in grid |
'Start added by jignesh patel dtd 2010.01.22 Initializing properties for columns |
grdColStatus.DisplayMember = "Name" |
grdColStatus.FieldAlias = "Status" |
grdColStatus.FieldName = "Status" |
grdColStatus.HeaderText = "Status" |
grdColStatus.UniqueName = "grdColStatus" |
grdColStatus.ValueMember = "Name" |
grdColStatus.Width = 80 |
grdColStatus.TextImageRelation = TextImageRelation.ImageBeforeText |
grdColFavoriteMedicineID.FieldAlias = "ID" |
grdColFavoriteMedicineID.FieldName = "ID" |
grdColFavoriteMedicineID.HeaderText = "grdColFavoriteMedicineID" |
grdColFavoriteMedicineID.IsVisible = False |
grdColFavoriteMedicineID.ReadOnly = True |
grdColFavoriteMedicineID.UniqueName = "grdColFavoriteMedicineID" |
grdColStartDate.DataType = GetType(Date) |
grdColStartDate.FieldAlias = "StartDate" |
grdColStartDate.FieldName = "StartDate" |
grdColStartDate.FormatString = "{0: MM/dd/yyyy}" |
grdColStartDate.HeaderText = "Start" |
grdColStartDate.DataEditFormatString = "MM/dd/yyyy" |
grdColStartDate.UniqueName = "grdColStartDate" |
grdColStartDate.Width = 70 |
grdColDate.FieldAlias = "MedicineDate" |
grdColDate.FieldName = "MedicineDate" |
grdColDate.FormatString = "{0:MM/dd/yyyy}" |
grdColDate.DataEditFormatString = "MM/dd/yyyy" |
grdColDate.HeaderText = "Modified" |
grdColDate.UniqueName = "grdColDate" |
grdColDate.Width = 70 |
grdColReNewal.DataType = GetType(Date) |
grdColReNewal.FieldAlias = "Renewal" |
grdColReNewal.FieldName = "Renewal" |
grdColReNewal.FormatString = "{0: MM/dd/yyyy}" |
grdColReNewal.DataEditFormatString = "MM/dd/yyyy" |
grdColReNewal.HeaderText = "Renewal" |
grdColReNewal.UniqueName = "grdColReNewal" |
grdColReNewal.Width = 70 |
grdColStopDate.DataType = GetType(Date) |
grdColStopDate.FieldAlias = "StopDate" |
grdColStopDate.FieldName = "StopDate" |
grdColStopDate.FormatString = "{0: MM/dd/yyyy}" |
grdColStopDate.DataEditFormatString = "MM/dd/yyyy" |
grdColStopDate.HeaderText = "End" |
grdColStopDate.UniqueName = "grdColStopDate" |
grdColStopDate.Width = 70 |
grdColMedicine.FieldAlias = "MedicineName" |
grdColMedicine.FieldName = "MedicineName" |
grdColMedicine.HeaderText = "Medicine" |
grdColMedicine.UniqueName = "grdColMedicine" |
grdColMedicine.ReadOnly = True |
grdColMedicine.Width = 190 |
grdColTimes.FieldAlias = "Times" |
grdColTimes.FieldName = "Times" |
grdColTimes.HeaderText = "Directions (SIG.)" |
grdColTimes.UniqueName = "grdColTimes" |
grdColTimes.Width = 120 |
grdColQty.FieldAlias = "Qty" |
grdColQty.FieldName = "Qty" |
grdColQty.HeaderText = "Quantity" |
grdColQty.UniqueName = "grdColQty" |
grdColQty.Width = 60 |
grdColRefill.FieldAlias = "Refill" |
grdColRefill.FieldName = "Refill" |
grdColRefill.HeaderText = "Refills" |
grdColRefill.UniqueName = "grdColRefill" |
grdColRefill.Width = 45 |
grdColRemarks.FieldAlias = "Remarks" |
grdColRemarks.FieldName = "Remarks" |
grdColRemarks.HeaderText = "Remarks" |
grdColRemarks.UniqueName = "grdColRemarks" |
grdColRemarks.Width = 150 |
grdColRemarks.TextAlignment = ContentAlignment.MiddleLeft |
grdColCareGiver.FieldAlias = "CareGiver" |
grdColCareGiver.FieldName = "CareGiver" |
grdColCareGiver.HeaderText = "Care Giver" |
grdColCareGiver.UniqueName = "CareGiver" |
grdColCareGiver.Width = 125 |
grdColUpdatedBy.FieldAlias = "UpdatedBy" |
grdColUpdatedBy.FieldName = "UpdatedBy" |
grdColUpdatedBy.HeaderText = "Updated By" |
grdColUpdatedBy.ReadOnly = True |
grdColUpdatedBy.UniqueName = "grdColUpdatedBy" |
grdColUpdatedBy.Width = 70 |
grdColUpdatedOn.FieldAlias = "UpdatedOn" |
grdColUpdatedOn.FieldName = "UpdatedOn" |
grdColUpdatedOn.HeaderText = "Updated On" |
grdColUpdatedOn.UniqueName = "grdColUpdatedOn" |
grdColUpdatedOn.ReadOnly = True |
grdColUpdatedOn.FormatString = "{0:MM/dd/yyyy}" |
grdColUpdatedOn.Width = 73 |
grdColRxOTC.FieldAlias = "RxOTC" |
grdColRxOTC.FieldName = "RxOTC" |
grdColRxOTC.HeaderText = "Rx/OTC" |
grdColRxOTC.UniqueName = "grdColRxOTC" |
grdColRxOTC.Width = 50 |
grdColRxOTC.DisplayMember = "Text" |
grdColRxOTC.ValueMember = "Text" |
grdColRxOTC.ImageLayout = ImageLayout.Tile |
grdColRxOTC.TextImageRelation = TextImageRelation.ImageBeforeText |
Dim objRxOTCSource As New List(Of Telerik.WinControls.UI.RadComboBoxItem) |
Dim objcmbitem As New Telerik.WinControls.UI.RadComboBoxItem |
objcmbitem.Text = "Rx" |
objcmbitem.Image = imgListRxOTC.Images("Rx") |
objcmbitem.ImageAlignment = ContentAlignment.MiddleLeft |
objcmbitem.TextAlignment = ContentAlignment.MiddleLeft |
objcmbitem.TextImageRelation = TextImageRelation.ImageBeforeText |
objcmbitem.DisplayStyle = DisplayStyle.ImageAndText |
objRxOTCSource.Add(objcmbitem) |
objcmbitem = New Telerik.WinControls.UI.RadComboBoxItem |
objcmbitem.Text = "OTC" |
objcmbitem.Image = imgListRxOTC.Images("OTC") |
objcmbitem.ImageAlignment = ContentAlignment.MiddleLeft |
objcmbitem.TextAlignment = ContentAlignment.MiddleLeft |
objcmbitem.TextImageRelation = TextImageRelation.ImageBeforeText |
objcmbitem.DisplayStyle = DisplayStyle.ImageAndText |
objRxOTCSource.Add(objcmbitem) |
grdColRxOTC.DataSource = objRxOTCSource |
grdColSource.FieldName = "Source" |
grdColSource.FieldName = "Source" |
grdColSource.HeaderText = "Source" |
grdColSource.UniqueName = "grdColSource" |
grdColSource.Width = 60 |
grdColSource.DisplayMember = "Text" |
grdColSource.ValueMember = "Text" |
grdColSource.ImageLayout = ImageLayout.Tile |
grdColSource.TextImageRelation = TextImageRelation.ImageBeforeText |
objSourcedata = New List(Of Telerik.WinControls.UI.RadComboBoxItem) |
objcmbitem = New Telerik.WinControls.UI.RadComboBoxItem |
objcmbitem.Text = "Script" |
objcmbitem.Image = imgListSource.Images("Script.ico") |
objcmbitem.ImageAlignment = ContentAlignment.MiddleLeft |
objcmbitem.TextAlignment = ContentAlignment.MiddleLeft |
objcmbitem.TextImageRelation = TextImageRelation.ImageBeforeText |
objcmbitem.DisplayStyle = DisplayStyle.ImageAndText |
objSourcedata.Add(objcmbitem) |
objcmbitem = New Telerik.WinControls.UI.RadComboBoxItem |
objcmbitem.Text = "Others" |
objcmbitem.Image = imgListSource.Images("Other.png") |
objcmbitem.ImageAlignment = ContentAlignment.MiddleLeft |
objcmbitem.TextAlignment = ContentAlignment.MiddleLeft |
objcmbitem.TextImageRelation = TextImageRelation.ImageBeforeText |
objcmbitem.DisplayStyle = DisplayStyle.ImageAndText |
objSourcedata.Add(objcmbitem) |
objcmbitem = New Telerik.WinControls.UI.RadComboBoxItem |
objcmbitem.Text = "Manual" |
objcmbitem.Image = imgListSource.Images("Manual.ico") |
objcmbitem.ImageAlignment = ContentAlignment.MiddleLeft |
objcmbitem.TextAlignment = ContentAlignment.MiddleLeft |
objcmbitem.TextImageRelation = TextImageRelation.ImageBeforeText |
objcmbitem.DisplayStyle = DisplayStyle.ImageAndText |
objSourcedata.Add(objcmbitem) |
objcmbitem = New Telerik.WinControls.UI.RadComboBoxItem |
objcmbitem.Text = "Electronic" |
objcmbitem.Image = imgListSource.Images("Electronic.png") |
objcmbitem.ImageAlignment = ContentAlignment.MiddleLeft |
objcmbitem.TextAlignment = ContentAlignment.MiddleLeft |
objcmbitem.TextImageRelation = TextImageRelation.ImageBeforeText |
objcmbitem.DisplayStyle = DisplayStyle.ImageAndText |
objSourcedata.Add(objcmbitem) |
grdColSource.DataSource = objSourcedata |
'End added by jignesh patel dtd 2010.01.22 Initializing properties for columns |
' added by jignesh patel dtd 2010.01.22 To group related columns in one group |
Dim columnGroupsView As New ColumnGroupsViewDefinition |
columnGroupsView.ColumnGroups.Add(New GridViewColumnGroup("Medication Detail")) ' For status |
columnGroupsView.ColumnGroups.Add(New GridViewColumnGroup("Other Details")) ' for dates |
columnGroupsView.ColumnGroups(0).Rows.Add(New Telerik.WinControls.UI.GridViewColumnGroupRow) ' Row creatd for status column which will contains status column |
columnGroupsView.ColumnGroups(1).Rows.Add(New Telerik.WinControls.UI.GridViewColumnGroupRow) ' Row creatd for dates columns which will contains all 4 date column |
columnGroupsView.ColumnGroups(0).Rows(0).Columns.Add(grdColStatus) |
columnGroupsView.ColumnGroups(0).Rows(0).Columns.Add(grdColFavoriteMedicineID) |
columnGroupsView.ColumnGroups(0).Rows(0).Columns.Add(grdColMedicine) |
columnGroupsView.ColumnGroups(0).Rows(0).Columns.Add(grdColTimes) |
columnGroupsView.ColumnGroups(0).Rows(0).Columns.Add(grdColQty) |
columnGroupsView.ColumnGroups(0).Rows(0).Columns.Add(grdColRefill) |
columnGroupsView.ColumnGroups(0).Rows(0).Columns.Add(grdColRemarks) |
columnGroupsView.ColumnGroups(0).Rows(0).Columns.Add(grdColRxOTC) |
columnGroupsView.ColumnGroups(0).Rows(0).Columns.Add(grdColSource) |
columnGroupsView.ColumnGroups(1).Rows(0).Columns.Add(grdColStartDate) |
columnGroupsView.ColumnGroups(1).Rows(0).Columns.Add(grdColDate) |
columnGroupsView.ColumnGroups(1).Rows(0).Columns.Add(grdColReNewal) |
columnGroupsView.ColumnGroups(1).Rows(0).Columns.Add(grdColStopDate) |
columnGroupsView.ColumnGroups(1).Rows(0).Columns.Add(grdColCareGiver) |
columnGroupsView.ColumnGroups(1).Rows(0).Columns.Add(grdColUpdatedBy) |
columnGroupsView.ColumnGroups(1).Rows(0).Columns.Add(grdColUpdatedOn) |
grdMedication.ViewDefinition = columnGroupsView |
grdMedication.MasterGridViewTemplate.Columns(0).RowSpan = 2 |
' added by jignesh patel dtd 2010.01.22 To group related columns in one group |
End Sub |
Please help.
Regards,
Jignesh Patel