i'm developing new features old project developped in asp.net forms/vb.net , .net 3.5, 1 of features batch operation consists of letting user select multiple rows datagrid (lets grida) press button start operation, server should display list of selected items in grid (lets gridb) in modal popup (i'm using modalpopupextender ajaxtoolkit) user should fill informations on popup , validate operation using 'validate' button.
so, implement row selection added templatecolumn display checkbox this:
<asp:templatecolumn> <headerstyle horizontalalign="center"></headerstyle> <itemstyle horizontalalign="center"></itemstyle> <headertemplate> <asp:checkbox id="selectall" runat="server" /> </headertemplate> <itemtemplate> <asp:checkbox id="itemselector" runat="server" /> </itemtemplate> </asp:templatecolumn>
the datagrid (grida) bound dataset retrieved directly database.
my question how list of selected items (on server side) grida after user press button 'start' starts operation ?
if have other suggestions on how implement scenario, ideas welcome :-)
i finaly figure out,
on operation-button click handler added bit of code allow me identifie selected rows , id of data item :
for each item datagriditem in objdatagrid.items dim checkbox checkbox = ctype(item.findcontrol("itemselector"), checkbox) if not checkbox nothing andalso checkbox.checked ' row id in third cell in invisible column dim cell tablecell = item.cells(2) if not cell nothing andalso cell.text <> vbnullstring ' registering row id on arraylist retrieve later selectedcards.add(cell.text) end if end if next
after load selected data items database using ids stored on selectedcards arraylist.
good luck!
Comments
Post a Comment