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

Manage Edit,Delete columns with Grid?

3 Answers 144 Views
Grid
This is a migrated thread and some comments may be shown as answers.
hazzoom
Top achievements
Rank 1
hazzoom asked on 22 May 2008, 10:50 PM
Hi,

I have a rad grid that:

<

telerik:RadGrid...
AutoGenerateEditColumn="True"
AutoGenerateDeleteColumn="True"

<

MasterTableView...
AutoGenerateColumns="True"

That means i do not have any columns in aspx because i bind the grid to the datasource in "DropDownList1_SelectedIndexChanged" event.

How to:
1- Change "Edit,Delete" column index?
ex: Make Delete column the last one.
 
2- Convert "Edit,Delete" column "ButtonType"  to "ImageButton"?

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 23 May 2008, 05:07 AM
Hi Hazzoom,

Try swapping the Columns using the Colum UniqueName Property.

CS:
protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        
       RadGrid1.MasterTableView.SwapColumns("AutoGeneratedDeleteColumn","SupplierID" ); 
    } 



Thanks
Shinu.
0
hazzoom
Top achievements
Rank 1
answered on 23 May 2008, 12:59 PM
It`s no use because

[codebehind]
Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
        Select Case Me.DropDownList1.SelectedValue
            Case "Accounts"
                Me.RadGrid1.DataSourceID = "AccountsDS"
                Me.RadGrid1.MasterTableView.DataKeyNames = New String() {"AccID"}
....
End Select
End Sub
[/codebehind]

So i cant deal with columns in "RadGrid1_PreRender".

Any other solutions?
0
hazzoom
Top achievements
Rank 1
answered on 23 May 2008, 05:32 PM
I changed the way i used and now i had a rad grid per table instead of one for all, it`s better to have more control.

Thanks.
Tags
Grid
Asked by
hazzoom
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
hazzoom
Top achievements
Rank 1
Share this question
or