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

[Solved] problem with radgrid

2 Answers 96 Views
Grid
This is a migrated thread and some comments may be shown as answers.
incrysis incrysis
Top achievements
Rank 1
incrysis incrysis asked on 15 Jan 2010, 02:15 PM
hi,
i'm trying to use a radgrid.
I have a grid with 2 colums defined in aspx and by behind code i insert some others colums.
i put the colums in the grid in the correct order.
When i run the page the radgrid is correct but when i make sort and change page the grid loses some colums and shows the colums in a strange way without respect my order.

this is my aspx code:

<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="sqlDataSource1" AllowPaging="true"
           AllowSorting="true"  PageSize="15" Width="100%" Height="600px" AutoGenerateColumns="false"  >
         <PagerStyle Mode="NextPrevAndNumeric" />
            <MasterTableView>
                <Columns>
                    <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="alfa" Text="Alfa"/>
                    <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="delta" Text="Delta"/>
                    
                </Columns>
            </MasterTableView>
            <ClientSettings>
                <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True"></Scrolling>
            </ClientSettings>
        </telerik:RadGrid>

this is my colums insert :
 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim bc As Telerik.Web.UI.GridBoundColumn
        bc = New Telerik.Web.UI.GridBoundColumn()
        bc.DataField = "IDBatch"
        bc.HeaderText = "ID batch"

        RadGrid1.MasterTableView.Columns.Insert(0, bc)

        bc.DataField = "Type"
        bc.HeaderText = "Type"

        RadGrid1.MasterTableView.Columns.Insert(1, bc)
      

    End Sub

someone can help me?
thanks

2 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 15 Jan 2010, 04:06 PM
Hello Incrysis,

I would suggest you to review the following help article (the "Adding columns programmatically" section):

Using columns

Regards,
Martin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
incrysis incrysis
Top achievements
Rank 1
answered on 18 Jan 2010, 02:28 PM
hi
i resolve the problem
thanks
Tags
Grid
Asked by
incrysis incrysis
Top achievements
Rank 1
Answers by
Martin
Telerik team
incrysis incrysis
Top achievements
Rank 1
Share this question
or