Good day peeps!!!
I had an UltraGrid as shown with "Cell Size" & "Beam Width" columns both with the Style "IntegerPositivewithSpin" but i wonder is there a way to limit the range of the "Spin"?....... Like i only want the users being able to increase or decrease the integers in column "Cell Size" in the range of "5 to 75"
Another question is, can i append a "column" to an UltraGrid whereby the "column" has different no. of rows with the table in the UltraGrid?..... For example, i want to append a new "column" to an UltraGrid (figure 1) so that the outcome would be like (figure 2)
Last question is related to UltraExplorerBar with the style "Explorer Bar"...... Can I disable the expansion function for the "Header Button"?..... as i found that I can only hide the "Indicator" of the "Header Button"....
Thank you!!!
wc8262 said:I had an UltraGrid as shown with "Cell Size" & "Beam Width" columns both with the Style "IntegerPositivewithSpin" but i wonder is there a way to limit the range of the "Spin"?....... Like i only want the users being able to increase or decrease the integers in column "Cell Size" in the range of "5 to 75"
Set the MinValue and MaxValue on the column.
wc8262 said:Another question is, can i append a "column" to an UltraGrid whereby the "column" has different no. of rows with the table in the UltraGrid?..... For example, i want to append a new "column" to an UltraGrid (figure 1) so that the outcome would be like (figure 2)
You can add an unbound column to the grid. But the data source will still have the same number of rows, rows are not specific to columns. You could just leave the cells in the other columns blank, of course, and even disable editing in those cells.
wc8262 said:Last question is related to UltraExplorerBar with the style "Explorer Bar"...... Can I disable the expansion function for the "Header Button"?..... as i found that I can only hide the "Indicator" of the "Header Button"....
I'm not sure what you mean. You would probably be better off asking this question in the ExporerBar forum.
Mike Saltzman"]Set the MinValue and MaxValue on the column.
Mike Saltzman"]I'm not sure what you mean. You would probably be better off asking this question in the ExporerBar forum.
Thanks Mike! With your help, I had solved the 2 questions above....=)
Mike Saltzman"]You can add an unbound column to the grid. But the data source will still have the same number of rows, rows are not specific to columns. You could just leave the cells in the other columns blank, of course, and even disable editing in those cells.
you mean I have to do it in coding?
Another of my problem is.... I wish to have a "drop down images list" for one of the column in my UltraGrid, is it possible? I'd tried to set the column's Style to "Image" and assign an "Image List" to the UltraGrid but it doesn't seem to work.......
Ok, I figured it out. However, I just used a regular ValueList in stead of a BindableValueList
For anyone who's interested in my code:
private void SetColumnImageLookupInternal(UltraGridColumn column, DataTable table, string dataValueColumnName, string dataTextColumnName, string dataPictureColumnName){ ValueList ValueList; ValueListItem Item; ValueList = new ValueList(); ValueList.DisplayStyle = ValueListDisplayStyle.DisplayTextAndPicture; foreach (DataRow Row in table.Rows) { Item = ValueList.ValueListItems.Add(Row[dataValueColumnName]); if (dataTextColumnName != null && Row[dataTextColumnName] != DBNull.Value) { Item.DisplayText = Row[dataTextColumnName].ToString(); } if (Row[dataPictureColumnName] != DBNull.Value) { Item.Appearance.Image = ConvertToBitmap((byte[)Row[dataPictureColumnName]); } } column.EditorControl = null; column.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList; column.ValueList = ValueList;}
Thx Mike
Okay, tha's not going to work. The grid will be able to match up the PictureId in the customer table with the PictureId in the Picture table. But specifying an image field as the DisplayMember of a DropDown won't work correctly, because it only supports strings.
There are a couple of ways you can go with this. What I would probably do is use a ValueList, instead of an UltraDropDown and apply the image to the ValueListItem.Oddly enough, I just posted some sample code demonstrating how to do this: Sorting, icons and valuebasedappearance - Infragistics Forums
Now.. the sample code adds the items to the ValueList manually, and you probably want to bind your list. So you can do this with a BindableValueList (instead of a regular ValueList), and then just loop through the items on the list and assign the item.Appearance.Image to the value of the Photo column.
I'm doing this code in the form_load event.I set the entire layout of the grid there
Let's assume I have the following situation, where I want to show tblCustomer in a grid, with the customer's photo
tblCustomer
CustomerId (int)PictureId (int)
tblPicture
PictureId (int)Photo (Image)
So the DisplayMember of the dropdown is 'Photo'The ValueMember of the dropdown is 'PictureId'The DataSource of the DropDown is set to tblPicture
What event is this code in?
What are the actual data values you are using in your dropdown's ValueMember column? What data type are these values?
What's the DataType of the column in the grid?
I'm having the same question
I want to show a table in the grid. One of the columns is an ID that links to another table with images. So basically I want to show the Image in the grid, with a dropdown to choose another image.
The dropdown with the images is working, but it won't show the image in the grid itself. It only displays 'System.Byte['
Here's what I got so far (I simplified the code a bit, so it's possible it won't compile)
DropDown = new UltraDropDown(); DropDown.DataSource = dataTable;
DropDown.DisplayMember = lookupColumnDefinition.DisplayColumnName; DropDown.ValueMember = lookupColumnDefinition.ValueColumnName;
Column = dropDown.DisplayLayout.Bands["tableName"].Columns["ColumnContainingTheActualImage"]; if (Column.DataType.ToString() == "System.Byte[") { Column.Editor = new Infragistics.Win.EmbeddableImageRenderer(); }
ultraGridColumn.ValueList = DropDown;