I'm a newbie for infragistics. On my Winforms app, I am using Ultrawingrid to display data from the database.
How can I show a checkbox column in the grid as the first column? In addition, I have to capture the check / uncheck event and then read related Grid Row / Room in the application.
Can you help me on this?
Thanks for reading. / P>
You also get control over the UltraGridColumn example for columns you want to provide as a checkbox Need for Something like this:
Ultragrid column ugc = myGrid.DisplayLayout.Bands [0]. Column [@ "Michaelholm"]; Then change the display style of the column to the checkbox and make sure it allows editing:
ugc.Style = ColumnStyle.CheckBox; Ugc.CellActivation = Activation Allow editing; In my opinion, it is appropriate for this grid enforcement code in a handler for the load event or the InitializeLayout event of the grid.
(E.Cell.Column.Key, @ "myColumnKey")) {some checkbox value changes}}
According to the request, here is a sample code which is an unbound Adds columns, taking it to the left, getting a cell transit event, and getting an extra price from the grid.
Public Partial Sections Form 1: Form {Public Form 1 () {Initial Group (); } Private Zero Form1_Load (Object Sender, EventArgs e) {using (SqlConnection Conn = New SqlConnection ("Data Source =; Initial List = tempdb; Trusted_Connection = True")) {Dataset DS = New Dataset (); SqlDataAdapter da = New SqlDataAdapter ("Choose * from sysobjects", Kon); Conn.Open (); Da.Fill (DS); Ultragrid 1 Data source = ds; }} Private Zero UltraGrid1_InitializeLayout (Object Sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgsE) {UltraGridColumn checkColumn = e.Layout.Bands [0]. Columns.Add (@ "checkColumnKey", @ "title"); CheckColumn.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.CheckBox; CheckColumn.CellActivation = Activation. Allow editing; CheckColumn.Header.VisiblePosition = 0; } Private Zero UltraGrid1_CellChange (Object Sender, CellEventArgs e) {if {Return (StringComparer.Ordinal.Equals (e.Cell.Column.Key, @ "checkColumnKey")!); } Bool checkedState = bool.Parse (e.Cell.Text); DataRowView line = e.Cell.Row.ListObject as DataRowView; String name = line As the line [@ "name"] string; MessageBox.Show (string.Format ("Checked = {0}, Name = {1}", Checked State, E. Call.Rowlist Object)); }}
Comments
Post a Comment