Hi
I am using IBindingList as DataSource to bind UltraWinGrid.
So as i set the binding source the UltraWinGrid is filled with object which i had send via datasource.There are as many columns as many properties i had in my object.
My problem is that i want to customize the columns as i want only desired columns not all properties which are there in my object.
Is there any option or any other way by which i could handle the columns which are shown ,except setting Hidden/Visible property ?
I need not all columns to be binded via UltraWinGrid
Hi,
I just wanted to know if you were able to solve your issue based on our's suggestions or you still need help? Just let me know.
Thank you.
HOWTO:How can I define columns in the grid at Design-time and bind them at run-time so that some fields of the data are excluded from the grid?
Hello,
Other way to achieve something similar to your requirements is to add few columns through the code in the UltraGrid, then to set ultraGrid1.DisplayLayout.NewColumnLoadStyle to Hide, bind your grid to a data. Then the grid will show only these columns which have the same “keys” as the ones from the Data object, and will hide the rest of them.
To group column programmatically first you should set ultraGrid1.DisplayLayout.ViewStyleBand = Infragistics.Win.UltraWinGrid.ViewStyleBand.OutlookGroupBy;
and then add the key of the column that you want to be grouped by in SortedColumns collection.
Also you could use different editor for each cell of the grid, when you handle InitializeRow event end set Editor property to desire editor.
I have created a sample to illustrate how you could do this, but in the sample for data source of UltraGrid I am using data table.
Also please look at the following link to our online help generally to WinGrid, where you could find very helpful information of using of UltraGrid.
http://help.infragistics.com/NetAdvantage/WinForms/2010.3/CLR2.0/?page=WinGrid.html
Let me know if you have any further questions.
Thanks Mike for quick reply.
The Browsable attribute works fine but i have existing predefined classes which are used allover in my framework,so i don't want to change my classes attribute.
Is there any property on ultraWingrid which could help me with it.
From what you have explained i conclude that it's not possible to define columns at design time while using IBindingList as datasourceWe are using the same object on different views and columns are shown based on view. What I have found is that in your siverlight web grid there is an option to turn off "AutoGenerateColumn" and this is exactly what I need in Ultrawingrid.
One more question: I want to set the tag of a cell to the object binded to the cell and can i have custom cell editor like cell which contain the (textbox and two button) in a single cell.I have seen ColumnStyle property but by it i can set predefined style not custom one
another question I have One band and 5 columns in it.Now i want to group programatically the columns with One of the column from them.By drag and drop i was able to do so but programatically how to do so i can't find.Can you help me with it.
If you don't want to use the Hidden property on the grid column, then the only other simple way to do this would be to put the [Browsable(false)] attribute on the properties of your object that you do want to bind. This will tell the BindingManager in DotNet to ignore those properties for the purposes of binding.