I require the need to add a column to the UltraGrid that can display an image in it's cells.
The UltraGrid is bound to a data table however the column I need to add is not part of the dataTable. The column would be entirely fabricated on the front end.
Also I would need to create this column and add it after the InitializeLayout event has been triggered and I'm not sure how to access the columns in code at this point.
Any help would be greatly appreciated thank you!
Sorry for late rly.. I correct that thank you so much.
Did you set the DataType and also the Style on the Column like in the code I posted above?
Hai I Have a doubt,
How to get a image from folder to ultragrid cell
this is my code,
Dim val As Int32 For Each row As UltraGridRow In UltraGrid2.Rows
val = row.Cells(1).Value Dim foldername As String = "D:\SOFTWARES\Development\DART_PRODUCTS\TimeTracker2-DELTA\photo-Delta\" Dim filename As String = System.IO.Path.Combine(foldername, val & ".jpg") ' Dim file = Image.FromFile(e.Row.Cells(filename).Text) If System.IO.File.Exists(filename) Then e.Row.Cells("Image").Value = Image.FromFile(filename) End If Next
The above code are under Initializerow..
Please Help me
Hi Paul,
You are reading out the TextHAlign property of the CellAppearance property of the column. This will only return a value if you set one on that cell, which you apparently didn't.
You must either be using the default alignment, or you are setting the alignment one some other appearance, like on the Override for the band or layout, or via AppStylist.
The grid resolves the appearance of any given cell when the cell paints on the screen and it takes into account many appearance properties, application styling, etc. So what you want is not the property setting on the individual column's CellAppearance, but rather the resolved appearance. For that, you need a cell (a column is not enough). You do it using the ResolveAppearance method.
Dim cell As UltraGridCell = Me.UltraGrid1.Rows(0).Cells(0) Dim appData As AppearanceData = New AppearanceData() Dim appearancePropFlags As AppearancePropFlags = appearancePropFlags.TextHAlign cell.ResolveAppearance(appData, appearancePropFlags) Debug.WriteLine(appData.TextHAlign)
Mike,
I'm trying to do something a little unique. I am working on an export to Excel feature for our users. I need to translate the TextHAlign values to Excel constants. to do it, I'm trying to retrieve the current text alignment value for the column like this:
Select Case .Columns.Item ( arrColumnKeys(x) ).CellAppearance.TextHAlign
Case Infragistics.Win.HAlign.Right
numAlignment = ExcelFunctions.Excel_Constants.xlRight
Case Infragistics.Win.HAlign.Left
numAlignment = ExcelFunctions.Excel_Constants.xlLeft
Case Infragistics.Win.HAlign.Center
numAlignment = ExcelFunctions.Excel_Constants.xlCenter
Case Else
End Select
The only thing that executes is the "Case Else" path. what am I missing?
Thanks in advance,
Paul