This is a migrated thread and some comments may be shown as answers.

RadGrid Multi-Selection Life Cycle

3 Answers 293 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 14 Aug 2008, 01:03 AM
I am trying this in RadGrid:
Select multiple rows. Click on "Edit" button and display one editing form beside RadGrid for bulk-editing purpose.

I have done the multi-selection settings for RadGrid:
1. Add AllowMultiRowSelection="True" attribute.
2. AllowClientSideSelection = True
3. Add GridClientSelectColumn for selection
        <radG:GridClientSelectColumn HeaderStyle-Width="40px" >
            <HeaderStyle Width="40px"></HeaderStyle>
        </radG:GridClientSelectColumn>


To handle the editing,  I need 2 events to handle the issues:

On server side:
I need to get the list of ID of each row is selected. The ID is the first column from DataSource, it is also the second column in RadGrid. I use RadGrid1.SelectedIndexChanged event to get the info, but I have difficulty in getting ID list. Can you show me the code?

On client side:
I need an event to disable the editing form if the row select changed.
I use OnRowSelected = return confirm('select?'); for a test. But it does not respond as I expect. Can you tell me where or which event I should use?

Thank you very much!

Darren L.

3 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 14 Aug 2008, 11:21 AM
Hello Darren,

Please check the first this in this example:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Programming/CommandItem/DefaultCS.aspx

Regards,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Darren
Top achievements
Rank 1
answered on 14 Aug 2008, 08:25 PM

Thank you for the link, but it is not what I am looking for....

I am looking for:

1. Make a list of ID column from multi-selected rows in SelectedIndexChanged event on server side.

2. An event on client side to trigger some code when index was changed on client side. ("Enable Client-Side Rows Selection" is checked).


0
Darren
Top achievements
Rank 1
answered on 15 Aug 2008, 04:44 PM
        Dim list As ArrayList = New ArrayList()
        For Each item As Telerik.WebControls.GridDataItem In RadGrid1.SelectedItems
            list.Add(item("ID").Text)
        Next


<ClientEvents OnRowSelecting="RowSelecting" />

function RowSelecting(sender, args)
{
    if(!confirm('select?'))
       args.set_cancel(true);
}

Tags
Grid
Asked by
Darren
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Darren
Top achievements
Rank 1
Share this question
or