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

[Solved] Grid delete column command

2 Answers 191 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 16 Dec 2009, 08:29 PM
I have a grid that is subclassed from the telerik grid control. It is declared like this on the page

ID

 

="NotarySearchResultsGrid" runat="server" AutoGenerateColumns="false" OnNeedDataSource="NotarySearchResultsGrid_NeedDataSource"

 

 

OnItemCommand="NotarySearchResultsGrid_ItemCommand" AutoGenerateDeleteColumn="false" AutoGenerateEditColumn="false"

 

 

AllowDelete="false" AllowEdit="false" AllowInsert="false" AllowSorting="true"

 

 

ShowViewDetailsCommandColumn="false"

 

 

AllowPaging="true" PageSize="100" PagerStyle-Position="Bottom" PagerStyle-Mode="NextPrevAndNumeric"

 

 

>

 

 

<MasterTableView DataKeyNames="CommissionNumber" CommandItemDisplay="None" >

 

 

<Columns>

 

 

<telerik:GridButtonColumn HeaderText="Commission #" UniqueName="CommissionNumberColumn" ButtonType="LinkButton" DataTextField="CommissionNumber"

 

 

CommandName="CommissionSelected" SortExpression="CommissionNumber" ></telerik:GridButtonColumn>

 

 

<telerik:GridBoundColumn HeaderText="Name" UniqueName="NotaryNameColumn" DataField="Name" SortExpression="Name"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn HeaderText="Address" UniqueName="AddressColumn" DataField="Address" SortExpression="Address"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn HeaderText="City" UniqueName="CityColumn" DataField="City" SortExpression="City"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn HeaderText="Zip" UniqueName="ZipColumn" DataField="Zip" SortExpression="Zip"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn HeaderText="County" UniqueName="CountyColumn" DataField="County" SortExpression="County"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn HeaderText="Status" UniqueName="StatusColumn" DataField="Status" SortExpression="Status"></telerik:GridBoundColumn>

 

 

</Columns>

 

 

<NoRecordsTemplate>

 

 

<div>

 

No records to display.

 

</div>

 

 

</NoRecordsTemplate>

 

 

</MasterTableView>

 


However, when the grid displays, there is an extra column at the end of the grid. Looks like a hyphen or the beginning of an underline in the column header area but no data in the column. Using the IE dev toolbar, I'm able to see tha tthe UniqueName for this column is DeleteCommandColumn. Both AllowDelete and AllowAutoGenerateDelete columns are set to false in the code above. Is there another setting I can set too? Nothing jumped out at me.

Thanks,
Dennis

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Dec 2009, 05:25 AM
Hello Dennis,

I am not sure about why this happening in your end. But, can you try the following code in PreRender event in order to hide the column and see whether it works for you?

CS:
 
    protected void NotarySearchResultsGrid_PreRender(object sender, EventArgs e) 
    { 
        NotarySearchResultsGrid.MasterTableView.GetColumnSafe("DeleteCommandColumn").Visible = false
    } 

-Shinu.
0
Dennis
Top achievements
Rank 1
answered on 17 Dec 2009, 07:31 PM
I'm not sure why it is happening on my end either. I've got mad skills when it comes to not getting these controls to work the way they are supposed to! ;-)

Thank you for your help. That worked like a charm.

Dennis
Tags
Grid
Asked by
Dennis
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Dennis
Top achievements
Rank 1
Share this question
or