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

Deleting a column and get the column count

1 Answer 32 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jerry
Top achievements
Rank 1
Jerry asked on 01 Aug 2012, 04:42 PM
I am new to programming i facing a situation where i need to delete a column to find the new column count of the radgrid.

 Private Sub btnNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNext.Click

        rgdGridOutput.DataSource = ds.Tables(intTableCount)
        rgdGridOutput.DataBind()
        Dim x As Integer = rgdGridOutput.MasterTableView.Columns.Count
       
        rgdGridOutput.MasterTableView.GetColumn("ServiceOutput_Id").Visible = False
        rgdGridOutput.MasterTableView.GetColumn("ServiceResponse_Id").Visible = False

        Dim y As Integer = rgdGridOutput.MasterTableView.Columns.Count
end Sub

I am getting both x and y values as 0. Actually table has 3 columns.

Thanks,
Ajay

1 Answer, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 02 Aug 2012, 06:30 PM
Hello,

try to access column in below event.

protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e) 
//or
Protected void RadGrid1_PreRender(object sender, EventArgs e)
//or
protected void Page_PreRender(object sender, EventArgs e)


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Jerry
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or