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

Show column inside Grid only when data is coming from database

0 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rahul
Top achievements
Rank 1
Rahul asked on 20 Apr 2017, 05:58 AM

Hi Experts,

I want to bind data to linkbutton or show column inside Grid only only when data is coming from database .

My code as follows:-

<telerik:GridTemplateColumn HeaderText="Assigned" SortExpression="Assign"><br>                    <ItemTemplate><br>                        <asp:LinkButton runat="server" ID="lnkAssign" CausesValidation="false" CommandName="AssignClick"<br>                        Text='<%#Eval("Assign")%>'  OnClick="lnk_Click"></asp:LinkButton><br>                    </ItemTemplate><br>                </telerik:GridTemplateColumn>

 

I have also written code in C# to hide column

protected void rgDenialWorkList_PreRender(object sender, EventArgs e)<br>    {<br>            if (int i == "1")<br>        {<br>            rgDenialWorkList.MasterTableView.GetColumn("Assign").Visible = false;<br>        }<br>    }

 

I am getting error: DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Assign'.

Please Help

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Rahul
Top achievements
Rank 1
Share this question
or