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

DataBinding and custom controls

1 Answer 71 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 2
Michael asked on 21 Apr 2009, 11:44 PM
Hello -

If I set the FieldName of a databound column, the corresponding values are displayed within the column.  This is normally desirable.  However, I happen to be using a custom element in that column, and the text drawn by the grid interferes with my element's visualization.  If I do not set the FieldName of the column, the problem disappears.  However, I then cannot sort or group the column.  Is there a way for me to sort/group by a databound column without the grid displaying the value of the column in the cells?

Thanks,
- Mike

1 Answer, 1 is accepted

Sort by
0
Accepted
Jack
Telerik team
answered on 23 Apr 2009, 09:22 AM
Hi Michael,

Yes, this is possible. You should handle the CellFormatting event and set the Text property to an empty string. Here is a sample:

void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e) 
    if (e.CellElement.ColumnIndex == 1) 
    { 
        e.CellElement.Text = ""
    } 

I hope this helps. Should you have any other questions, feel free to ask.

Greetings,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Michael
Top achievements
Rank 2
Answers by
Jack
Telerik team
Share this question
or