Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
765
Wingrid
posted
Visual Basic

Hello

I fill a grid with DataSource from a database. How can I reach that Grid manuel sets a column with a check box in VB.

Keep how can I then query, in which lines the checkbox was selected by the user.

I hope it can help someone.

Thank you very much
Ronald
  • 6120
    Offline posted

    Hello Ronald,

    By setting a Column Style to CheckBox you can make that Column display a checkbox in it. For example:

    Me.ultraGrid1.DisplayLayout.Bands(0).Columns("Column1").Style = Infragistics.Win.UltraWinGrid.ColumnStyle.CheckBox

    There is a possibility of checking which cells are selected in the CheckBox column by doing something like below in the Grid InitializeRow event. Then you can add these selected rows to a Rows collection.

    If Convert.ToBoolean(e.Row.Cells("Column1").Value) = True Then

    'Add it to the custom rows collection.
    End If

    Alternatively, you can enable filtering on the Grid and filter for "True" values in this column. Then the filtered in rows will be the selected rows collection.

    Please let me know if I may be of further assistance.

    Sincerely,
    Sahaja Kokkalagadda
    Associate Software Developer