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
295
Is there a way to get only those rows which are selected?
posted

There is a grid (Vendor) with four columns

1st - Checkbox  - Unbound

2nd - 4th :- are columns from datasource (created at design time with the Key assigned) (4th is the primary Key of the Vendor table)

THe user might select multiple rows by clicking on the checkbox. Based on this selection I need to fill another drop (get Staff related to Vendor).

Q1. Is there a way I can get all rows so that I can make a comma seperated string of ID's. Or will I have to loop through all the rows, there can be many hundereds rows

Q2. Should I be writting the code on Grid CellChange event or on the DropDown (staff) event

 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

        1) If you are using CheckBoxes, then you will need to loop through the rows yourself. If you use the grid's selection behavior, then you could simply use the Selected.Rows collection.

        2) I'm not sure I understand the question. But if you use CellChange, then you have to be careful, because the Value proeprty of the cell wil not be updated when this event fires. So you have to use the Text property of the cell - at least for the ActiveCell.

Children
No Data