Hi guys. I wanted to have a winGrid with only two columns. The first of these columns would be normal and then the second would be a combo. I fill my WinGrid with a data table as follows:
DtUnits Dim As New DataTable ("dtUnits") dtUnits. Columns.Add ("Data") dtUnits. Columns.Add ("Unit") While dateB <dateF Dim row As DataRow = dtUnits.NewRow () row (0) = dateB 'Date mm / dd / yyyy row (1) = "I want COMBO HERE BASED ON another DataTable" dtUnits.Rows.Add (row) dateB = DateAdd (DateInterval.Day, 1, CDate (dateB)) end While Me.GRID.DataSource = dtUnits The combo would serve to enter the unit available on that date, then the combos would be different. I would have units available at a date and unavailable elsewhere. I inserted the code "e.Layout.Bands (0). Columns (" Unit "). ColumnStyle.DropDownList = Style" at the event InitializeLayout
Hi,
I'm afraid I still don't understand.
Can you explain exactly what you are trying to do?
Have you got this working or are you still having a problem?
Your post here seems to have stopped in the middle of a sentence, so I do not understand what you are trying to say.
I solved the problem in the event InitializeRow. the problem is that by losing the focus back to the initial value
Dim objValueList As New Infragistics.Win.ValueList abrirBDMain() sql = "SELECT hotel_tblUHs.idUH, hotel_tblUHs.nomeQuarto, hotel_tblTiposUH.idTipoUH FROM hotel_tblTiposUH INNER JOIN hotel_tblUHs ON hotel_tblTiposUH.idTipoUH = hotel_tblUHs.tipoUH WHERE (((hotel_tblTiposUH.idTipoUH)=" & Me.txtTipoUnidadeReserva.Value & ") and NOT EXISTS(SELECT hotel_tblCheckinUH.idUH, hotel_tblCheckinUH.data FROM hotel_tblCheckinUH WHERE hotel_tblUHs.idUH = hotel_tblCheckinUH.idUH AND (((hotel_tblCheckinUH.data)=#" & formatarDataEUA(e.Row.Cells("Data").Value) & "#))))" RS.Open(sql, BDMain, ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockReadOnly) While Not RS.EOF objValueList.ValueListItems.Add(RS("IDuh").Value, RS("nomeQuarto").Value) RS.MoveNext() End While RS.Close() fecharBDMain() e.Row.Cells("Unidade").ValueList = objValueList
I need to fill a datatable with a sql statement to combo line. combo of each grid will have different values. At home the picture below for example. In one day need to show some units and other units on another day. I do not need filtering. I need to fill again with a datatable.
What part of this is giving you trouble?
Here are a couple of links that might help:
HOWTO:What is the best way to place a DropDown list in a grid cell?
Creating a dropdown list in a grid cell whose list values are dependent on another cell - Windows Forms - Infragistics Community
a combo of each row will have different values