Dear all,
I have the ultragrid with one numeric cell. How to add System.Windows.Forms.NumericUpDown control to the ultragrid cell column?? Or any other controls? Any sample code??
Hello,
I can think of two ways to do this:
1. You could put the control into an 'UltraControlContainerEditor' and assign the last as an EditorComponent to the column/cell.
ultraControlContainerEditor1.RenderingControl = numericUpDown1; ultraControlContainerEditor1.RenderingControlPropertyName = "Value"; e.Layout.Bands[0].Columns[1].EditorComponent = ultraControlContainerEditor1;
ultraControlContainerEditor1.RenderingControl = numericUpDown1;
ultraControlContainerEditor1.RenderingControlPropertyName = "Value";
e.Layout.Bands[0].Columns[1].EditorComponent = ultraControlContainerEditor1;
You could read about the 'UltraControlContainerEditor' at the following links:
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.1/CLR2.0/html/WinControlContainerEditor.html
and
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.1/CLR2.0/html/WinControlContainerEditor_Embed_Any_Control_within_WinGrid_Cell_using_UltraControlContainerEditor_Component.html
2. You could change the style of the column like in the following code sample:
e.Layout.Bands[0].Columns[0].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.IntegerWithSpin;
Please do not hesitate to contact us if you need any additional assistance.
If I am using
this.ultragrid1.displaylayout.bands[0].Columns[5].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.IntegerWithSpin;
Is below the correct way to withdraw the value?
this.ultragrid1.Row[i].Cells[5].Text
It depends on what exactly you are trying to withdraw. You could read the information about the 'Text' and 'Value' properties and the 'GetText' method of the 'UltraGridCell' at the following links:
1. http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.1/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v11.1~Infragistics.Win.UltraWinGrid.UltraGridCell~Text.html
2. http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.1/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v11.1~Infragistics.Win.UltraWinGrid.UltraGridCell~Value.html
3. http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.1/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v11.1~Infragistics.Win.UltraWinGrid.UltraGridCell~GetText.html